Online Sensor plugin

Posted on
Tue Aug 01, 2023 8:03 pm
whmoorejr offline
User avatar
Posts: 763
Joined: Jan 15, 2013
Location: Houston, TX

Re: Online Sensor plugin

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

Posted on
Fri Dec 22, 2023 12:05 pm
mintzps offline
Posts: 26
Joined: Apr 13, 2010

Re: Online Sensor plugin

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?

Posted on
Fri Dec 22, 2023 12:18 pm
whmoorejr offline
User avatar
Posts: 763
Joined: Jan 15, 2013
Location: Houston, TX

Re: Online Sensor plugin

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

Posted on
Fri Dec 22, 2023 1:31 pm
mintzps offline
Posts: 26
Joined: Apr 13, 2010

Re: Online Sensor plugin

I eventually found the same one
https://api.ipify.org?format=json

Posted on
Sun Jan 21, 2024 3:27 pm
whmoorejr offline
User avatar
Posts: 763
Joined: Jan 15, 2013
Location: Houston, TX

Re: Online Sensor plugin

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

Posted on
Mon Jan 22, 2024 6:36 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Online Sensor plugin

Can you try specifying the gateway on your ping call? https://www.cyberciti.biz/faq/ping-usin ... p-address/

Posted on
Mon Jan 22, 2024 11:59 am
whmoorejr offline
User avatar
Posts: 763
Joined: Jan 15, 2013
Location: Houston, TX

Re: Online Sensor plugin

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

Posted on
Fri Feb 02, 2024 12:01 pm
whmoorejr offline
User avatar
Posts: 763
Joined: Jan 15, 2013
Location: Houston, TX

Re: Online Sensor plugin

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

Posted on
Fri Feb 02, 2024 1:24 pm
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Online Sensor plugin

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

Who is online

Users browsing this forum: No registered users and 13 guests