I am scraping a value for rainfall in the last day from this site Rainfall at Hallaton gauge - GOV.UK which is sensor.rainfall_last_24hr
I want to integrate this to get a value for cumulative rainfall for this year.
The value is published every day in the morning, so I’m using a template sensor to add the new value to itself just before midday thus:
- trigger:
- platform: time
at: "11:59:30"
sensor:
- name: "Cumulative Rainfall"
unique_id: cumulativerainfall
unit_of_measurement: mm
icon: mdi:sigma
state: >
{{ states('sensor.cumulative_rainfall')|float |round(1) + states('sensor.rainfall_last_24hr')|float |round(1)}}
Can anybody advise the best way to do this? TIA