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

This is no longer relevant to current SmartThings technology

13 Likes

Do you mind if I look into jacking your device code into my universal device dth?

Update:
Well that’s not going to work, your sa is creating a standard virtual switch child device. If you allowed the user to select a switch in addition or in lieu of creating one, they could use any switch, including my uDTH…

My specific use case being to ping a static dhcp lease for all our mobile devices, then map each of these via uDTH as adjunct presence sensors…

5 Likes

Now THAT is an awesome idea. Been trying to get it done for a year now…

1 Like

Yes please.

Not clean but you can do this with core still, connecting ops switch to a udth…?

Yea, amongst other apps as well… interested in the clean route here since I have enough issues as it is with all my virtual zone apps and devices…
Who knows, maybe we’ll have a good weekend with the db tweeks they rolled out…

3 Likes

Agreed! I would finally be able to stop replying on the ST presence sensor in my wife’s car.

1 Like

Easy enough to do… I was purposefully trying to avoid it so that you didn’t manually have to create a virtual switch then add in to the smart app, then you could report presence based on the switch state, but I’ll add presence to my DT as that’s a good idea.

But I’ll create a child app so you can assign to a switch also… in terms of anyone wanting to jack code, then help yourself!

Edit: will your mobile devices sustain wifi though and you may need to consider that pings may increase power consumption, I’ll give it a go with my phone later… see how reliable ping is for mobile

1 Like

Awesome! Let us know when the updated code is there and I will be happy to test! Also, it would be cool if you can program in some time out to avoid false positives. For example, if someone’s phone is either rebooted or out of range with a dead Wifi spot, you don’t want ST to think it left the area.

Finally, you might want to consider setting up your Repo to allow others to sync to it for updates. It’s the best way to get everyone on the latest code:

http://docs.smartthings.com/en/latest/tools-and-ide/github-integration.html

@Mike_Maxwell and everyone else - Code updated with changes :slight_smile:

1.1 Added child app and triggering of external switches & added presence to the Device Type

@Mbhforum - Yes can add a configurable value to ignore any offline for X seconds…

I’ll take a look at GitHub integration, but as I’m based in the EU the EU IDE doesn’t have this option, so (assuming I can integrate?!)

Edit: not sure I can implement the delay where using the device type though as would need to use a runIn on the parent that could be over written by another event… will need to have a think… alternatively rulemachine / core could handle this easily…

Ahh I just read the installation notes and didn’t realize you need a Windows host up and running this .exe at all times. I have a Windows machine, but it it’s a laptop that is usually powered down. I only have a Mac that is up at all times. Is there any solution for Mac or better yet, I am running a router with DD-WRT? (so I can have a script just ping constantly).

I had something like this running on my tablet using Tasker as the pinging device. It worked fairly reliably. The phones would show as connected several minutes after the presence sensors arrival. (On average) The main issues was the I phones would drop off the network when they went to sleep / idle and sometimes the pings would not get responded to by any phone. So you had to account for that. Possibly just my setup / configuration. I am very interested in this and hopefully getting @bridaus “reliable presence” to work with more than 2 inputs and leverage them all together. Could possibly be a actual reliable presence by leveraging a 2 of three or four inputs as the trigger.

I’m out for the rest of the day, but if memory serves me right there is already something that can do this via DD-WRT.

I don’t own a Mac, but my brother does and actually programs in C#, he said he will see if he can recompile later :wink:

Awesome :slight_smile: There is currently a script for WW-DRT, but the problem is it examines MAC address by doing an ARP lookup. When you have multiple access points in the house that are non-WW-DRT, then the problem becomes as you roam around in the house, you will disconnect from your WW-DRT router. Ping solves this as you never leave the network :slight_smile: I tried it and it ended up being unreliable for me.

1 Like

So as a Mac user you can just install Mono apparently, he’s checked and it launches fine:

http://www.mono-project.com/

Once installed at the console you can just navigate to the folder and type “mono STHostPinger.exe”.

If mono is is not recognised as a command then the below link will help:

If you could give it a go, and let me know how you get it on, if you have any additional instructions let me know and i’ll add to the original post!

It’s working perfect on my Mac! nice job!!!

2 Likes

I just realized you cannot use this as a reliable method for iPhone presence detection b/c iOS puts it’s wifi to sleep when the phone is not in use :frowning: I realized this as my iPhone kept bouncing online and offline. Amazing how many work arounds I have tried from Life360, WW-DRT, ST presence fobs, native ST mobile presence, and nothing has been rock solid.

Same thing I saw. Was hoping it was just my setup. Guess not. My android would stay connected but probably because I have the toggle to NOT turn off WiFi when asleep enabled.

I missed that. iOS most likely does this to conserve battery life.

IBeacons are pretty solid, maybe because they’re so simple, it’s just that the range is limited. You can set up a region with multiple Ibeacons, but then you significantly increase the device cost.

I’m happy with mine, but I was looking for a small detection area. They wouldn’t work if you wanted the garage door to start opening while you were half a block away. :sunglasses: