I had a momentary power failure last night. It lasted only a second or so but was enough for all my devices to power cycle, including the IoTaWatt and WiFi router.
All my other devices came back up and reconnected to WiFi as soon as it became available. But IoTaWatt only reconnected to WiFi more than 1 hour later. I know this because Home Assistant told me IoTaWatt status changed from “unavailable” to “turned on” at 1:22 AM (power failure at 12:18 AM) and my WiFi router says the connection time for the IoTaWatt is about 1 hour less than all my other devices.
This is no problem for IoTaWatt itself - it was able to continue logging its data, but it did have a couple of side effects in other systems.
- No data uploaded to PVOutput during that time, and my system is configured to alert after 15 minutes of inactivity.
- Home Assistant running automations in the middle of the night based on the changing status of its IoTaWatt sensors.
I understand that if no known WiFi network is available when the IoTaWatt powers on, it goes into AP mode so you can connect to it and reconfigure it. But I’ve seen other reports where a power failure and the relatively fast startup of IoTaWatt vs WiFi router has caused unexpected connectivity issues.
Would it be possible to have IoTaWatt re-scan for known WiFi networks more frequently when in AP mode, and immediately reconnect to a known network when it becomes available?
I’d like it to do this even if the AP itself has connected clients, because I think people’s phones or computer that were used to setup the IoTaWatt might reconnect to it after a power failure, because users will almost always not tell their devices to “forget” that network.
But I suppose the IoTaWatt could also check that any connected clients are idle (no HTTP requests to the IoTaWatt interface in 60-300s?) before reconnecting to the known WiFi network.