I am using esphome on an esp32 to control a battery powered project. As it is battery powered, I only power the esp32 when needed. To do this, I use a zigbee mcu that enables the power to the esp32 using an SR latch. When the esp32 is done, it shuts itself off using the reset line of the SR latch. I have seen that esphome also has a shutdown switch. Is there any advantage of shutting down the esp32 over just cutting the power to it? Is there a way of pulling a gpio high immediately before the shutdown to trigger the reset of the SR latch? I have seen that the shutdown switch inherits the on_turn_on
action from switch, but I wonder how the timing works. If the on_turn_on
action is executed before the remaining shutdown routine is executed, if any exists, the esp32 would lose power and could not execute it anyway. Ideally, the on_turn_on
would need to be executed as the very last step, but I could not find any details to this in the documentation.
Thanks!