I used to be able to retrieve the max forecasted temperature for the current day in an automation by accessing {{ state_attr('weather.openweathermap_2', 'forecast') | map(attribute='temperature') | max }}. But when I try accessing the max forecasted temperature, I am unable to retrieve a value. When opening the weather sensor in the entities view, I am able to view the max forecasted temperature, so this issue should not be related to missing sensor data.
If anyone knows what the right way is to retrieve this data, please help
With the removal of the forecast attribute it does make this a bit harder, but the solution is to use the get_forecasts method to populate a sensor that has a forecast attribute and then you are back to where you were before.
Neither.
You just need to call the service in the specific automation you use. Creating a separate template sensor and automation defeats the initial purpose why the get_forecasts service was introduced: to only retrieve the data when it is actually needed.
So at least for the OpenWeatherMap integration, it made zero sense to remove the forecast values. I suspect that the weather.get_forecasts service uses the same function, so calling it every couple minutes doesn’t increase the API usage but I’ll only be sure once I check my API usage statistics tomorrow.