Page 1 of 6

Online Sensor plugin

PostPosted: Sat Feb 04, 2017 1:29 pm
by kmarkley
This is a very simple plugin that creates Indigo sensor devices to reflect aspects of your internet connection. Basically, you can use it to:

  • Ping servers
    • to test general internet connectivity
    • to test availability of a particular service
  • Check your public IP address
  • NEW: run speed tests via speedtest.net

For speedtest devices, you can set a threshold that determines whether the sensor reports ON or OFF. Full speedtest.net results are available as device states.

Details: https://github.com/kmarkley/Indigo-Onli ... /README.md
Download: https://github.com/kmarkley/Indigo-Onli ... ses/latest

Previously posted here.
Speedtest idea/example via FlyingDiver here.

Re: Online Sensor plugin

PostPosted: Tue Mar 07, 2017 10:44 am
by Professor Falken
This is a really useful plugin. Thanks for sharing it.

Is there any way to trigger either the pinging device or the Speedtest one as an Indigo action (which could then be either scheduled via Indigo or triggered by either by event or on demand by a Control Page interaction)?

Similarly, does anyone know the best way to round a Speedtest float result to nearest integer? I was trying to use some gauge images (similar to the WU ones shared a while back by DaveL) to display these results on a CP, but it seems that decimals play havoc with the hersuistics of image selection.

Thanks.

Re: Online Sensor plugin

PostPosted: Tue Mar 07, 2017 10:50 am
by kmarkley
Professor Falken wrote:
Is there any way to trigger either the pinging device or the Speedtest one as an Indigo action


Just use the Device Actions -> Universal Controls -> Request Full Status Update action.

Re: Online Sensor plugin

PostPosted: Tue Mar 07, 2017 10:57 am
by Different Computers
Great idea! My scripted method never worked right, but that's because I'm a terrible scripter.

Re: Online Sensor plugin

PostPosted: Tue Mar 07, 2017 11:24 am
by Professor Falken
Just use the Device Actions -> Universal Controls -> Request Full Status Update action.


Oh that's cool. I didn't know that trick.

Thanks.

Re: Online Sensor plugin

PostPosted: Fri Mar 24, 2017 2:32 pm
by amannone
Great plugin idea. Can't wait to install and play around with it!

Re: Online Sensor plugin

PostPosted: Sat Mar 25, 2017 5:11 am
by ckeyes888
Should this plugin run on 10.6.8?
It loaded fine but it won't create any sample devices, get the "hover over red areas" alert.

Thanks,

Carl

Re: Online Sensor plugin

PostPosted: Sat Mar 25, 2017 9:02 am
by kmarkley
I'm not aware of anything that would be dependent on OS version, but haven't tested it on multiple versions.

Are there any red areas to hover over?

Can you turn on debugging and post the log results?

Re: Online Sensor plugin

PostPosted: Sat Mar 25, 2017 9:08 am
by ckeyes888
No, nothing to hover over...just the alert below the device name.
This is repeated in the log:


Online Sensor Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Online Sensor Error Error in plugin execution UiClosed1:

Traceback (most recent call last):
File "plugin.py", line 87, in closedPrefsConfigUi
<type 'exceptions.AttributeError'>: 'Plugin' object has no attribute 'logger'

Thanks,

Carl

Re: Online Sensor plugin

PostPosted: Sat Mar 25, 2017 10:59 am
by kmarkley
That sounds more like an Indigo version issue than an OS version issue.

I know that adding the logger class to plugins was relatively recent, but I don't recall exactly when. I have only tested the plugin on Indigo 7. Which indigo are you running?

Re: Online Sensor plugin

PostPosted: Sat Mar 25, 2017 11:00 am
by kmarkley
I have just updated the plugin on github. This version allows users to disable automatic device updates -- for folks like Professor Falken who want to use a schedule instead.

Re: Online Sensor plugin

PostPosted: Sat Mar 25, 2017 11:26 am
by jay (support)
kmarkley wrote:
That sounds more like an Indigo version issue than an OS version issue.

I know that adding the logger class to plugins was relatively recent, but I don't recall exactly when. I have only tested the plugin on Indigo 7. Which indigo are you running?


You have the ServerApiVersion key specified incorrectly in your plugin. If you depend on any 7.0 features (like using the logger) then you have to specify 2.0 as the required api version (you have it set to 1.9). This will keep it from installing (and probably loading) on anything older than 7.0.

Re: Online Sensor plugin

PostPosted: Sat Mar 25, 2017 12:04 pm
by kmarkley
Well, fudge. Pretty sure that's wrong on all my plugins. I'll update them this evening.

Thanks for the pointer.

Re: Online Sensor plugin

PostPosted: Sat Mar 25, 2017 1:53 pm
by ckeyes888
Doh...so no go til I upgrade to 7 correct?

7 has me giving up much more than I gain at this point.

Carl

Re: Online Sensor plugin

PostPosted: Sun Mar 26, 2017 6:47 pm
by jay (support)
ckeyes888 wrote:
7 has me giving up much more than I gain at this point.


Care to elaborate?