Checking for a live internet connection

Hi,

I am trying to figure out a way to have Vera check for a live internet connection and if it is not present then cycle an appliance module the resets my router and modem. The only way I can think of to do this is to try and ping an external website and if it errors out then do the reset.

I haven’t a clue where to start on coding something like this in Luup so if anyone could give me a start I would really appreciate it.

Thanks for your help,

Mark

Take a look at the Ping Sensor plug-in; do a search here.

It’s actually much easier than you would think…now that I am on .1245 my unit will not boot with no internet! It gives an error message saying it is trying load some XML files and won’t function until internet is restored! Ha
Figure that one out!
Regards
Tim Alls

[quote=“TimAlls, post:3, topic:168570”]It’s actually much easier than you would think…now that I am on .1245 my unit will not boot with no internet! It gives an error message saying it is trying load some XML files and won’t function until internet is restored! Ha
Figure that one out!
Regards
Tim Alls[/quote]

Tim,

Did you file a bug for that? Or have tech support look at the issue?
(Welcome back for now…)

Thanks guys, this is exactly what I’m looking for!

Mark

@MarkC and @oTi@

Actually, work has begun to overhaul/update the pingsensor code.
Latest version is available from the code repository now:
http://code.mios.com/trac/mios_ping-sensor

referencing: http://forum.mios.com/index.php?topic=1997.0

Hope this helps!

Henk

[quote=“MarkC, post:5, topic:168570”]Thanks guys, this is exactly what I’m looking for!

Mark[/quote]

Take a look at the Ping Sensor plug-in; do a search here.[/quote]

Thanks Henk.

I’m having some trouble creating this device for some reason. I go to the “Create Device” tab, enter “D_PingSensor.xml” in the UpnpDevFilename field, give it a name and hit the “create device” button. I just get a generic device with none of the configuration options.

Any idea what I might be doing wrong? It seemed to work when I created my TED5000 device plugin.

Thanks for your help,

Mark

Mark,

No problem, ive ran into that many times with luup coded plugins.
What usually did the trick for me was a soft or hard reboot of the box.
Let me know if that works.

Since you already installed other plugins i assume you followed the correct procedure to upload the appropriate files. Just to make sure, heres the low down:
http://wiki.micasaverde.com/index.php/Install_LUUP_Plugins

When you decide to upgrade to a new version make sure to remove ALL files that the plugin package exists of before loading new versions.
A guideline is here:
http://wiki.micasaverde.com/index.php/Remove_Obsolete_Files
Although since im on windows i switched to using SCP as that gives me a nice gui to manage veras filesytem

Hope that helps!

[quote=“MarkC, post:7, topic:168570”]Thanks Henk.

I’m having some trouble creating this device for some reason. I go to the “Create Device” tab, enter “D_PingSensor.xml” in the UpnpDevFilename field, give it a name and hit the “create device” button. I just get a generic device with none of the configuration options.

Any idea what I might be doing wrong? It seemed to work when I created my TED5000 device plugin.

Thanks for your help,

Mark[/quote]

Ok, I did what Henk suggested and it works now, thank you.

Now I’m having a problem reading the “Tripped” variable. Do you see anything wrong with this?

local lul_Tripped=luup.variable_get(“urn:schemas-micasaverde-com:serviceId:SecuritySensor1”,“Tripped”,38)

This should be returing the value of the “Tripped” variable as either “0” or “1” as far as I can make out, but it isn’t.

Any suggestions?

Thanks,

Mark

“urn:micasaverde-com:serviceId:SecuritySensor1”

i.e., no “schemas-” on service IDs.

Thanks! That’s been bugging the heck out of me, can’t believe I missed that.

Typically you need to restart the Luup engine to get things to initialize. So hit the circular arrows (that also turn into the SAVE button), top right next to the question mark after creating the device.

Not sure if you were coding this on purpose, but you can also use [tt]An armed sensor is tripped[/tt] with [tt]Tripped?[/tt] set to [tt]Yes[/tt] or [tt]No[/tt] to kick off a scene (to switch an appliance module, e.g.).