How to restart the smart plug that host the internet box?

Hi all !
I had a problem during my hollidays that I would like to solve.

My Home Assistant is running directly hosted on a VM on my internet box (Freebox Delta).
For an unknow reason, my internet box went partially down during my trip (the OS crash, but internet was still alive, as my VM’s), but all sensors that are provided by this internet box became unavailable to HA, and I had no way to access my alarm neither store management thru H.A, as they’re all managed by this internet box. And as the box OS crashed, I add no way to access its management console.
The main problem is when it happen, all stores where closed, my plants had to stay in night mode for 2 weeks++ ;(

My internet box is plugged on a KONYKS MAX EASY smart plug, that I can turn off from H.A (or Tuya App), but unfortunatly as this plug control internet access, when it’s off, there is no way to turn it on again… Do you know ways to achieve this ? maybe plugs that know the restart feature ? and not only the binary turn on / turn off way…

All ideas are welcomed :slight_smile:


Hi Ben,

I use a Shelly Plug S for a similar scenario

In the management interface of your Shelly you have the option to set “AUTO ON” which will turn the device back on X seconds after it is turned off (X can be set by you)


Well just use the button feature instead of switch on the smartplug (if it’s ESP based it’s very easy to do) but in all matters I would never host the home automation on the router/wifi access, it’s very bad idea as you have discovered it :wink:

1 Like

Hi @Floo,
Thanks for your feedback.
Do you think this feature still works with the plug offline ?

Ho do you integrate Shelly plugs with HA ?

Hi @noiwid

Yes, the feature still works when the plug is offline.
This action is performed locally on the device itself.

Intgegration in HA is very simple. There is a Shelly integration within HA core.
New devices are usually auto-discovered by HA

Every esp based plug that is supercharged with esphome can achieve what you want/need :rocket:

1 Like

I would advice you to get something that is not wifi based for this. Either Z-wave or ZigBee just in case it doesn’t switch back then you could at least have an automation to do it.


Thanks for your feedback :wink:

By supercharged you mean flashed with esphome? is there plugs that can be bought natively with esphome?

Yes. It can be even that the smart plug you have has a esp inside and therefor can be “freed” (supercharged with esphome :rocket:)

There are. For example:

1 Like

If it’s need another device again that switches the plug it’s not “fail safe” and kind of a setup @noiwid already experienced and likely wants to get rid of.

The only go to solution imho is a solution that can work completely independent from the a wireless (or wired) connection and can be configured in a way that does everything “on board” (on the device itself).

The line in the esphome yaml to achieve something like this can be simple as:

  # ...
      - delay: 5s
      - switch.turn_on: switch_1

ESPHome Core Configuration - on_boot

1 Like

You’re not seriously comparing a cloud based wifi device with a locally controlled ZigBee/Z-wave and say it’s the same thing.
You must be joking. This is on the same level as “flat earth”.

My experience with ESP-Home is that when they lose wifi they start rebooting every n seconds.
Don’t get me wrong, I like ESP-Home I use it a lot, but I would not have a wifi device to toggle the router at least not without testing it thoroughly.

1 Like

This is what I do. So that my HA could reboot my cable modem even when there is no internet / no wifi.

1 Like

I didn’t do this - no.

When reading the problem @noiwid had with his cloud connected smart plug I expect that he would have exactly the same problems with a Z-:honeybee:/:ocean: plug which is automated from ha to work. That’s because his ha host actually crashed (while the internet was still available) and he couldn’t control his plug :bulb:

The n will be by default 900 seconds if the wifi is not connected and obviously can be changed (including completely disabled) to any value the users prefers:

  reboot_timeout: 1234min

This is also mentioned in the FAQ (always a good read)

ESPHome reboots on purpose when something is not going right, e.g. wifi connection cannot be made or api connection is lost or mqtt connection is lost. So if you are facing this problem you’ll need to explicitly set the reboot_timeout option to 0s on the components being used.

Well the important thing here that wifi plug supercharged with esphome doesn’t need wifi to toggle :bulb:

Me on the other hand wouldn’t use a device that I can’t have fully under control - meaning not only owning some hardware but also being able to fully control the soft/firm/whatever-ware on it. By the looks of it (never did a deep research) none of this Z-Stuff allows you full ownership and therefor advanced local automations for example (which is what the author here is seeking/needing :man_factory_worker:)

But @noiwid ha was down :warning: He would have exactly had the same problems with a Z-Plug like with his Cloud-Plug :man_shrugging:

And did you seriously just said the earth is a :pizza:? You must be joking! :speak_no_evil:

My Z-wave plugs Qubino 16 A have a programmable auto restart feature. You can switch them off by command, they will come back on after configurable amount of time.

There surely are more plug with this feature.
They will also automatically come back on after a power loss.

So ideal for your situation, I guess…

1 Like

Sounds like

so should fit the authors need indeed :+1:

Still a esphome superchaged plug could also do things like ping a ip in the www and do a auto restart of the router/modem if the ping is failing a certain amounts for example. :globe_with_meridians::no_entry_sign:

With full control (ownership) over a device there is no need to already be aware of all features one wants in the future because if it can be added by software it can be always extended :rocket:

1 Like

Why would it?
The whole point with Z-wave and ZigBee is that it doesn’t need internet.
And since Home Assistant doesn’t care about internet then why would it make a difference?
Just explain this part and I’m fine.

If HA can’t control a ZigBee/Z-wave device then you probably need to power cycle/reboot HA. And if the router isn’t working then you are left with manual hands on work.

On the other hand a wifi device that requires wifi for it to not go in to a reboot cycle. I wouldn’t trust it for this without thoroughly testing.

You can call ESP-Home any word you like (power, steroids, supercharged) it doesn’t matter!
You are still adding a device in the problematic area (wifi) which the device is aimed to solve.

Are you sure you are in the right thread? You may want to read the authors post again?

Authors HA went down and therefor lost control for his plug (he could still switch it off via the :cloud: but not on again). If he had a automation in HA for a Z-Plug that would have failed the same way for him because HA was down :arrow_down_small:

It’s really not about the wifi/x/y/z here - actually the opposite. It’s about (even) working without wifi/x/y/z and have automations working completely locally without a external point of failure (ha, internet, etc.):

Didn’t you bother to read my post which debunks your “flat earth” before making the exactly same false claim again?

The FAQ even explains it’s for you… also the esphome site features a search function :mag: (can be very helpful :+1:).

I leave you alone now @Hellis81 - the author should know everything he needs :wave:

So internet box is not the same as internet router?
And sensors provided by this internet box is not wifi sensors?

No wonder he couldn’t access HA if he is on a trip (vacation/not at home) and try to access it via internet.

Yes… Because he switched off his “internet box” i.e. internet router…
Yes that will kill the outside access to his home.

On the other hand an automation that listens for internet access, say ping google.
If it fails toggle the z-wave/ZigBee plug will always work.
Because it’s locally controlled and does not in anyway have anything to with the internet or wifi. (Except for the ping)

To restart internet remotely, I am using a smart plug Simpal T40. I can stop/start remotely with my phone by sending SMS… You need a Sim card in it. You can also be notified when there is a power shutdown and when the power is restored…
That’s what I use to restart my internet connection when I am away and the connection is down…


Sweet, a more self brewed esphome build (relay + esp) together with a sim800l module could achieve the same. Total costs should be less than $10 when ordered from the country of manufacturing :cn:

You are still not aware the authors HA was down? In that case it would just have not worked. :put_litter_in_its_place:
Never! :wink:

On the other hand instead relying on a multiple points of failure cascade for such vital/essential functions it might be just better to put all the logic/automation on the edge (on the plug itself) it should indeed always work :bulb:

This should work when HA is down, WIFI is down, INTERNET is down - just not when the ENERGY is down :zap:

Obviously that can also be combined with a function to automatically turn on the plug again after a power outage:

And with other functions the owner likes :+1:

For example: Just don’t allow that plug to be turned off permanently :muscle:

And that 100% on device so it will always work no matter the “control signal” was given in HA, over the web server or locally with a button press on the device:

  - platform: gpio  # or any other platform
    id: relay
    # ...
    - delay: 5s
    - swtich.turn_on: relay