Does a firmware upgrade cycle power supply?

I am running ESPHome on a couple of Wi-Fi enabled smart plugs. If I do an upgrade of the firmware on the smart plugs through the HASS web gui will it power cycle the plug and impact the devices connected to the plug?

The plugs are connected to my home sever for energy monitoring and if the firmware upgrade cycles the power it will take down my HASS install mid upgrade.

Unlikely but it is possible.

The update does not actually power cycle your smart plug device it just reboots the ESP cpu inside it. This could cause your relay to toggle depending on your configuration (restore mode) and which GPIOs are used to control the relay. Some GPIOs do change state at boot. Hopefully the designers of the smart plug were aware of this and chose the GPIO wisely.

Best to test it on another plug first.

I have several wifi plugs based on esp8266 and when I upgrade the firmware they all turn off due to the reboot at the end of the process. I add to set restore_from_flash: true in order for them to keep their state.

It might also possible to keep the gpio states when a esp82xx is resetting just by setting early_pin_init to false . That way it shouldn’t even necessary to save states to flash :bulb:

  • early_pin_init (Optional, boolean): Specifies whether pins should be initialised as early as possible to known values. Recommended value is false where switches are involved, as these will toggle when updating the firmware or when restarting the device. Defaults to true.
1 Like

I can confirm that early_pin_init: false solves the issue and that restore_from_flash is then not needed. Thank you @orange-assistant

1 Like