Online Sensor plugin

User avatar
whmoorejr
Posts: 767
Joined: Tue Jan 15, 2013 11:23 am
Location: Houston, TX

Re: Online Sensor plugin

Post by whmoorejr »

Running the latest version... 0.1.0....

Skipped the instructions, I installed the plugin first, then added

Code: Select all

pip3 install speedtest-cli
Had errors (speedtest.py not installed) or something like that.
Reloaded plugin and every Online Sensor plugin device is functioning flawlessly.

Thank's for updating this!
Bill
My Plugin: My People
mintzps
Posts: 29
Joined: Tue Apr 13, 2010 6:58 pm

Re: Online Sensor plugin

Post by mintzps »

Hi,

I am trying to obtain my IPV4 wan address.
Using ipecho I am am getting my IPV6 address: 2601:985:4680:4880:61bf:36a5:462e:a9d5
This doesn't write correctly into a variable in Indigo.

Can you provide a different web address ton get the IPV4 address?
User avatar
whmoorejr
Posts: 767
Joined: Tue Jan 15, 2013 11:23 am
Location: Houston, TX

Re: Online Sensor plugin

Post by whmoorejr »

My online sensor points to

Code: Select all

https://api.ipify.org
it retuns an IPV4 address in the custom state ipAddress on my setup.

I created a new device with ipecho and it also returned an IPV4 address. So I don't know if changing the URL for the IP Echo Service is the solution.... but maybe?
Bill
My Plugin: My People
mintzps
Posts: 29
Joined: Tue Apr 13, 2010 6:58 pm

Re: Online Sensor plugin

Post by mintzps »

I eventually found the same one
https://api.ipify.org?format=json
User avatar
whmoorejr
Posts: 767
Joined: Tue Jan 15, 2013 11:23 am
Location: Houston, TX

Re: Online Sensor plugin

Post by whmoorejr »

I'd like to know if my home internet is down, even when Indigo is still online (via separate connection)

Can this plugin (I'm thinking not) determine which network indigo is on?
Main home internet is on the Indigo MacMini LAN. There is a dedicated cellular connection via wifi. The mac (I think) only uses the wifi if it can't get traffic through LAN. I was getting notifications (triggers made possible by your plugin) to let me know that the network is back online with data (time/date stamp, duration, network speed).

I previously had a network down notification which was pointless, because obviously I wouldn't get the notification until the network was back up.

Since I have redundancy on that computer now, I think your plugin will always say that it is online?

I thought about a LAN Ping to another always-on device (Like a POE Camera), but that won't work because they don't need internet to see each other.

Any thoughts / pointers?
Bill
My Plugin: My People
ryanbuckner
Posts: 1108
Joined: Sat Oct 08, 2011 12:33 pm
Location: Northern Virginia
Contact:

Re: Online Sensor plugin

Post by ryanbuckner »

Can you try specifying the gateway on your ping call? https://www.cyberciti.biz/faq/ping-usin ... p-address/
User avatar
whmoorejr
Posts: 767
Joined: Tue Jan 15, 2013 11:23 am
Location: Houston, TX

Re: Online Sensor plugin

Post by whmoorejr »

ryanbuckner wrote:Can you try specifying the gateway on your ping call? https://www.cyberciti.biz/faq/ping-usin ... p-address/
I don't think so? Both the house router and the cellular hotspot have the same IP address. They are both connected to the indigo machine, so I'm not sure which one is replying. My indigo machine had different addresses depending on which one it's using. 192.168.1.10 on the home network. 192.168.1.2 on wifi(cellular).

I'm currently trying to figure out if I can Ping via MAC address since the router and hotspot have different mac addresses (but same LAN address).

From terminal, when I "arp -a" I see both 192.168.1.1 entries. I see the MAC address for the hotspot, the MAC address for the Router is (Incomplete).

In my head, this may not be doable. If home internet is down, the router is still up, so I should still be able to successfully ping everything on my home network.

Edit: I'm trying to see If I can change the LAN settings of the hotspot to 192.168.2.1 to better differentiate the networks. However, online or offline, I think I'll still have the same issue, both devices will still be connected to the Indigo machine regardless of their connection to the rest of the world.

I'm still tinkering as I'm typing this. Hopefully it won't do anything horrible. (I'm always nervous when I start entering random stuff from google searches in terminal) So if there is a global internet blackout.... sorry about that.

Edit2: Tried a different approach, instead of a hotspot device, I tried an extra cell phone connected via USB, It connected with the IP address 172.20.10.4. This gives me an option over the wifi route.... "Disable unless needed" So maybe use a successful ping to the 172.20.10.4 address = ethernet down.

Another alternative is to maybe use network speed as an online sensor to determine where my internet is coming from. Both the hotspot device and the cell phone are 4G LTE with a weak signal running about 2-10 Mbps download versus home network average at 180-200 Mbps.
Bill
My Plugin: My People
User avatar
whmoorejr
Posts: 767
Joined: Tue Jan 15, 2013 11:23 am
Location: Houston, TX

Re: Online Sensor plugin

Post by whmoorejr »

Sorry, I think the speed test part of the plugin may have died with the latest version of Indigo (2023.2).

I'm getting the error "Speedtest library not installed". Not sure if it's better to add this to my machine from terminal or does the library need to be included with the plugin now.
Bill
My Plugin: My People
User avatar
jay (support)
Site Admin
Posts: 18411
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Online Sensor plugin

Post by jay (support) »

No, you just need to rerun the install:

Code: Select all

pip3.11 install speedtest-cli
The plugin developer could add this to a requirements.txt file and it would get installed automatically.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
Post Reply

Return to “kmarkley's plugins”