My Vera Lite is placed on a remote location with an Internet connection using a 3G usb-dongle in a TP-Link TL-MR3420 router. It works fine - most time… But sometimes, after a week or two, the Internet connection goes down.
I know that the Vera is monitoring the Internet connection. I can see from the log files that it regulary makes requests to servers at Google and other, and I assume the purpose is to detect malfunctioning Internet connections.
But how can I find a event like “Internet connection not available” and use it in the following way:
If Internet connection not available
Then wait 5 minutes
If Internet connection still not available
Switch of router power
Wait 5 minutes (give the router and usb 3g-modem a chance to cool down)
Power the router on
Wait 5 minutes
Start all over
(I am avare that pro- and enterprise-series routers comes with watchdog functions build in. But I have a Vera
You might be able to use the app “Ping Sensor” to check if a website is up and then the app “Program Logic Event Generator” for the logic. You would need to have the devices (Router, Vera, etc) on a Z-Wave enable power switch. I have also heard of people using a old school timer switch that reset the devices every night just in case…
I think you could likely accomplish this using the Ping Sensor plugin to periodically PING an internet address, such as one of your ISP’s DNS servers. You could then use the Virtual ON/OFF Switches plugin to create a virtual switch that indicates the state of the internet connection. Then you create 3 scenes:
[ul][li]Scene 1: Uses a failure from the Ping Sensor to flip the virtual switch to OFF[/li]
[li]Scene 2: Uses a success from the Ping Sensor to flip the virtual switch to ON[/li]
[li]Scene 3: Uses the virtual switch going to OFF to trigger a scene with Luup code that waits 5 minutes and checks to see if the virtual switch is still OFF. If so, “return true” and execute the rest of the scene using custom delays.
[/li][/ul]
The problem is that if your internet connection is bouncing or if maintenance is being done on the internet device the ping sensor is checking, your router could be getting power cycled a lot.
@OtisPreslsy
Waits in LUA code near 5 minutes or longer may trigger Vera to think it has a hung process and restart. You are supposed to use timers and schedule a wakeup function.
As soon as you schedule the function the commands for the scene will run (or not) depending on what your LUA code returns …
[quote=“RichardTSchaefer, post:4, topic:174992”]@OtisPreslsy
Waits in LUA code near 5 minutes or longer may trigger Vera to think it has a hung process and restart. You are supposed to use timers and schedule a wakeup function.
As soon as you schedule the function the commands for the scene will run (or not) depending on what your LUA code returns …
I have a watchdog in my system. I use Ping Sensor to monitor a public IP address (I use a Google DNS server). I have my router and cable modem plugged into a z-wave appliance module. And I use a Program Logic Timer Switch to handle the logic.
If Ping Sensor can’t reach the Google server (presumably because my cable modem or router is hung), that starts a 10 minute timer in the PLTS. When Ping Sensor successfully pings the server, it resets the timer. If the PLTS timer expires, that triggers a scene that turns the appliance module off, waits 30 seconds, and turns it back on (thereby rebooting both the cable modem and the router). (Once PLTS supports delays in the actions, I’ll remove the scene and put the toggle logic in the PLTS actions).
Now, first point is to go to the site in the weekend, and restart the router physical. (Yesterday I was suddenly able to access the router and the Vera from remote. I thought it was a clever decision to reboot the router as the first action. Unfortunately it was not…)
Then I am ready to play with the Ping Sensor.
Best Home Automation shopping experience. Shop at Ezlo!