Power Cycle Routers/Modems with Zigbee Smart Plugs?

Hi all! Please forgive me if this was already asked somewhere else but I couldn’t find it through my searches and googling so figured I’d ask it just in case:

I’m looking to power cycle my router and/or modems either every night or a couple times a week. I was thinking about doing this with regular smart plugs (Wifi) but figured it wouldn’t work as once HA, Google Home, or Alexa put in the command to turn off the switch, the following command to turn it back on would likely not reach the plug I’m guessing.

As I’m new to a lot of home automation, I did some more research on types of automations and devices and found that Z-wave or Zigbee devices don’t use Wifi or BLE etc, but their own specialized frequency. And if I get a Zigbee USB Dongle/antenna for one of the USB ports on my X86 HA setup, then I can integrate it with HA. So could I take this to mean I could have HA send the commands to power off and back on a Zigbee Smart Plug even if the router and modem go out in between commands?

Yes you can do that with zigbee or z-wave. But it begs the question… why? People think that’s a cure to their network woes, but it’s just a band-aid. You’re better off getting to the issue of why you need to do that. Figure out why your equipment needs a reboot so frequently.

1 Like

What he said. But also, this is only viable if you already have Zigbee or Z-wave. Both are mesh networks which involve a large number of inter-connected devices passing messages from one to the other. You can’t just stick a dongle in your HA machine.

I agree with the previous answers but just wanted to throw this - rather expensive - solution out there.
Came across an article about it a few days ago:

Thanks all for contributing! Some of my wifi connected devices like blink cameras, stop syncing in real time and sometimes end up not recording a clip for example when motion is detected. I find I end up resolving the issue by rebooting the network every now and then. When chatting with their tech support it will depend on the model but “it can happen sometimes” and a reboot is the remedy.

I’m getting a new router in a couple days but I feel this is more of an issue with the devices themselves, and since I’ve regrettably invested enough in those cameras that I can’t really rip them out, I’m now needing to find a way to automate reboots.

So for zigbee, I was also getting some fingerbots to automate dumb light switches as well as a hub, which I’m thinking is now unnecessary, as I am now looking at getting a USB dongle to control the smart socket when wifi is out. The main appeal about that hub was to easily connect it to smart speakers but getting a dongle on HA ends up serving that purpose right? Well the hub I guess could extend the mesh network so there’s that…

I use the following automation setup to manage my internet when it goes down:

The Asus router that is also acting as my main modem for my ISP connection is managed via the Asus HACS intergration, the NBN modem that is the main line provider connection is plugged into a zigbee smart plug to auto power cycle it.

From there I have it notify me if the WAN connection has an IP and is active or does not and is down to let me know when I can swap back to and forth between the main internet connection or stay tethered via the phone I use as backup.

I also have an Asus mesh router connected to a matter over wifi power board so that I can remotely power cycle it should I need to.

alias: Internet Connection Restart
description: ""
triggers:
  - type: not_connected
    device_id:
    entity_id:
    domain: binary_sensor
    for:
      hours: 0
      minutes: 5
      seconds: 0
    trigger: device
    id: Internet Disconnected
  - trigger: state
    entity_id:
      - sensor.rt_ax88u_wan_ip
    attribute: ip_address
    to: 0.0.0.0
    for:
      hours: 0
      minutes: 10
      seconds: 0
    id: Internent WAN Down
  - trigger: state
    entity_id:
      - sensor.rt_ax88u_wan_ip
    attribute: ip_address
    for:
      hours: 0
      minutes: 10
      seconds: 0
    id: Internent WAN UP
    from: 0.0.0.0
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Internet Disconnected
        sequence:
          - type: turn_off
            device_id:
            entity_id: 
            domain: switch
          - delay:
              hours: 0
              minutes: 0
              seconds: 10
              milliseconds: 0
          - type: turn_on
            device_id: 
            entity_id:
            domain: switch
          - delay:
              hours: 0
              minutes: 0
              seconds: 10
              milliseconds: 0
          - device_id:
            domain: button
            entity_id:
            type: press
      - conditions:
          - condition: trigger
            id:
              - Internent WAN Down
        sequence:
          - action: notify.mobile_app
            metadata: {}
            data:
              message: Internet is Down, use mobile tether.
              title: WAN IP
              data:
                icon: mdi:wan
      - conditions:
          - condition: trigger
            id:
              - Internent WAN UP
        sequence:
          - action: notify.mobile_app
            metadata: {}
            data:
              message: Internet is Up, disable mobile tether.
              title: WAN IP
              data:
                icon: mdi:wan
mode: single

For your setup with the cameras that you have signal issues with I would setup more Access Point nodes that are hardwired back to the main network point in your home to improve the connection based on the locations they are in.

If you have the option I would convert those cameras to hardlined versions instead of wireless.

1 Like

This is amazing and gives me lots to strive for! Thanks so much! I want to eventually set up something like that and yes I’ll also eventually move away from wireless cameras as I just went with an ok out of the box solution for someone getting into smart home tech for the first time. I’ll look to lay some cables and mount proper cameras after I get more HA under my belt. It’s now been just under a week of having HA on an X84 device and I’ve still got a lot of reading to do :slight_smile:

Before you go down this route, I suggest you look closely at your router settings page.

Some routers have options for scheduled reboots or can be rebooted remotely via command

Flash a smart plug with Tasmota and assign rules based on your use case. It doesn’t need internet connectivity. This is what I use as a watchdog in case something fails. HA sends a heartbeat to the plug on a regular basis; if it fails to receive heartbeat, the plug will power cycle. Same process for internet ping. You could write a rule to power cycle on a specific schedule as well.

Example here: Using smart plug to reboot HA/Router as DIY watchdog service? - #2 by francisp

sidebar question: where does this binary sensor come from?

I just removed the id’s from the code.

I also keep a dedicated list on my networking subpage to monitor things

WAN being connected means the NBN modem has connection and is working, Internet means that its checking if my ISP connection that is using the NBN backhaul is working or not.