Need help with creating a rule to reboot C8 based on lost of internet povider

Here's a post about it from the Hub Info Driver thread...

This is my approach... has worked well so far. I'll try to post my rule later this evening.




You would get rid of the dns active un your case.

My rule is actually for rebooting my router, but here is how I detect a LAN outage. Disregard the disabled actions shown in red.

The value variable is the packet loss percentage from the ping result. So if all packets are lost the variable equals 100.

The "child" rule cycles the power to a smart plug that my router is plugged into and then notifies me of the event. The notification is performed after a 10 minute delay to give the router time to fully come up.

I also have a situation like yours at a remote building on my property that is connected via Wi-Fi, On the hub I have a rule that pings a remote adresse every 10 minutes, if I can't reach it 3 consecutive times it will reboot the hub in case it's related with the Wi-Fi. So worst case I'm rebooting every 30-40 minutes if there is a catastrophique problem, this happened once when my router acted up and the Wi-Fi stopped working. After that incident I also have a rule on my main hub that pings the remote hub and warns me via message if it could not reach it.

Most of my critical WiFi devices also have pings from my main hub with messages sent to my phone in case it could not reach it, these rules also helped me diagnose a major problem after switching ISPs and having a bridged modem that messed up my routers IP each time we had a power outage, after talking to the ISP multiple times, we both came to the conclusion that even if the modem was in bridge mode, for a few seconds it would reserve the 192.168.0.1 adresse and make my router change it's IP because of a conflict, then all mi DHCP fix addresses would get disabled and all my WiFi stuff would get some random addresses assigned to them, then a bunch of stuff would stop working in Hubitat. I have since changed ISPs for one that has a regular cable MODEM instead of those stupid all in one units that need to be bridged to work with routers.

to all:

the members here at hubitat are always are very willing to help others.

I want to thank everyone for your always providing awesome support.

i went the ping route, however my logic could use some fine tuning. I need to add what you did, by waiting 3 consecutive times before rebooting. How did you do that? Did you use RM?

Here are screebshots of my RM rule...

And local variables you will have to create for it to work (Count and Value) ...

You will also have to install Hub Information Driver V3 for the reboot function.

1 Like

thanks I will try this later this week when I have time to work on my hub

thank you

I always struggle finding stuff in RM, like in your example, If then "Add 1 to Count", I cannot find that

We all struggled when we first started using RM. Been there, done that.

Step 1: create a variable, type Number, initial value 0.

Step 2: Create New Action (hit the + sign at bottom of Actions):

Step 3: Click "Done with action"

This results in:

Step 4: Click "Done with Actions"

1 Like

thanks anyone, I finally got it working,

Awesome support!

2 Likes

My MR is not working

I found the issue, it my error I left out a step

Can someone send screen shot on how to do the second step

After the Ping 192.168.0.10
This step
Set Value to %value%(0)

Im struggling on how to get that step in my action

Here goes...

thanks for the quick reply

1 Like

again, thanks for your help.

Ok, this is my deal. We have a condo that I monitor the doors, ac, etc all remotely. We are about 6 hours away from our condo, its a rental unit. any, my C8 was going offline, and it was the main reason to have this reboot code.

So this week, we are at our condo, and my goal it to get the C8 more reliable in reference to communication for remote access.

Ok, this is what happen last night. I finally fixed my RM errors with the help of this awesome support group.

We had a storm last night, the my C8 alone with everything else lost internet service, which is a common problem at the condo.

My chromebook, our ipad, iphone, and the C8 all lost internet.

However, the chromebook, ipad, iphones, all recovered on its own WITHOUT a reboot, but the C8 needed to reboot in order the covered communication.

So my question, why does this happen with the C8? Why does it just not reconnect like most devices, now the reboot solved the this. But why do I need to reboot?

The C8 should just reconnect without having to reboot, correct?

BTW, i did not figured this out until last night

Do you have your networking equipment and C8 connected to a UPS? All of my hubs and important equipment are and whenever we have a power outage they remain up and once internet is back up it reconnects with no issue. If you don't have a UPS, I highly recommend using one.

I have the same problem with my C5 with a WiFi dongle, I always thought it was because of the dongle but now I’m thinking it might actually be a problem with the hub itself.

If the router goes dead like it does every now and then because of a power glitch or some other reason. Or if the hub is rebooted and no WiFi signal is available for some reason, it will just play dead and do nothing to try to find the connection. Then my code kicks in, it reboots and all is ok?

Now the router is on a UPS and most of my problems have gone away, but it does still happen every now and then.

yea, I know now because I witness the issue during the storm, we never lost power, not even a blink. But we did loose the internet from the the provided. And the C8 would not recover on its own.

Then about 15 mins later, my RM did the a ping test, and ran the logic to reboot, and the C8 came back online.

In my opinion, the C8, should be able to recover the connection on its own without having to reboot

1 Like

I've had similar issues with my C7 hub not reconnecting, but my approach has been too reboot my router. This has worked well for me...YMMV.