[RELEASE] OwnTracks for Hubitat Presence Detection

It's very straightforward w/the directions that @lpakula has put together. The only "hard" part is maybe creating the conf file using nano? And if that's the hardest part, you know it's simple. :wink:

2 Likes

Just pushed a version with some minor changes.

  • @jshimota Can you confirm OT devices now show in the battery monitor?
  • @neerav.modi This version adds in the ability change the push notifications that the app sends. In the notification section, select the slider to choose a different push notification. It uses the follow uppercase variables:
    • NAME: member name
    • EVENT: enter or leave
    • REGION: place member name entered or left
    • TIME: time that member name entered or left region

You can craft your push notification to say whatever you would like, with the above 4-uppercase variables being replaced with the actual information from the transition event.

If the slider is off, it uses the default 'NAME EVENT REGION at TIME' which was in the previous versions.

1 Like

It's interesting... the app doesn't seem to register that I've left and retuned home as quickly as it did several weeks ago. I know there have been many many updates/changes over the past few weeks, so it's hard to pinpoint. I do recall mentioning this before in this thread sometime last week.

Just curious about this: My understanding is that the app monitors the SSID(s) that have been entered in the Configure Hubitat App section. If it senses there's a change in that SSID status (connected or disconnected), does the app make a special call out (at that time) to check the current location of the device (to see if it's moving)?

The SSID is only used to keep the phone "at home" while it's connected to wifi + that SSID. Its meant to deal with the issue @jani had where a phone randomly reports it's away from home one second and then snaps back.

Are you seeing that you are are closer to home before it triggers (or farther when leaving?)

Yes- exactly; so it seems like I need to almost be inside the house before it senses that I'm present (even after the SSID is connected), and I need to be almost 1/3 of a mile away until it senses that I'm no longer present. In the past, I've noticed that by the time I reach the end of my driveway, it triggers -- that's no longer happening.

1 Like

Mine is behaving similar...went to the gym tonight and when I left it didn't register I was gone until I was > 1/2 mile away. When I got home it didn't register until I was in the driveway for about a minute.

2 Likes

I'm seeing the same behavior. HE said I wasn't home but when I opened the OT app my blue dot was on the house. I've noticed that it will occasionally take up to 30 minutes to register I'm in the region. It's just generally slower now though. Been that way during last week the few days I went out

1 Like

@lpakula - so first off - thanks! Wow. This thread I've tried to keep up with but it was moving amazingly fast - my first effort to implement and relplace the older OT tool I was using - some excellent features - a really impressive app and thank you for that!

I'm glad you peeked - in case you still want to know, regardless of having already Identified the feature request component - I've got 'BatteryMonitor' installed I believed without looking I sourced from HPM.
image

I always found it nice to get low battery notices on my 'puter window so as I was replacing the older OT tool, I was 'swapping' devices and made my discovery. thanks and keep up the awesome work - I'm grateful.

1 Like

Hi @lpakula .
I've put in a couple of regions and did a bit of testing.
When I move into one of my defined regions I can see in the events for my OT presence device a log of when I enter that region.
image

When I leave that particular region I can see an entry in the logs for transitionDirection.
This log entry is the same for any region that has been left.
image
It doesn't actually tell me which region I have actually left.
Is there any way this could be logged.
i.e. when I leave a region it shows either "location - leave Driving Range" or "transitionDirection - leave Driving Range".
The reason I'm asking is I would like to use both events to send/announce a message.
If you can, great. If it's not possible then no big deal.
Thanks again.

Let me check. This is super easy to address for sure.

1 Like

@danabw @oldcomputerwiz In the next version I'll put a debug slider to enable just the incoming messages into the HE app. That way you can check if it's the phone not reporting or something internal. IE: If you are home, app says you are away, but the debug clearly shows that the phone reported a location, then something is broken!

2 Likes

I'll tweak that debug as well. @danabw sent me a log snapshot, and his looks like it's not switching to the faster reporting in that bubble away from. I'll capture that in the logging to confirm.

Otherwise it defaults to updates on 60-second boundaries, so depending on how the stars align, how fast you are driving, etc, that would explain the late/lethargic responses.

1 Like

I'm still looking into this. For "free" you can use google maps, and use their directions without routes, but it just leaves "unlabeled" (IE you cannot put a name other than what Google finds in the map) waypoints:

I'll play with using the Google Maps API. That you can images, names, etc, but you need a key for (which is fine), just not "as easy". :slight_smile:

1 Like

@jonathan.lorber @danabw
Im in the same in regards to present status at the driveway or away status at a greater distance

@lpakula
That's what ive been talking about present status triggering. They've just explained it better lol

I was only interested in the triggering distance to be present. Not as much concerned with the Away status....

2 Likes

Ok, just checking into what you are looking for. Currently this gets logged as events for each device:
image

And gets updated when a device enter/leaves a region. Does this work as is, or you looking for something extra?

When I left the 'Driving Range' today I received this series of messages in the device logs.

Summary

As you can see I get a transitionDirection of 'leave' as I exit that region.
This message is the same for whatever region you happen to leave.
What I was wondering was could there be a message that indicates the particular region that has been left.
I suppose I could get round it by defining in my piston

IF
transitionDirection changes to leave
AND
distanceFromHome is between 1 and 2 miles
THEN

This would work but was looking to see if we could use the actual name of the region being left.

I hope this makes sense. :wink:

And what many has already said.. owntracks seems to act really slow for some reason. Now it's been 20min since last connection from phone to owntracks side. Two phones of four are home and two still few kilometres from home.
I'm in the home according owntracks map and hubitat owntracks app needs me to manually send location by pressing the arrow key. So somethings up at the moment.

Owntracks app log, there is no errors but between 17.24 and 17.48 there is nothing. When I opened owntracks app and hit arrow key log says: "Starting service". Do not know if that is normal message while app should be running background. Phone has not been restarted or any other things..

Other problematic phone says in the log:
"no location available" as soon as I open owntracks app and check the log. Here was the exact same thing..it needed manual arrow key press and after that it was able to send location.
Is this because of shitty owntrack play store app version or is this same thing happening with the tweaked version too?

EDIT: just to make sure the logic behind these menus and settings.
If I have this already enabled

If I manually add members to this menu and hit "done"..does it swipe off the upper setting? Most likely you have thought this through but that is the only thing I have been manually hitting lately and started to wonder if that disables higher accuracy always on setting.

Sounds good. Usually when I see this happen my last location on the Google map in the HTML tile is just outside the region radius. It doesn't happen everytime but enough to be noticable.

1 Like

If the phone isn't moving, that would be normal. The "ping" message is on ~30 minute interval which would explain the 17.48 message.

It seems to report that when you open the app. Seems the service restarts, which is normal.

When the the service restarts, it has no location, so it posts that log entry (fully normal). It's only an issue if it every location out (IE on those 30 minute ping intervals, or when moving) report this. The HE app requests a higher accuracy update on those 30 minute intervals which has been preventing this issue from occuring.

No it does not. I could hide that box if the slider is set. The box becomes redundant.

1 Like

I pushed a version which will enabled some better logging for the devices. It also removes that "Select Family member(s) to receive high accuracy GPS...." box since it's been replaced behind the scenes with automatic maintenance, and was redundant.

For the logging, turn on debug logging in the device that you'd like to monitor. I've added an additional slider to add/remove the addresses from the debug logging so they don't get so cluttered to view.

Noted additions is it will tell you if the the phone is connected to home wifi, if it's using a high accuracy GPS fix (this should happen automatically in the region bubble outside your home region) and if you use the forked APK from post #2, you may see a "Ignoring Bad Location" at the end of each log entry if the location was outside the acceptable accuracy (those don't get used for presence, just as a keep alive).

If you are not using the "Use GPS for higher accuracy.." you should see:

  • The High Accuracy be false at home
  • Once you leave the home radius, High Accuracy be true. Locations should come more frequently when moving.
  • Once you move past the high accuracy region amount, High Accuracy be false, and locations should slow to every 60-seconds (if using the default settings) when moving.

Here is a sample log:

  • Updating 'Location' presence for Bob -- 'present' (Home Wifi: false, High Accuracy: false), 0.0 km from Home, Battery: 72%, Velocity: 26.0 kph, accuracy: 2 m, Location: [x,y] , Regions: [Home]
  • Updating 'Event leave' presence for Bob -- 'not present' (Home Wifi: false, High Accuracy: false), 0.3 km from Home, accuracy: 1 m, Location: [x,y]
  • Updating 'Location' presence for Bob -- 'not present' (Home Wifi: false, High Accuracy: true), 0.3 km from Home, Battery: 72%, Velocity: 40.0 kph, accuracy: 2 m, Location: [x,y]
  • Updating 'Location' presence for Bob -- 'not present' (Home Wifi: false, High Accuracy: true), 0.5 km from Home, Battery: 72%, Velocity: 56.0 kph, accuracy: 1 m, Location: [x,y]
  • Updating 'Location' presence for Bob -- 'not present' (Home Wifi: false, High Accuracy: true), 0.7 km from Home, Battery: 73%, Velocity: 35.0 kph, accuracy: 2 m, Location: [x,y]
  • Updating 'Location' presence for Bob -- 'not present' (Home Wifi: false, High Accuracy: false), 1.0 km from Home, Battery: 73%, Velocity: 66.0 kph, accuracy: 2 m, Location: [x,y]
4 Likes