Hi!
It is possible to have a cumulative counter that save the value and restore after power cycle?
Either in ESP32 eeprom or HA.
I have one sensor that is turned on for 60 seconds, one time per hour (it’s a PM sensor). What I would like is to create a counter for how long this sensor was ‘on’ during his entire life.
You can use Globals with restore_value: true and activate esp8266_restore_from_flash to store the values in flash memory. But remember that flash has only about 100,000 write cycles.
Don’t even need to set esp8266_restore_from_flash since I’m using ESP32 and this property doesn’t work for ESP32.
Counter still even after flashing with a new version os firmware/program.