Use Locative for Presence

@gavincampbell how are you running network presence?

Unfortunately its not a simple answer but there are a number of threads around with a lot of discussion touching on this point.

Some are using the AsusWRT wifi or TP-Link Deco wifi presence solution, others are using IFTTT (if you have an android device) to trigger a sensor when you connect/disconnect from a network. I've also seen some setup homebridge (which has a virtual lan presence plugin) and connect that to a virtual device to handle the lan presence. That plugin worked well back in the day when I used homekit.

The more complicated method is setting up a node server to run a ping command and having a driver/app communicate with it to manage virtual devices. This is what I do but its all custom written code. There are examples of this out there somewhere on the smartthings and hubitat forums but will require some work to get working. If you want to go this route I may be able to help you find the necessary info to get it up and running. Let me know.

I wish this was something that was baked into Hubitat or even if they opened up the ping methods so we could create an app to monitor a device but I doubt this will happen.

Here are some threads that may have more info.

Gavin,

I completely agree with you. The only thing I would potentially do different would not be through network Ping commands as this can cause latency issues even in a home network, specially if you have plenty of traffic intensive devices like Google Cast devices.

Even though not a Coder, I'm somehow a little familiar with a few techologies due to my line of work in the past.
I believe one option that could potentially be explored is 6LoWPAn/Thread as they are network protocols that can be used through over IPV6.

However does not solve the draining issue of WIFI or GPS constantly go on and off.

So my Theoretical and an optional solution for this would be an APP that:

  • Uses cellular location services ( you can use OpenCellID). The App would check every time you connect to a specific, determined by user, cell tower.
    - Most towers In EU have a 1km range within cities for UMTS/LTE. In rural areas cell towers range can vary from 5km to 50km. What in this case can work better in rural areas :wink:

  • Whenever you connect to that cell tower/towers (for triangulation/redundancy) it would activate 6LowPan/thread at for example 1 second intervals until it receives a hub response. On response activates presence @ home.

Now this is all conceptual! Lol.

Just putting it here as an idea in case anyone never thought of it and want to consider it.

Ya its not pretty. I only have two devices so network usage is very low for pinging. I also added variable pinging to my code, so if the device is online I don't have to ping it as often, and once its offline I ping it more frequently. I also have a very solid network so I'm pretty sure it could handle this. My WEMO switches probably use up more traffic than my ping script.

I've looked into other ways of doing this with what I have. I've looked into ios apps that could do it (none), using arp instead of ping (same diff) and I have two others I want to look into. Modifying the node server to look at dhcp tables or to work with pfsense to pull data. As far as I know pfsense won't have an API until the next major release. I don't really want to figure out how to create a plugin.

Took at look at this but its beyond my level. Probably much more complicated to implement as well.

But using a similar concept, if wifi connects then try to contact the local maker api and flick on the @home switch. If Wifi disconnects then contact the cloud maker api and turn off the @home.

All of this is so that we could use our phone as a presence device.

This is the biggest hurdle, most of times wifi will only wakeup and connect long after you already arrived and additional when the device goes to sleep as it's disconnects from the network will assume you left.

Hence I believe you need a toggle solution that do bypass this. One solution is forcing the Wifi to wakeup and report a checkpoint to the Hub, hence using cellid as triggers to the hub toggle.

A potential alternative to cellid but that only works in Android is ELS. Is the system used by Android to communicate with Emergency services, is more reliable than cell id but not sure at what extend it can be used...

Keep in mind the LAN presence will work in tangent with the geolocation. Its not an independent solution. Geolocation apps have the problem of not always updating or updating too late. Wifi has the same issue of not connecting right away or even dropping off for up to 15 minutes when its in sleep mode (can be turned off on android). However put these two together and your reliability goes up. Add in a 3rd solution such as disarming the alarm when the code is put in on the door keypad and I never have accidental tripping.

For some reason I think I saw this used a while back (before I got into this stuff) for something else. Sounds like a good way of doing it. Not sure why it hasn't been looked at. I'm not sure if GPS utilizes cellid already to compliment its accuracy. However I just looked at my System Services in iOS and saw this option ...

Wi-Fi Networking: This particular setting is interesting, and requires some explanation. As you move around a city, your iPhone is constantly picking up WiFi signals. It geotags that data (ā€œXYZ WiFi is at this GPS locationā€), encrypts it so that it is anonymous and unique (otherwise the data would look like all hotspots are named ā€œlinksysā€), and stores it as what Apple calls ā€œcrowdsourced Wi-Fi Hotspot locationsā€. Next time someone walks by that exact hotspot, their iPhone will know where they are without using GPS ā€“ because you basically already ā€œmarkedā€ the area. Shutting this setting off will stop that info from being sent to Apple. It will not affect your phoneā€™s performance.

Interesting.

For the first is called Assisted GPS or A-GPS.

The latter was an improvement to the first using Wifi Hotspots instead of GPS ( wifi hotspots normally transmit GPS coordinates using the GPS signals connect to it. I believe. I think is the method use by Google home to know where he is.

A-GPS was not used by many MFT as it was battery intensive.

Good to know. I learn something new ever day. :slight_smile:

We all do.

I started having an issue a few days ago where my phone freaked out and flipped the presence switch in my rule on and off several times. No idea what caused it. Only my phone did this. My wife and daughter's phones were fine and none have done this before. Mine is still doing it, so obviously something wrong with my phone I need to figure out.

However, the Geolocation signal was also lost and regained in this time period and that caused my rule to become true so the front door unlocked at 2am. So to prevent that from happening in a hardware failure like this, I'm adding a Wyze cam at the front door as a third trigger. Not sure it will work well enough, but hoping I can narrow the detection tight enough that I can at least lessen the possibility of all three triggers aligning just right when it's not expected.

To avoid this i use a outdoor PIR sensor....

A Xiaomi one in a glass case :slight_smile:

1 Like

Sure. Any third factor should help. I donā€™t have a Ring Doorbell and thought this might be a nice way to solve that problem and also be able to monitor my front door and talk to people (AKA an excuse to buy another smart device I can integrate) :grimacing:

Iā€™m quite impressed by the Wyze Cam app, IFTTT integration, and responsiveness. I also bought a YI 1080p Home to try. While the camera itself is actually quite good and has really nice night vision, the app is very poor in comparison and the video quite laggy. That one is on its way back to Amazon.

I have ezvizz camaras that are quite good as well and the actual app as nice features. Trying to integrate them with HE as i have found the sdk but nobody else seems willing to pick it up/interested (at least nobodg replied to the thread) and I do not know how to code so I might need to buy new cameras...

I'll let you know how it works out with IFTTT and the Wyze. I had bought a warehouse deal, and because I already have an iSmart Alarm Spot (basically the same Xiaomi camera as the original Wayze), I had familiarity with it and most importantly, I had the micro USB cable that was the right size and shape to fit into the back of the camera, because the "Inspected" Amazon Warehouse Deal camera did not have one. But right now new Wyze cameras are selling for the same price as the warehouse deal was, so I'm waiting for the new one to arrive tomorrow.

i like HEGPS

on a side note you doing this for both IOS and android?

i just setup locative. anyone know how to get a bigger geofence? i want a mile or two

Sorry just Android.... I don't have money to throw away and buy a $1000 cell phone that will be no good in a year cause Apple will do something to brick it.

2 Likes

How about a HEhubGPS --- a spin off the HEEHAW TV show

There's a firmware Github here, for Wyze cameras if you're interested.

1 Like

Nice. Didn't know about that one. Was looking at OpenIP Cam yesterday. The YI cameras are actually very nice quality hardware. Would like finding an alternative to their relatively poor app and Chinese based servers that takes advantage of the good engineering that went into their cameras.

No idea what youā€™re referring to. Iā€™m using the same iPhone 6 I bought for $900 four years ago. Had a new battery put in by Apple for $35 CAD and it runs great. Has more capability than when I bought it. Canā€™t ask for much more.