Hi, everyone,
I’m a newbe with this programming and I’d want to understand about using / modify a variable in ESPHOME.
My project use a ESP32, I receive some state/values from HA and report them in a serial display (Nextion). Now I want to use some variable in order to keepsome time function: every minute I want a simple increment but so far I can’t deploy it!
Let’s suppose:
no worries! You know there is already a “minutes counter” using the time component - the only thing is it resets to zero every hour
But seriously, it may actually do whatever it is you’re doing by counting minutes
This has a problem. When you work with on_boot with high priority like 900 in order to do it as soon after boot as possible, then lambda: id(variable)++ and then ESP.deepSleep does not save changed variable…
You have to set up boot_priority to max 799 in order to global variable get updated. It is done about 70ms after the boot then.