I have a shelly switch which is behind a heating device. The switch is triggered in a specific case and will swith off if certain values are met.
I want to calculate the minutes this switch has been on. I want to retain that data in a way untill i decide to reset that value.
I already created a sensor that is calculating the minutes per day the device was on. At midnight this data is reset.
How do i save this value and where? I want to be able to see over a period of time howlong the device was actually on, so i want to see accumulated data over time.
I have created the following Sensor which is holding todays value of minutes the switch was on.
platform: template
sensors:
kachel_minutes:
friendly_name: “Kachel Minutes”
entity_id: sensor.kachel # Replace with the actual entity_id of your history_stats sensor
value_template: “{{ states(‘sensor.kachel’) | float * 60 }}”
unit_of_measurement: ‘min’
Can you help me further in retain this value before this sensor will get it’s reset before midnight and keep this value accumulated untill i decide to reset.