Replies: 1 comment
-
Feel free to make a pull request for this, then I will test it more specifically and possibly merge it if people want this. ./Klaas |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Values for total kWh can be written to flash, so they can be restored after a reboot.
For total_daily_energy this is straightforward, just add to the config:
restore: True
For sensor_total_energy it is a little more complicated as there isn't any
restore:
flag defined. Define a global variable:Limit the frequency ESPHome will write to flash, to reduce wear on flash memory:
Change the
filters:
section intotal:
part ofpulse_meter
to make the global variable equal tosensor_total_energy
:Finally to restore the total after boot, add
on_boot
flag toesphome:
Now
sensor_total_energy
can be set to match the meter total and it will persist between reboots, as willtotal_daily_energy
. Take care with ESP8266 as it has limitations for flash storage. Tested and working on ESP32 (nodemcu-32s).Beta Was this translation helpful? Give feedback.
All reactions