Using a cloud piston + local automation to trigger event locally


#1

Hi all,

I am hoping to build a solution that will automatically reboot my network router when loss of connectivity occurs (or shortly there after). It is not a chronic issue but happens occasionally, seemingly when I am not at home. Any thoughts on the best approach?

My current thinking is somewhat of a ‘dead man’s switch’ approach:

Use an Ikea zigbee outlet which runs locally on Smarthings and controls router power. I can use Smart Lighting automation (which runs locally) to turn off the outlet every 15 mins (on the 15 min mark) and then back on again but only if a virtual switch is in the off position. The virtual switch will be controlled by webcore and will be turned on just prior to the 15 minute mark, then back off. Basically the virtual switch will act as a signal confirming loss of internet connectivity. If the internet goes out, the smartthings hub will not receive the signal that webcore has turned the virtual swtich on, and therefore Smart Lighting will carry out the power cycle at the 15 min mark.

If there is a better way to do this, I would love to hear about it. Also the challenge is that above approach would result in my having to create a seperate Smart Lighting automation for each 15 min increment of the day = 120 automations and there appears to be no way to duplicate smart lighting automations, unlike Webcore.

Many thanks in advance!!


#2

Hi
A quick thought…

Could you write a piston that runs every 15/30 mins, and accesses a simple external web site (e.g google) If there is a timeout/error response, simply turn the routers switch off, wait 20 secs and turn back on.

The switch connected to the router would need to be using a local device handler. You’d get a false restart if the site hosting the URL had a problem, but you could build in safegurads for that. Maybe try more than one site, or only turn off a second time, if the site was accessed ok on the previous run


#3

That’s a great idea! But I’m confused on one part. If the router is down, how would the piston be able to communicate with the outlet to power cycle the router? Pistons run in the cloud I believe. Even though the Ikea outlet will run locally it would need to be triggered to power cycle and I don’t see how a piston could trigger it when the router has lost connectivity.


#4

Good point! I’ve had some things work when the router was down that I didn’t expect to work, they might have been DH though.

You could look at using a hubitat hub, webcore will run on there and everything runs locally.