[OBSOLETE] Host Pinger (IP based Online State / Presence)

So to clarify you either use the device type OR use the trigger, you shouldn’t use both… however I will change that in the next version… otherwise the same event will be sent twice, which won’t cause any harm just redundant!

I found the iPhone will bounce in and out but only tested it for 20 minutes or so, but will do some testing then see if I can program something in to handle it… detecting arrival may be best then use geolocation for leaving perhaps…

By the way my initial use case is to see if the TV is on, and if it’s on then it stops any movement sense lighting, as I could be watching TV and not move enough for it to know I moved… and it’s cheaper than monitoring power output…

2 Likes

I use garage door logic for myself, but my mobile presence works great, My wife’s doesn’t use garage doors, so I resort to a ST presence tag which is mostly reliable but depending on battery and wind can give false positives. Another challenge is, my mother in law lives 2 blocks away and sometimes the geofence catches us there. Wifi is desirable because it has decent range and very reliable.

# RELEASE

New version now up on GitHub:

Version 1.2 - moved direct triggering of child devices, Child app now includes delay on ‘Offline’

Update On Presence Sense - Practical Application:

So testing over an hour or so reporting the state of an iPhone, one with 15 second polling and one with 5 minute polling, both with a 2000ms timeout.

Good: It appears that the pinging in both cases was keeping the wifi connected, with the 15 second polling being the only one to detect a couple of “Offline” instances restored 15 seconds later (may disconnect over a longer window however)

Bad: This as expected ruins your battery life, making this not really an option unless the device you are pinging is has either a really good battery or is mains powered.

In summary not great for presence, still best suited to knowing if other mains powered devices are online or offline.

1 Like

Thanks for trying and testing this out. I had a feeling Apple puts the Wifi to sleep to conserve battery. I agree, it’s not worth it to sacrifice battery life for reliable mobile presence.

Hi All,

I have updated the EXE to V2 this will allow you to run the exe as a background process on Linux (And I assume OSX) using:

“mono STHostPinger.exe &”

Hi this should now be on GitHub as they have just opened this up to the EU SmartThings users… I assume the repository is the same, but can’t find much on there?!

SmartThingsPublic/smartapps/jebbett/host-pinger.src/

@Entityxenon

This is exactly what I’ve been looking for but I get the following error.

3b126cc2-dcdf-44e1-b258-c2b42da674ed 8:59:41 PM: error groovy.lang.MissingMethodException: No signature of method: script1480548557634188206478.updateLog() is applicable for argument types: (java.lang.String, java.lang.String, null, org.codehaus.groovy.runtime.GStringImpl) values: [set, Status, null, 192.168.1.181 [offline]]
Possible solutions: updated(), updateLog(java.lang.Object, java.lang.Object, int, java.lang.Object), getLog() @ line 311

On the EXE screen I get
Failed to SendGetRequest: The remote server returned an error: (500) Internal Server Error.

Hi Ron, section 5 of my first post covers the issue with your exe, the config.config file is likely to contain the incorrect IDE URL, from memory this defaults to the EU URL, judging by the time you posted you need to update to one of the two US servers…

The error you are seeing in IDE is unrelated as the message isn’t making it to SmartThings yet, but I’ll fix that issue later today, all though that should disappear once you fix the exe…

Let me know if you are still getting problems or if you get it working. If you still have problems PM me your config file. Glad someone else has found a use for it!

I’ve updated the code to 1.3 to fix the error on a null value, I haven’t tested it however with actual events, but I have tested on another app I use the same code and seems to work…

Thanks for getting back with me. Your app needs to be part of the ST platform!

My IDE is on this server:
https://graph-na02-useast1.api.smartthings.com

To be clear, in your config file, you need to put the token, appid and ide in the:

Does the config take this and put it in the needed areas in the:


Then just populate my PC IP addresses here:

I so want this to work!

@Entityxenon

Working!!

Updated to latest version.
Still the Triggers were reading unknown.
I had to go into the Location in IDE, Uninstall the Child Apps i.e. 192.168.1.1xx.
Re-installed the triggers (Child Apps) then BAM!
I changed nothing in the config file.

Awesome Awesome Awesome App!!! This should really be apart of ST natively!

Full PC Control by following these steps:

  1. Turn Off PC or other commands with Virtual Switch & Send Events to EventGhost - SmartApps
    Send Events to EventGhost

  2. Turn On PC with WOL via CoRE & Virtual Switch
    Newly documented Wake on Lan (WOL) functionality (2016)

  3. Keep the Virtual Switches in Sync with the actual Machine using Host Pinger (Switch Control)
    [Release] Host Pinger (IP based Online State / Presence)

I’m in Heaven! Thanks again for your hard work!!! Now I can go reclaim my Iris Plugs and have way better control over my house!

ToDo-Get this to run on my Pi3

1 Like

No worries, should run fine on the Pi from what I have read, but haven’t had a chance to try it yet… just need to install mono and execute on startup…

Interesting to see how people are using it though! I only wanted to know if my TV was on so I could remove the power meter socket (I stop automatic lighting when the TV is on)

Friendly Bump for those who might have missed this awesome App!

1 Like

Update on the Mono install.

  1. This is my first experience with Linux and therefor I was/am clueless when it comes to installing, updating, navigating, etc… my way through the Linux OS, specifically Raspbian on Pi3.

  2. I did my best to find Mono and install it but I kept getting errors as to certificate issues or HTTPS request…

  3. The regular “sudo apt-get install mono-complete” will not work with Host Pinger.

  4. After following the instructions here:
    Install Mono on Linux | Mono

Updated Link:
http://www.mono-project.com/download/stable/#download-lin-raspbian

I was able to finally get Mono to work with Host Pinger!

Thanks again for your help with this awesome App!

1 Like

Thanks for reporting back and sharing!

Everyone helping each other out it what makes SmartThings work!

Just to add I followed the below for Ubuntu:

1) sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

2) echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

3) sudo apt-get update

4) sudo apt-get install mono-complete

Taken from and credit to here:

Yep. Pretty much. As simple as that was, for someone who doesn’t know, it is hard to find that information.

Maybe, put it in your install instructions?

1 Like

Have updated the first post with the link you provided :slight_smile:

1 Like

Hello! I’m new to Smart Things and trying to configure Host Pinger. I’ve got everything set up in ST and on my computer. I can see “online events” being sent to ST Live Logging, and in the Smart App, but no changes are happening on my virtual switch. I’ve made sure to name the switch the same name as the host I’m pinging.

Not sure what I’m doing wrong. Can someone please help?

=)

You don’t need to name the switch the same, you just need to add the switch in to it in to hosts and triggers section and make sure the host name matches… hope that helps!

Could also have Host Pinger to create the virtual switch. That way, you know its correct then use that virtual switch for your other purposes.

I did it both ways and they both work perfectly. Honestly, this app does not get enough attention. It is one of the best apps I have installed for “thinking outside the box” automation.

I use for my TVs, PCs, Tablets and AVR.

Example, Tablet disconnects from Wifi when not in use, so if Host Pinger see that the tablet is online after a long sleep period, that means that the owner is awake! From the owner being awake, triggers another piston that helps owner of tablet about its day!

1 Like