Emergency safe mode on ESPHome and ESP32 (re-using EN button on GPIO0)
The GPIO0 'enable' button is usually only used at boot to put the device into flash mode. After it has booted, we have a spare physical button on most dev boards. We can use this to flag that ESPHome needs to go into safe mode (ie, not run any components other than wifi and ota). We need to add an ID to the ota component: ota : id : theota password : "(readcted)" Then add the following YAML globals : - id : press_ms type : int binary_sensor : - platform : gpio id : failsafe pin : number : 0 mode : input : true pullup : true inverted : true on_press : then : lambda : !lambda |- id(press_ms) = millis(); on_release : then : lambda : !lambd...




Comments
Post a Comment