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

I have a C8 on a remote site that randomly looses communication, and I can not connect to it. The internet service provide which I have no control of drops, causing the hubitat to loose connection to the internet.

If i just reboot the hubitat (power cycle), it comes up every time.

The problem, I have to get someone remotely to cycle power for me.

I would like to do the following.

Have a rule that does a pings something like to google 8.8.8.8. once every 60 sec, if google does not reply for a period of 15 mins, then reboot the C8

Can this be done?

What type of devices do you have at the remote site?

(1) C8, with a few door sendors, it is connected using wifi to the facility wifi.

If you havenā€™t yet, Iā€™d install [RELEASE] Hub Information Driver v3 and see if that gives you the information needed.

If it doesnā€™t, my other thought is to get a Kasa smart plug and use the integration. When it goes false for connection you could then reboot the hub (false as your trigger).

1 Like

You shouldnā€™t need any devices to power cycle the hub; just a rule to call a reboot as youā€™ve mentioned. The last thing you want to do is power cycle the hub as that will inevitably end up corrupting the database. As JB10 mentioned you can use Hub Information Driver as the device to action the reboot in Rule Machine.

3 Likes

I agree and didnā€™t mean to imply that the Hubitat should be attached to the plug. The smart plug should just be on a random outlet, not attached, and itā€™s state could be tracked if the hub driver doesnā€™t work.

I have the Hub information device already, and I understand I can use the reboot.

The part I do not understand is how to write the RM for the pinging 8.8.8.8

Can someone send me an example

I just found this:

You would use a schedule as a trigger and then the actions as Robert details. IF the local variable = 100 (no response) then Reboot on Hub Information Driver. My example (untested):


There I'm pinging 192.168.4.100 (My ISP Virgin Media's Primary DNS). It's not obvious where to find a few things in RM:

You can find ping under Action > 'Send message, Notify, Speak, Log, Http Request. To access the reboot command you'll run Custom Action > Actuator then pick your Hub Info Driver and to see the available commands.

1 Like

Hub info also has a cloud status option now. Should be able to have a rule check that status and trigger a reboot when it shows not connected.

image

1 Like

This is what I get

  • cloud : invalid endpoint

I'm running Hub info v3.0.37

I see

  • pCloud : connected

"pCloud" is the new status attribute to use.

1 Like

so I should always see pcloud "connected" if I have a active internet connection?

pCloud is just the new alternate option for checking HE's cloud connectivity with the Hub Info Device tool that JamesTX10 mentioned above.

I don't have any particular suggestions on how to use it, it's just another arrow in the quiver.

I am on V3.0.37 as well. Make sure you fill out "MakerApi or Dashboard URL string" in the preferences for the cloud state to work.

If you use the new pCloud attribute, you don't also need the MakerAPI/Dashboard link (but you can still use both avenues if you'd like).

I prefer the new pCloud option for the reason thebearmay gives in second sentence below, but folks may have other reasons for preferring the ol' MakerAPI/Dashboard link-check option instead.

1 Like

I ran a test, monitoring the "pcloud", when I disconnect the internet cable from my route causing a failure, the hub still shows pcloud connected

I went into the hub info, it is set to update every 2 minutes, i did a refresh, waited 5-10 mins, still pcloud shows connected?

Any thoughts?

That's a bummer -- in that case, I'd try the MakerAPI/Dashboard link option and see if that works as hoped.

Do you have more info about trying the "MakerAPI/Dashboard link option"?

I no nothing about it.

BTW, Thanks for your help

You could also have RM ping a external address. If it does not respond successfully a number of times, then initiate the reboot through the Hub Info Driver.

Dont forget to add logic to prevent it from rebooting continuously if the internet is down.

1 Like