I run Homeassistant on a Pi4 running HAOS. It connects to the router by cable. Some other devices connect to the WiFi.
I had a situation the other day where the WiFi went off on the router (Teltonika RUT-951). A full power-cycle was required to get it back, so the various tools on the router were no use (e.g. it reboots if pings to defined addresses fail).
I’m looking for a way to detect that the WiFi has gone off so that I can have an automation cycle the router’s power using a GPIO relay.
I can’t use ping, because the router is reachable over Ethernet. If I enable the WLAN connection on the Pi, is there a way to detect that a particular WLAN has gone? Or is there another way?
So… wi-fi is down, but the router is still connected to the internet, and since HA has a wired connection to the router that is also still connected to the internet, but without access to wireless devices.
You might be able to use error messages in the log to trigger the automation - there will be a ton of those.
Isn’t it as simple as pinging a wifi connected device (that is always home) and if the ping fails, in all likelihood wifi is down, so reboot the access point.
There’s a chicken and egg problem. All the smart plugs are either WiFi or Zigbee etc. and I don’t want to introduce Zigbe just for this. If the WiFi is down, I can’t control the smart switch !
Yes, but no
In every other respect, the Teltonika RUT series are ideal for this environment as they are designed for embedded systems with multiple WAN technologies, including 4G - which I am using. I can find no instances in their support forums that this has occurred elsewhere, so I’m loath to chuck it out over something that may never re-occur. However, I do want to have something in place inc are it does. This “system” will be installed remotely and over 90mins from my location - I don’t want to have to visit unnecessarily.
Sounds like you need something completely outside HA to throw the switch - something that can be triggered with a phone call maybe (sensitive territory here ).
I actually forgot Bluetooth in the list, but you could maybe automate it a bit with a ESP that detects the WiFi failure and then cuts the power to the router, waits 30 seconds and connects it again.
This could run without an external interaction.
I think this is probably the best solution. On my wish-list for this remote system is some sort of hardware watchdog that will be completely independent of the ‘active’ devices. This could be the best approach. Thanks.