I have a timer controlled pump built into my tankless water heater, and I’d like to know how often it runs and how long it runs every time. To do that, I plugged a ESP8266 smart plug flashed with ESPHome and added it to Home assistant. My idea was to use the “Connected” status of this ESPHome device and calculate the statistic of that entity. However, there’s always an unpredictable delay between when the device is powered and when HA detects it.
May I ask for any brainstorming how to detect the online/offline event with minimal delay from HA? Thanks!
Another idea is to have the ESPHome device sent an MQTT message periodically, e.g., 1Hz, basically a watchdog and use the MQTT Will to detect its offline event. But I’m looking for any native/elegant idea! Thanks!
