This watchdog relies on the native API connection reboot_timeout
, to do the work. On Boot the ESP the .api-watchdog.yaml
toggles off the switch’s relay supplying power to the Home Assistant for the specified time, ensuring the relay will properly power cycle the device. Additionally, the package is setting up metering sensors for testing and monitoring purposes.
Notes:
-
This project has multiple files arranged as packages for modular setup of hardware, network and features.
homeassistant-watchdog.yaml
- Top level file, that combines the below..api-watchdog.yaml
- Abstracting particulars for the watchdog..network.yaml
- Abstracting network setup..sonoff-s31.yaml
- Abstracting hardware setup.
-
The
.
dot prefix hides the files from ESPHome's HomeAssistant integration. The same can be done with the main file. As to prevent it from getting updated by the "UPDATE ALL" command. Which would result in a premature power cycle for the Home Assistant. Given it likely would not be the last in the upgrade order. -
The
off_delay
should be specified to a sufficiently long enough time, to ensure all dependent devices power cycle and not just the Rpi. Such as any USB-SSD devices and any other USB devices. The default is set to 5s.
Added "off_relay" delay to control proper off time as a managed variable. It is possible that reboot toggled power supply faster than supplies capacitors drain time.