Last active
August 25, 2025 14:11
-
-
Save MattBlack85/d261c4bb78730964a2ff570176efec5c to your computer and use it in GitHub Desktop.
HA weather gathering script (Meteorologisk institutt (Met.no))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Create a new script and paste the following YAML (Update the device to be notified accordingly): | |
| sequence: | |
| - action: weather.get_forecasts | |
| metadata: {} | |
| data: | |
| type: daily | |
| target: | |
| entity_id: weather.forecast_home | |
| response_variable: weather_daily | |
| - action: notify.YOUR_DEVICE_HERE | |
| metadata: {} | |
| data: | |
| message: >- | |
| Sky: {% if | |
| weather_daily["weather.forecast_home"]["forecast"][0]["condition"] == | |
| "partlycloud" %}🌤️{% elif | |
| weather_daily["weather.forecast_home"]["forecast"][0]["condition"] == | |
| "rainy" %}🌧️\nRain: {{ | |
| weather_daily["weather.forecast_home"]["forecast"][0]["precipitation"] | |
| }}{% elif | |
| weather_daily["weather.forecast_home"]["forecast"][0]["condition"] == | |
| "cloudy" %}☁️{% else %}☀️{% endif %}\n High temperature: {{ | |
| weather_daily["weather.forecast_home"]["forecast"][0]["temperature"] | |
| }}°C\n Low temperature: {{ | |
| weather_daily["weather.forecast_home"]["forecast"][0]["templow"] }}°C\n | |
| Humidity: {{ | |
| weather_daily["weather.forecast_home"]["forecast"][0]["humidity"] }}%\n | |
| title: Daily forecast! | |
| alias: gather_weather | |
| description: "" | |
| Then crate a new automation an pasta ethe following configuration (change the trigger time accordingly): | |
| alias: daily forecast trigger | |
| description: "" | |
| triggers: | |
| - trigger: time | |
| at: "07:00:00" | |
| conditions: [] | |
| actions: | |
| - action: script.gather_weather | |
| metadata: {} | |
| data: {} | |
| mode: single |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment