Zum Hauptinhalt springen

Pirate Weather Smart-Home-Integration, kostenlos und Open Source

Pirate Weather-Integration für Gladys Assistant

Weltweite Vorhersagen, minutengenauer Regen und amtliche Wetterwarnungen, kostenloser API-Schlüssel.

Info

Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.

Weather for Gladys from Pirate Weather, the open successor of the Dark Sky API: current conditions, 24-hour and 8-day forecasts, the next 60 minutes of rain and snow minute by minute, and official weather alerts — tornado, severe thunderstorm, flash flood, hurricane, heat, winter storm warnings from the National Weather Service in the United States, and the alerts of Environment Canada and of the European weather services.

It works anywhere in the world with a free API key.

Powered by Pirate Weather. This integration is a community project, not affiliated with Pirate Weather.

What you get​

  • The Gladys weather widget and the chat assistant use Pirate Weather: current conditions, the next 24 hours, the next 8 days, sunrise and sunset, UV index, and the active alerts with their full text. Everything is shown in °F and mph or °C and m/s, following the unit system of each Gladys user.
  • Weather alert scenes: the built-in Gladys trigger "Weather alert" works with the Pirate Weather alerts — for example "when a tornado warning is issued for my house, turn every light on and send me a message". The integration tells Gladys as soon as an alert appears or changes, so the scene starts within a minute of the refresh that saw it.
  • Scene trigger "Rain or snow expected within the hour": fires when the minute-by-minute forecast starts showing precipitation within the hour.
  • Scene action "Get the precipitation of the next hour": tells a scene whether rain or snow is coming, when, and how strong — to close the awning or skip the sprinklers.
  • Dashboard widget "Precipitation, next hour": the minute-by-minute chart of the next 60 minutes.

Before you start: get your free API key​

  1. Go to pirateweather.net and click Sign up.
  2. Once signed in, subscribe to the forecast API with the free plan (10,000 calls a month). Without this step the key is refused.
  3. Copy your API key.

A new key can take up to 20 minutes before it works: if the test below fails right after signing up, wait a little and try again.

Installation​

  1. In Gladys, check that your house has a location: Settings → Houses, then set the address or the position on the map. The integration refreshes the weather of every house that has one.
  2. Install Pirate Weather from the integration catalog. Gladys asks you to allow access to the location of your houses: it is needed to fetch their weather.
  3. Open the Configuration tab, paste your API key, and save.
  4. Click Test the API key. The answer shows the current temperature at your house and the calls left this month.

That's it: the weather widget of your dashboard now shows Pirate Weather. If another weather integration is installed, you can choose the provider in the settings of the weather widget.

Configuration​

  • Pirate Weather API key — your key. It is only ever sent to Pirate Weather, and never written in the logs.
  • Refresh interval — leave Automatic unless you have a reason (see below). The manual choices go from every 15 minutes to every 2 hours.
  • Language of the scene texts — the language of the sentences the integration writes in scene variables ("Heavy rain expected in 12 minutes (90% chance)."): English, French, German or Spanish. Automatic follows the language of your Gladys.

How often the weather is refreshed, and your quota​

Every refresh costs one call per house, and that single call feeds everything: the dashboard, the chat, the alerts, the scenes and the widget. Opening the dashboard costs nothing: Gladys is served from the forecast in memory.

In Automatic mode, the integration keeps its refreshes under half of your monthly quota, and never refreshes more often than every 15 minutes (the interval Pirate Weather recommends):

Houses with a locationFree plan (10,000 calls)$2/month plan (20,000 calls)
1every 15 min — 2,976/moevery 15 min — 2,976/mo
2every 20 min — 4,464/moevery 15 min — 5,952/mo
3every 30 min — 4,464/moevery 15 min — 8,928/mo
4every 45 min — 3,968/moevery 20 min — 8,928/mo

The other half is a safety margin: restarts, a house added during the month, the test button, and any other use of the same key.

Every answer of Pirate Weather tells how many calls are left until the monthly reset, and the integration watches it: if the calls left cannot carry the current pace until the reset (because the key is shared with another application, for instance), the interval is stretched to fit. A manual interval obeys the same rule. When only a handful of calls remain, the refreshes pause until the reset: Gladys keeps showing the last forecast for up to 3 hours, then falls back to its other weather provider if it has one.

You can check your usage at any time on the Pirate Weather usage page.

Scenes​

Weather alerts (built into Gladys)​

In a scene, pick the trigger Weather alert, choose the house, a phenomenon (any, wind, thunderstorm, flood, heat, cold, snow...) and a minimum severity. Pirate Weather alerts are classified for it:

  • Severity: the official one — Extreme for a tornado warning, Severe for most warnings, Moderate for watches and many advisories, Minor for statements.
  • Phenomenon: read from the alert title. Tornado and severe thunderstorm alerts are thunderstorm; hurricane and tropical storm alerts are wind; storm surge, high surf and rip current alerts are coastal; winter storm, blizzard, ice storm and freezing rain alerts are snow; wind chill, freeze and frost alerts are cold. Alerts with no matching phenomenon (red flag warning, air quality alert, special weather statement) still reach the "any phenomenon" scenes.

Example: Weather alert, house Home, phenomenon thunderstorm, severity extreme → turn on all the lights and send a message to the family.

Rain or snow expected within the hour​

Fires once when the minute-by-minute forecast shows precipitation within the hour where the previous refresh showed none. Filters: the house (its name, exactly as in Gladys; empty for any house), the kind of precipitation (rain, snow, sleet, freezing rain) and the strongest intensity expected (light, moderate, heavy).

Variables for the following actions: the house, the precipitation, the intensity, the minutes until it starts, the probability, and a ready-made sentence — for example "Heavy rain expected in 18 minutes (90% chance)."

A minute counts as wet from 0.1 mm/h (0.004 in/h) with a probability of at least 40%. Light is under 0.1 in/h (2.5 mm/h), heavy above 0.3 in/h (7.6 mm/h). The trigger does not fire twice for the same house within 45 minutes, and never on the first refresh after a restart.

Get the precipitation of the next hour​

A scene action that reads the minute-by-minute forecast of a house (empty: your first house) and returns whether precipitation is expected, in how many minutes, its kind, intensity and probability, and a sentence. Use a condition on Precipitation expected to decide what comes next. It costs no call.

Dashboard​

  • The Weather widget of Gladys shows Pirate Weather as soon as the integration is configured.
  • The Precipitation, next hour widget, added to a dashboard like any widget, draws the next 60 minutes in in/h or mm/h. Leave the "House" setting empty for your first house, or type the name of another one.

Limits​

  • Minute-by-minute is model data, not radar. Over the United States it comes from the HRRR sub-hourly model; elsewhere from coarser global models. It is refreshed at the pace of your quota, every 15 minutes at best: a shower that pops up between two refreshes is announced by the next one.
  • Alerts depend on the region. The United States (National Weather Service), Canada and Europe are well covered; elsewhere it depends on what the national service publishes to the WMO. Outside the United States, alert titles are in the language of the national service (French in Québec, German in Germany).
  • No minute-by-minute forecast for a location: the trigger stays silent, the action and the widget say so.
  • Houses are matched by name in the scene and widget fields: type the name exactly as shown in Gladys.
  • The integration needs Gladys 5.1 or later.

Troubleshooting​

  • "Pirate Weather refused the API key" — check the key, and that you subscribed to the forecast API in your Pirate Weather account. A new key can take 20 minutes to work. Then click Test the API key: if it works, the refreshes start again on their own.
  • "Monthly Pirate Weather quota spent" — the refreshes resume after the monthly reset (the date is shown). Reduce the number of houses or set a longer interval, or support Pirate Weather to double your quota.
  • "No house of Gladys has a location" — set the location of your house in Settings → Houses.
  • The dashboard still shows another provider — open the settings of the weather widget and choose Pirate Weather.
  • Logs: the Logs tab of the integration shows each refresh and the interval chosen ("next refresh in 15 min (auto)").

Privacy​

The coordinates of your houses and your API key are sent to Pirate Weather to get the forecast, and nowhere else. Nothing is stored on disk.

Credits​

Weather data: Pirate Weather, created by @alexander0042 — powered by Pirate Weather. Thank you to the Pirate Weather sponsors who keep the free plan alive.

Konfigurationseinstellungen​

Diese Einstellungen fragt Pirate Weather in seinem Konfigurationsbildschirm in Gladys ab.

EinstellungTypPflichtfeldBeschreibung
Hol dir deinen kostenlosen API-SchlüsselsectionNeinRegistriere dich auf pirateweather.net, abonniere die kostenlose Forecast-API (10.000 Aufrufe pro Monat) und füge deinen Schlüssel unten ein. Ein neuer Schlüssel kann bis zu 20 Minuten brauchen, bis er funktioniert. Powered by Pirate Weather; diese Integration steht in keiner Verbindung zu Pirate Weather.
Pirate Weather API-SchlüsselsecretJaDer Schlüssel aus deinem Pirate Weather-Konto. Er wird nur an Pirate Weather gesendet.
AktualisierungsintervallselectNeinAutomatisch hält die Aktualisierungen unter der Hälfte deines Monatskontingents: alle 15 Minuten für ein Zuhause im kostenlosen Tarif. Jede Aktualisierung kostet einen Aufruf pro Zuhause.
Sprache der SzenentexteselectNeinSprache der Sätze, die die Integration in Szenenvariablen schreibt. Automatisch folgt der Sprache deines Gladys.

So installierst du Pirate Weather in Gladys​

  1. Öffne in Gladys Integrationen: Pirate Weather erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
  2. Klicke auf Installieren. Gladys lädt das Docker-Image (ghcr.io/guim31/gladys-pirate-weather:1.1.0) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration).
  3. Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
  4. Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/guim31/gladys-pirate-weather.

Pirate Weather benötigt Gladys >=5.1.0. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.

Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.

Über externe Integrationen​

Pirate Weather ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von guim31 veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.

Abonniere den Newsletter von Gladys Assistant

Ein paar E-Mails im Monat zu neuen Releases und Neuigkeiten aus dem Projekt. Verschickt von Pierre-Gilles Leymarie, dem Gründer des Projekts. Jederzeit abbestellbar 🙂