Timer Control for My Modem

It seams that my modem drops out every 10 or 15 days and I can’t communicate with my MIOS Unit. I have to find someone to go over to my rental property and unplug the modem and plug it back in and it works fine. I want to set up a timer on a module to shutdown the modem the start it back up , maybe on a daily basis for 1 or 2 minutes. How would I go about doing this?

RT

Control (with vera) your socket plug in module that feeds the power to the modem.

I just implemented something similar for our remote home that seems to work.

  1. Plug your modem into an Appliance Module and create two scenes.
  2. Create a scene called "Check/Reset Cable Modem) with a 30 minute timer trigger and command to power off the Cable Modem but add the following luup code to the scene.
function outboundTest()
      --Retrieve Google's home page verifying that content was received within 3 seconds
      local httpStatusCode, content = luup.inet.wget("http://www.google.com", 3)
      return ( (httpStatusCode == 0) and (#content > 0) )
end

--Returning false will cancel the scene and therefore will not power cycle the cable modem ==> return true if any tests fail
return not outboundTest()
  1. Create a second scene called “Power up Cable Modem after 10 seconds” that triggers on the event of the Cable Modem appliance module being turned off and includes a command to turn it back on after 10 seconds. This approach also provides a safety net so the cable modem will never be turned off more than 10 seconds regardless of the manner used to turn it off (lua, dashboard, physical module button).

  2. As an extra precaution, I added the following luup code to my lua startup.

--Ensure that the Cable Modem (device 16) is set to ON at power up
luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue = "1"}, 16)

The way this works is:

[ul][li]The scene in step 1 pulls Google’s home page every 30 minutes and powers down the cable modem if it fails to pull the content[/li]
[li]The scene in step 3 simply ensures that the cable modem is powered up within 10 seconds of it being powered off, regardless of the method to power it off[/li]
[li]The lua startup code simply ensures that the cable modem is powered up during Vera restart[/li][/ul]

This could all be collapsed into a single plug-in but this uses the Vera out-of-the-box capabilities with very little coding.

Enjoy,
Bruce