[RELEASE] OwnTracks Presence

Do you know what they mean by "Recorder"? I have been looking through their documentation, specifically the JSON payload format and I think you have to do something with the _type=card data. So HE receives data from the app, but do you ever send data back to the user? If so, I think that is how it has to be implemented, everytime it gets a new "ping" of a location, send it back to all users maybe?

This is an excerpt from their documetation:

Update, I found what they mean by recorder:

Did you base your implementation off of that or do it from scratch?
This is a link to how they suggest handling friends in HTTP mode.

@brianwilson So I have been updating the app through HPM and every time that I update the app it doesn't override the older version but installs a duplicate app and device driver. In order to get the new features I have to reassign my virtual presence sensors as well as changing the Host URL in the Android app.

It shouldn’t change anymore. If you delete all instances and reinstall via HPM it should stay and update properly. The issue was when I renamed the presence driver, I also updated device GUID’s in HPM (which I’ve now learned is a no-no). Again, sorry - was rushing it without testing.

2 Likes

No worries man. Thank you for this great app.

@brianwilson - Between this and your excellent Sendgrid email driver you have closed the gap on two key HE features for me. Other solutions were either too involved/complicated (for me) to set up, or didn't play well in my VLAN environment. Yours work perfectly and you've made them easy to set up and configure. Thanks so much for creating and sharing this and your Sendgrid driver. Off to buy you some coffee!

2 Likes

Thanks man. Glad to help; my goal is to help keep this platform alive, and the best way to do that is to keep improving it so more people move over.

Should be an update in HPM for OwnTracks. If you have ended up with duplicate devices drivers and/or OwnTracks apps - you may need to delete them manually, then do a repair within HPM. If not using HPM, just load up the driver & app in edit mode and click "import" and use the pre-populated URL.

New features:

  1. Shows battery (charging/unplugged/full) - not yet supported by Android, but it's coming. Will show N/A if not supported.
  2. SSID/BSSID will show if you're on wifi, if you're not or not on iOS, it'll change/show to N/A. I opened an enhancement request for OwnTracks on Android and they have said they will implement it.
  3. Debug mode will auto-disable after an hour.
  4. Debug mode also enables checking location updates from OwnTracks to see what regions you're "in" and updates those. This only happens in debug mode because otherwise your location would be updated unnecessarily as the transition events from OwnTracks is what details an actual change.
  5. Cleaned up instructions (github) & directions (during app install/configuration). If you notice something that needs to be communicated better, let me know, or send me a pull request.
4 Likes

Great work, thanks. Just to confirm, the updated driver version should be 1.1.2 for the driver, correct?

@danabw, that is what I am showing after a fresh install.

1 Like

One minor suggestion that may be more a "Just-Me" issue. Any reason not to rename the driver to something starting w/"OwnTracks" so it's more intuitive to find in the driver list and in Drivers Code section of HE?

I get that naming it "Virtual..." is useful as it puts it into the area where other virtual drivers are, but for me I tend to look for apps/drivers using their "name" rather than their type. Since the app name starts w/OwnTracks this also makes them consistent.

Not a big deal as you can easily find it by typing the name when you're looking for drivers, but I noticed when I was looking for the OwnTracks driver today in my driver code I scrolled to the "M, N, O, P..." section alphabetically and was confused for a bit when I didn't see an "OwnTracks" driver there.

1 Like

Yes. 1.1.2. I'll keep all files updates if I change things. It'll help with anyone doing a manual install.

Good point. The goal is to make it easy and intuitive for folks. @dman2306 might have to confirm if I can rename a driver name without changing the file name or GUID and have it update properly in HPM. If not, I'll probably leave it.

I honestly thought about making it a parent with virtual child devices, which might make installation easier, but I know at least for myself, I change ways to get presence whenever I find a better way to do it, so I'd rather not change all my automations to use a new device and just update the type. Shrug. :sunglasses:

1 Like

Makes sense about not changing the name if that forces a GUID change.

Feeling a bit dense, but can you elaborate on above - what does "...just update the type..." refer to?

I have several different virtual presence devices, and depending on what app is managing the presence for that device determines what driver type I can select for it - for instance, I might move from GeoFency to OwnTracks, to do that, I just need to adjust the driver to be a different virtual presence device - but I don't need to delete or recreate the device. If the app fully managed the virtual device creation, then it's tied forever to that app. Not tying the device to an app gives me freedom to do other things with that device outside of the app integration. Hope that makes sense.

1 Like

Thanks, that makes sense now. Wouldn't have thought about it that way on my own, thanks for explaining it. :slight_smile:

Made some updates now in HPM that will break unless you fix them. You'll need to set user and location prefs in each device rather than use the device name. Also renamed device driver to start with "OwnTracks". Thanks @cjkeenan

3 Likes

Thanks for the update. :slight_smile:

Throwing down my "dumb question chit." :slight_smile:

Just to confirm, by "Device" you mean the HE Owntracks devices we've created?

OK - the info in HPM during the update makes it clear! Thanks.

BREAKING CHANGE: We are no longer using device name as a combination location/region and user identifier - you need to set the identifiers in device settings for each virtual presence device. This means your device name can match whatever you want as some folks keep virtual devices named in a similar fashion.

Yeah in the virtual device, there are two preferences now, one for User and one for Region/Location. This is a change from the data being stored in the name previously

Thanks!

FYI, I'm getting an error in HPM:

Logs below:

Weird, mine updated fine using HPM. Retry it? Maybe reboot hub?

That looks like an internet issue to me.

Looks like I have server errors, I posted logs. :slight_smile: I've tried multiple times, same issue.

I went ahead and updated directly from the GitHub.

Worked! Per directions after updating the OwnTracks app in HE, enabled debugging. Updated OwnTracks virtual devices w/location name and user name in the new fields in the driver setup. No updates required in the Android app.

Initially the OwnTracks virtual device showed me not present even though I'm sitting at home. I checked the OwnTracks Android app and its location was incorrect, first time I've seen that happen. I checked Google Maps and it showed my correct location. I looked in the OwnTracks app for any odd settings, and after a couple minutes, didn't see anything, but when I returned to the map view in the OwnTracks app it had my presence correct again. It was then also correct in the driver of course.

I'm going to try to remember to check my location in the OwnTracks app a little more frequently. I think I'm also going to set up a temporary automation to turn on a light when OwnTracks reports me as away, so I can see when I get home if it's not updating properly.

Thanks again for the update - using the two fields to set the location/user in the OwnTracks virtual devices helps me, as now I can name the virtual devices starting w/OwnTracks and they will all be in one place when I'm looking for them. :slight_smile:

I believe I've fixed the HPM error. I had to add an alternateNames section with the old driver name. I think that will fix the issue even though the error looks like an http error. HPM repair should also fix it. If not, Removing and reinstalling via HPM would work too.

Having the location and user in device prefs really cleans up the instructions and makes things more straight-forward.

2 Likes