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

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.

2 Likes

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:

esphome:
  # ...
  on_boot:
    then:
      - 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:

wifi:
  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.
Always!
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…

2 Likes

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:

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

:100:

OK this is cheap but not able to detect power loss/restore without additional hardware, this is what the goal was with this SIMPAL and on top to have the possibility to stop/start one slave plug using SMS or call… Surely expensive but reliable and stressless when I have all my equipments connected on HA (pool, air conditioning/heater, camera, …) as well as (and this is critical to me) the alarm system !!!..

It will not “detect” power loss (wonder how the SIMPAL could do that - with some backup battery pack maybe?) but the power restore will just be a boot event and that will be detected without extra hardware.

esphome:
  # ...
  on_boot:
    then:
      - delay: 5s
      - switch.turn_on: switch_1
      - sim800l.send_sms:
          recipient: '+123456789'
          message: "Power restored and relay turned back on for your convenience"

Actually with one esphome device with a sim800l you can control all devices on ha with sms/call’s - not only one extra device :wink: And really all devices that are connected to ha and not only all other esphome devices.

The docs give just a little sneak preview what could be possible - but as always sky is the limit :raised_hands:

It’s just a complete different niveau having full control over your devices :muscle:

You might want to consider looking at different devices in general. When I lose internet access to my house basically nothing changes smart home wise. Actually I guess I have to go outside to turn the hose on and off, my partner bought that one without checking with me :unamused: Everything else just keeps working, doesn’t even notice the internet is out.

When looking at devices I’d recommend looking up their integration in HA before purchasing. In the top right corner it tells you fundamentally how the integration works, here’s ZHA for example:
Screen Shot 2022-08-25 at 1.04.09 PM

Notice in that paragraph it says “Its IoT class is ‘Local Polling’”. The key word there is “local”. That means it works even if the device and HA are completely cut off from external internet access. The ones you want to avoid say “Cloud Polling” or “Cloud Push”, see here for the list. Those depend on your “internet box” for functionality.

I should note that if your LAN goes down then that will also take some local ones offline. Not Zigbee or Zwave devices since they use a different network entirely but integrations classified as “Local Polling” and “Local Push” may still depend on your LAN being functional. Sounds like that’s ok in this case.

If you would prefer not to look up each and every device you purchase to see what its IoT class is then some good keywords to look for are Zigbee, Zwave and Homekit. If a device implements one of these it is a very high probability it works with HA and it does not depend on the internet. In addition as others have noticed you can make your own local devices with ESPHome. Although I gather from this comment you would prefer to buy off the shelf then build:

Also just a small question, how necessary is it to have a smart plug behind your “internet box”? Do you find you have to restart it a ton or something? If so perhaps you should consider purchasing a new one or asking your ISP for a replacement instead of trying to deal with that yourself.

Just my two cents but sometimes smart stuff isn’t the answer. Like when it comes to power running to the internet box. Even if your smart home can handle an internet disruption, the humans in your house generally can’t. And I don’t know about you but I find it quite disruptive when the internet goes down as my personal devices take a few moments to come back online again. I realize this is probably blasphemy on this forum but IMO some things should remain dumb.

Are you aware that the main problem of the author was not the internet (that he turned off by himself actually) but the failure of HA? He wasn’t at home and couldn’t turn it back on :bulb: