[RELEASE] OwnTracks for Hubitat Presence Detection

Woohoo! I was the 1000th post!

2 Likes

But we talk about you all the time... :wink:

1 Like

Jealous!! Small congratulations to you.

Huge congratulations to @lpakula!!

2 Likes

All good things, I am sure.

1 Like

Worked like a charm - quick and easy.

1 Like

Is this the Advanced Settings in the Synology Frontend, trying to remember where that is located.

Looks like there might be another free option via Geoapify also. Never used it though so not sure how well it works.

EDIT: Interesting. Looks like we would get 3,000 free api calls per day with geoapify vs 1,300 with google. So could update every 30 seconds for free. Looks easy to setup and use too. And don’t have to enter in any payment info to get a free api key. Think it has my vote over Google.

1 Like

ok so if play store version is uninstalled and unofficial apk installed, then just add needed settings and use exact same name as before and everything should be ok on Hubitat side?

1 Like

Worked for me. :slightly_smiling_face:

I did have to restart the mobile app to get the regions to update on the phone.

Noted! Just working through the HTML tile, and that's next on the list.

1 Like

Yes. Just go to the HE app, in Maintenance, and select that phone to get the settings & regions. Then it will mirror back up once you send a location from the phone.

As far as implementation goes, if you wanted to stay consistent with Life360, you would pull in just the “address_line1” field from Geoapify into the OwnTracks “location” attribute. That has just the street address, not the city and state/province. I think Life360 shoved “ address_line2” into an “address2” variable. But I wonder if it would make more sense to do this:
(1) just take “address_line1” for the location attribute
(2) add a new “address” attribute that always has the fully resolved address of the current lat/lon, populated with the “formatted” field from Geoapify to show the full address (line1+line2).

Just food for thought. Feel free to implement however you see best of course. Thanks for your great work on this integration!!

The city and state option would be great too, always wanted that in Life360.

Noticed same kind of behavior with owntracks as with life360. This is basically the thing that I have been trying to fix with every possible option..but mostly with using webcore rules.

Reason is bad gps reception I assume. Sometimes client thinks it is completely somewhere else where it really is.
At night 01.11 "left home"
Log says:
0.233 km from Home, Battery: 100%, Velocity: 121.0 kph, accuracy: 5 m

After one minute back to home and in that one minute client gained speed: 121.0kph.
I have tried to build piston with "when location changes away from home" AND "speed is something between X and Y" then do nothing.. because client did not really leave. But everything I have tested do not work completely.
I just tested rule where location changes away from home AND SSID is not HOMESSID. That basically works but SSID seems to update occationally. So when I leave home and my connection to home wifi cuts off.. it doesn't mean that owntracks gets that information right away and it could be then used in hubitat automation rules.

If only..someone would figure out how to prevent these false location changes.

The reverse geocode returns the full address which is currently in the "address" field". I'm adding a "street address" to the next version which will just have that as well (win-win!)

2 Likes

It seems that the phone grabs a nearby wifi access point and "claims" you moved to that spot, and the very quickly snaps back to your home location. In the HE app, the field to enter your home wifi SSID addresses this. The HE app will reject the bad location transition if the phone is still connected to the home SSID.

Yeah but it did not report any SSID changes in log. It just jumped. What I saw from Unifi log was that client was stable and connected whole night to the right access point. I will test that home ssid setting though. Let's see if that helps, thanks!!

Been hours since any update...@lpakula may have been kidnapped. :scream: Please fan out in your respective towns and help find him before it's too late!!

Note: It's also possible he might just be taking a well deserved break. If you see him in a cafe w/an espresso in his hand then just walk away quietly. :wink:

7 Likes

@lpakula
I have tonnes of these messages (both Warn and Error) and I thought I could get rid of them by creating a home region for each of our phones; X and Y.
I have one in my phone and one in my wifes.
This didn't stop the messages and I'm wondering if OT actually requires a region called "Home"?

Oddly presence detection shows she is away on the map at the correct address but presence attribute says "present" and 0 km from home.
Also says she left * transition : left RozHome at Thu 10:08 AM 2024-01-25 correctly.

app:16332024-01-25 10:22:15.041warnOwnTracks: No 'Home' location has been defined. Create a 'Home' region to enable presence detection.

That should fix your issue. For me, looked like my ISP would report my house at the street junction box (even though I'm connected to my SSID) which messed up automations.