Open veitw opened 1 month ago
Hey there @fabaff, @freekode, @nzapponi, mind taking a look at this issue as it has been labeled with an integration (openweathermap
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
openweathermap documentation openweathermap source (message by IssueLinks)
Up until version 2.5, I was able to get sensor.openweathermap_forecast_precipitation, but since the migration to 3.0, I do not seem to have this option. How can I retrieve the forecast_precipitation from this integration, please?
Hey @mciantar ,
Up until version 2.5, I was able to get sensor.openweathermap_forecast_precipitation, but since the migration to 3.0, I do not seem to have this option. How can I retrieve the forecast_precipitation from this integration, please?
this is caused by something different; HA 2024.7 removed the forecast entities. Instead you have to use the weather.get_forecasts
service now. The alternative is to create template sensors for these entities.
I did a tutorial on how to emulate all removed entities using templates, just take care to replace all occurrences of weather.home
by your OpenWeatherMap weather.
entity_id.
Find the English version here: https://schoen-technisch.de/en/homeassistant-2024-7-emulating-obsoleted-weather-forecast-entities-using-template-sensors/
Or the German original here: https://schoen-technisch.de/homeassistant-2024-7-weggefallene-wettervorhersage-entitaeten-mittels-template-sensoren-emulieren/
Best regards // Veit
@veitw , Thank you very much for understanding my issue and pointing me not just in the right direction, but also providing a working example. I have managed to get my forecast sensor working again thanks to your help.
The problem
Currently it is required to poll forecasts at intervals from the weather entity to reflect new forecast data after the integration has updated and cached new data.
The entity attributes only contain information about the current weather. While the current weather data usually changes with an update, this is not guaranteed, thus a state trigger cannot be used to reliably detect forecast changes.
Adding a forecasts_as_of timestamp attribute if available from OpenWeatherMap's API, or else a last_cache_update timestamp attribute, would fire state triggers and allow immediate processing of new forecast data even if current weather has not changed.
What version of Home Assistant Core has the issue?
core-2024.7.1
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
OpenWeatherMap
Link to integration documentation on our website
https://www.home-assistant.io/integrations/openweathermap/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response