This was exactly what I needed! Was banging my head against this data, and the trick was state_attr to reach the nested data.
I ended up with this to iterate over the forecast data and return true if there was something wet in the forecast for the week. Could apply to the rest of the values in the forecast array, such as a rolling 3 day average forecast temp etc.
template:
- binary_sensor:
- name: "Forecast Precipitation This Week"
state: >
{% set forecasts = state_attr('weather.open_meteo','forecast') %}
{% set forecastedRain = namespace(thisWeek = false) %}
{% for i in forecasts %}
{% if i.precipitation > 1 %}
{% set forecastedRain.thisWeek = true %}
{% endif %}
{% endfor %}
{{ forecastedRain.thisWeek }}
unique_id: 'forecast_precipitation_this_week'
I know old thread,
Only brief look at this & not so experienced wit hHA but is there a way to get more info from open-meteo
i.e Hourly info on rain or even solar etc.
I am guessing a limitation of the API but thought would ask.
I use the API & call from visual basic & can get everything that open-meteo produces but not sure if can access this sort if info from HA.