I wouldn’t know by heart/in advance. Just try and have a look at the sensors AND the attributes to the sensors.
1 Like
Hi there,
Yes - I was using this answer: Turn off a switch if Rain is forecast for the day - #59 by metbril in the end - not sure why that wasn’t marked as the solution originally.
Here’s two examples of working template sensors:
- name: "8 Hour Rain Total"
state: >
{{ (states.weather.home_hourly.attributes.forecast[0].precipitation|float +
states.weather.home_hourly.attributes.forecast[1].precipitation|float +
states.weather.home_hourly.attributes.forecast[2].precipitation|float +
states.weather.home_hourly.attributes.forecast[3].precipitation|float +
states.weather.home_hourly.attributes.forecast[4].precipitation|float +
states.weather.home_hourly.attributes.forecast[5].precipitation|float +
states.weather.home_hourly.attributes.forecast[6].precipitation|float +
states.weather.home_hourly.attributes.forecast[7].precipitation|float)|round(1) }}
unit_of_measurement: "mm"
- name: "8 Hour Rain Average"
state: >
{{ (states.weather.home_hourly.attributes.forecast[0].precipitation|float +
states.weather.home_hourly.attributes.forecast[1].precipitation|float +
states.weather.home_hourly.attributes.forecast[2].precipitation|float +
states.weather.home_hourly.attributes.forecast[3].precipitation|float +
states.weather.home_hourly.attributes.forecast[4].precipitation|float +
states.weather.home_hourly.attributes.forecast[5].precipitation|float +
states.weather.home_hourly.attributes.forecast[6].precipitation|float +
states.weather.home_hourly.attributes.forecast[7].precipitation|float)|round(1) /8 }}
unit_of_measurement: "mm"
Hope this helps
3 Likes