[RELEASE] OwnTracks for Hubitat Presence Detection

Glad you like it!

1 Like

@bptworld -
Pixel 8 Pro with Android 14

Everything makes sense to me except for the quoted text below. I'm not clear on how to set it up... and I'm not familiar with Docker. Do I need to run this "Recorder" on a Raspberry Pi? Am I missing something obvious? Thanks for all of your hard work!!

I just installed this app....looks very nice and love the "distance form home" setting.

One question: i was previously using the OwnTracks Presence Updater which provided the lat / long of the last report. I used that to create a map showing where me/my wife were currently.

This app does not appear to have that as a attribute. Is that something that could be added? I make a rule (Rule Machine) that pulls the attributes (lat / long) and looks for a change to redraw / post the map.

1 Like

Oh, yes, you'd need to run that on a computer or Raspberry Pi. This is fully optional, but allows you to create breadcrumb plots of each user over the past 12 hour, 7 days, 30 days. This is a program that Owntracks made, with the documentation here: Recorder - OwnTracks Booklet

1 Like

Where did you see that? 100% doable, just looking to replicate what you used before. Was that in the logs? Or on the device?

1 Like

Thanks. It looks like the battery attribute in the JSON is displaying the wrong info...

"attributes": {
"attributeMap": {
"wifi": "on",
"lastSpeed": "5",
"distanceFromHome": "2455.708",
"location": "2455.7 km from Home",
"battery": "2455.7 km from Home - Tue 11:11 AM",
"presence": "not present",
"since": "Tue 11:11 AM 2024-01-02"
}
},

It is in the OwnTracker driver. Lat & Lon

/*
 * Virtual Mobile Presence for Owntracks - based on original work by Austin Pritchett/ajpri
 * 'OwnTracks Virtual Mobile Presence Driver' driver by Brian Wilson (@brianwilson) - Version 1.1.3.5
 *
 * This version for use with OwnTracker - @bptworld
*/

import java.text.SimpleDateFormat

metadata {
    definition (name: "OwnTracker Driver", namespace: "BPTWorld", author: "Bryan Turcotte", importUrl: "") {
        capability "Switch"
        capability "Refresh"
        capability "Presence Sensor"
        capability "Sensor"
        capability "Battery"

        attribute "ssid", "string"
        attribute "bssid", "string"
        attribute "battery", "number"
        attribute "batteryStatus", "string"
        attribute "region", "string"
        attribute "user", "string"
        attribute "lat", "number"
        attribute "lon", "number"
        attribute "lastUpdated", "string"
        attribute "fName", "string"
        attribute "gMapSingleImage", "string"
        attribute "gMapMultiImage", "string"
        attribute "gStreet", "string"
        attribute "currentWP", "string"
        attribute "statusTile", "string"
        attribute "historyTile", "string"
        attribute "avatar", "string"
        attribute "avatarSize", "string"
        attribute "lastLogMessage", "string"
        attribute "nearbyPlaces", "string"

You can select what it displays in the driver. As for the distance from home, if that's wrong, do you have a home location stored?

I pushed a new driver update to add that. I also changed the default of the battery field to % to eliminate any new-user confusion.

4 Likes

Probably a good choice to protect yourself... :wink:

Thanks for the update!

I'm away from home for the rest of this week, but it looks like the app/driver has been updated to now include the lat/lon.....I'll surely update and check this out this weekend.

Thank you so much....

1 Like

Ahhh, yeh "as per design". You can turn it back to battery in each user device. Latest update will default to battery, and then you can choose something else if you like:

image

3 Likes

I just pushed a new version of the driver that will display all the extra location attributes (IE: vertical accuracy, altitude, SSID, etc.). By default they will be on with this toggle Display extended location attributes. You can turn the slider off to remove them if you find it's too cluttered.

NOTE: You might need to click the Save Preferences for each device to get it to apply the first time, since it was added after the initial install.

3 Likes

I'm running the latest version, and I'm trying to delete the "JL-OT" device. It says it's deleted, and I don't see the "JL-OT" listed under Devices, but when I go back into the OwnTracks App after selecting "JL-OT" and Next, it's still in the list.

FWIW for others...the additional attributes seem to take a bit to show up after hitting Save for Preferences on the presence device. I was about to post they weren't showing up, but went back to the driver page a few minutes later and they were all there. :slight_smile:

Very cool update!

1 Like

Oh shoot, should have mentioned you need to wait for the phone to check back in again for them to get displayed (clicking the manual update on the phone app will push it immediately).

1 Like

If you delete a second time is it gone? I cannot seem to replicate what you are seeing.

No- it does not get deleted. I just did a repair via HPM and no change. Not sure how it got corrupted. I went ahead and completely removed OwnTracks and reinstalled. Everything seems to be working now.

Might have been an issue where the driver was deleted (or not created) and then it tried to remove it before the user. I just pushed a patch that will prevent exceptions in those cases that would prevent a clean delete.

1 Like