Ideas needed! How to turn off/on smart outlet remotley if router is down?

I’ve been watching this post and it throws up some good problems of logic. Where to intercept that the internet going down and what to do. I would have thought that HA crashing was more likely and I have 2 separate VPNs outside HA to connect back to my network to reset HA through a Tasmota plug connected to my RPI with HA. What about the suggestion to just get a better router that is less likely to go down. I use >5 year old routers and they have not failed me yet. It’s the ISP or electricity that goes down.

Ok then you need a solution independent of your wifi.

  1. A zigbee or zwave switch and a home assistant automation.

or

  1. A wifi switch loaded with ESPHome that is set up to toggle if it loses contact with Home Assistant.

But what would that automation be? As HA still had internet because its hardwired to the router, a ping of google.com would have always been succesful. To bad Google wasnt more open and I could setup an automation in HA based purely off Google home itself letting HA know that its lost wifi

Had google wifi mesh for about 4 years now. That was the ONLY time I had the issue, of course.

You could ping a fixed (not mobile) wireless device on your network to see if wifi is down.

If the ping is performed from the ESP then it would work.
Is it possible to ping an IP address from inside an ESPHome node? - ESPHome - Home Assistant Community (home-assistant.io)

or

Which one was it?

I would think it makes a difference.

Things are getting mixed here :slight_smile: i have counted three options so far;

  • develop your esphome solution to control the socket. Esphome would ping your router and decide to toggle your socket. Totally independent to HA, no automation is needed here.
  • go with zigbee or zwave, set up an automation in HA to ping router and send commands to zigbee/zwave socket, no internet is needed
  • if your local network is running without router (we know yours is not capable), you can still ping router from HA and set an automation to toggle any local network operating socket (localtuya or tasmota)

Ok I can see how that would be confusing.

So what i meant is when the issue happened, my Google wifi mesh lost wifi for some unknown reason. The google router still had internet coming in. The google router was hard wired to my HA, hence I still had cloud access to my HA, but from my HA I had no access to anything that was using Wifi. (Not many devices, as most are Zwave/Zigb)

So as long as I have cloud access to HA AND my google wifi points are now connected to smart outlets using either zwave/zigbee, I could toggle power to them remotely and hopefully get the wifi back up.

But I was also asking for a solution where in lets assume I did lose complete cloud acess to my HA device because the google wifi router flaked out. I want to be able to cycle power to the google wifi points.

Make sense now hopefully? And I think this thread has given me some great solutions.,

Perhaps this is obvious, but you can power it off, but not on.
As soon as you power off the outlet to the router your access in is lost.
So remember to add an automation to power it back on when it is off with a smal delay

Yes! Cant forget that lol. Im making a automation tied to a input_boolean that would cut power, wait 10 sec and then power up again. Then if the input boolean is not turned off within 10 min (meaning I havent regained access), repeat the process

Alright heres my solution as of now. Every 10 min, HA pings my two wifi points and google. Depending on where the failure is, it toggles power to the outlet powering that wifi point / router & modem. Rinse, repeat.

Here a lot about Tuya; probably because of the recent Home Assistant releases. I may be completely wrong, but is Tuya a software IoT solution and hardware vendors implement devices to support Tuya so that they do not need to get into the software business?

Why should we stay away from Tuya? What is your preferred solution?

Is there any tutorial anywhere on how to do this?

Not that I know of.

Using Tasmota:

Watchdog for Wi-Fi router~

A Tasmota socket can ping a remote host (router itself or something else connected to the router) and power cycle the socket to reboot the router. In this example, ping interval of 3 minutes is used. The simplest watchdog rule does not use variables:

Rule1
  ON Time#Minute|3 DO Ping4 192.168.1.10 ENDON
  ON Ping#192.168.1.10#Success==0 DO Backlog Power1 0; Delay 10; Power1 1; ENDON
Rule1 1
4 Likes

ax0X4A1_700bwp

You are right about Tuya is software but it is also producing hardware for brands. So, anyone can order some smart home stuff from Tuya with their own logo and brand, and you have a new brand. They can even use rebranded mobile app, identical to tuya/smartlife. My warning was about tuya wifi, i am not against any ZigBee or zwave products.

I am a heavy tuya wifi user (blinds socket, thermostats, plugs) and all are over localtuya.

Would it be possible to do the same thing with a Shelly Script?

My router is connected to a Shelly and would like to have the ability to reboot it when I’m not at home.
Moreover, if someone accidentally turn the Shelly switch off I want it to turn it on again after a fixed time, in order to not be cut out from my house when I’m away.

When my router is off all network devices cannot communicate, so the automation has to be stored and executed on the Shelly itself.

In the latter case I think it would be also wise to implement a “safe rule” to avoid to turn the switch on again and again in case of some kind of malfunction.

I answer myself :slight_smile: I don’t need a Shelly’s script to achieve that, there is a native timer function to auto turn on a switch.

1 Like