[RELEASE] OwnTracks Presence

The HPM install was a mess, so I finally got everything removed and was going to try via GitHub...but now whe driver code link on the install instructions now gives a 404 error...

This a just-me?

I think you are right, I changed the radius to 1 meter and tricked it into thinking I am out of zone, then back to 20 meters and now I am present in HE. I wonder what that manual report is for then.

I installed via HPM a couple hours ago and besides having to manually enable OAuth, it worked perfectly.

@brianwilson I had my user in the Username field on Android app. It didn't work. Kept return g null for user. I had to add it to url and it worked.

is this needed for iOS?

The HPM install was badly broken for me, I got the same error after enabling OATH as before when I tried to add the app, then it would not uninstall via HPM so I had to delete the app and driver from the code sections and then do an uninstall again in HPM to finally get HPM to see it was gone. Would like to avoid HPM for now, but can't w/out the driver code....

Does anyone have a working link for the driver code?

Try this:

https://raw.githubusercontent.com/bdwilson/hubitat/master/OwnTracks-Presence/virtual-mobile-presence-owntracks.groovy

What error were you getting, because like I said, I literally installed from scratch via HPM like 2 hours ago and yes it had the OAuth error, but after I went into the app code and manually enabled and then saved, it launched without error.

Maybe reinstall HPM?

Thanks - instructions link is missing the "owntracks" part...

Instructions: https://raw.githubusercontent.com/bdwilson/hubitat/master/OwnTracks-Presence/virtual-mobile-presence.groovy
Your link---: https://raw.githubusercontent.com/bdwilson/hubitat/master/OwnTracks-Presence/virtual-mobile-presence-owntracks.groovy

It was a "an unexpected error" message, unfortunately didn't copy it. Got it before and after enabling OATH in the app. I have the app and driver code now, so I'm installing manually and I may match up later in HPM...

Thanks.

1 Like

@brianwilson I am not sure if you saw my previous posts about this, but is there any way to rename the Virtual Devices to follow our own naming convention? I was hoping if I only changed the device label it would not break the functionality, but it appears to.

Sorry guys; I tried to do too much at once. I renamed the virtual presence device because I added battery, ssid and bssid to it as I figured someone would want that info on their device. Also took off the requirement for the user, but looks like we need that on android. I’m on vacation through tomorrow but I’ll get things cleaned up soon. Sorry for the broken installs.

EDIT: Got the docs updated with the right presence device. You need to add your user after /location; setting UserId in OwnTracks doesn’t work. Any HPM fixes will be sat or Sunday.

4 Likes

@cjkeenan @spalexander68

Just to clarify - is renaming the network device ID a requirement? My presence virtual device already has an ID, not sure if I need to change that:

  • "Network Device ID can be '''HOME_PRESENCE_BRIAN''' for the first."

And if so, should I use all caps as above? It seemed odd to to use all caps when none of the other settings do that...

Decided to just try it - renaming to HOME_PRESENCE_NAME (put my name in for name) allowed device to update and show Battery at least. So progress for now until Brian gets back from vacation.

image

Also - can someone confirm what the "Off" and "On" buttons are for? I assume they just turn tracking on/off in HE for that person/device.

Your device network ID doesn’t matter at all.

On will mark you as present, off as not present. It will not talk to OwnTracks. Refresh will do nothing.

If you’re not seeing BSSID or SSID, please post your debug logs after swapping through the different OwnTracks detection methods.

Current manual install instructions should be correct as of yesterday evening.

1 Like

Thanks. Left home and the device appeared to start reporting presence. I'll get more info when back home. Screen shots and current logs below.

Summary

Anyone know if the "Friends" feature of OwnTracks is supported using HTTP versus the MQTT Broker? In their documentation they talk about MQTT, but do not specifically state that using HTTP as a connection breaks this feature, so I was wondering if anyone knew.

Update per their documentation:
All publishes which are currently done with MQTT will then be POSTed to the endpoint with exactly the same JSON payload formats. Support for Friends is available if your HTTP endpoint can produce appropriate data which is consumed by the app whenever it POSTs a location. This differs greatly from MQTT mode wherein the app subscribes to topics and is informed of data on those topics whenever it's available; in HTTP mode the apps do not periodically poll your HTTP endpoint; rather it is contacted only when the app is ready to publish its location or when you manually trigger a publish. (Support for friends and optionally their cards is implemented in the Recorder.)

So it does look like it is supported, but I think it has to be built into the Hubitat app.

Just thought of something, I have all my Hubitat and other smart home devices on a separate VLAN. It's segregated not allowed to initiate contact to the main VLAN and devices there, but is allowed established/related contact if initial contact comes from a device on the main VLAN. So thinking thats why the SSID and BSSID are null in my current setup...

I returned home and the OwnTracks device knows I'm home again, so appears to be working...do I need the SSID and BSSID status to use this for presence? The OwnTracks devices show up in my apps as presence sensors, and the home/away presence is getting updated correctly when I'm home/away.

Not what you want to hear, but it appears bssid, ssid and battery state aren’t sent in Android. That being said, ssid and bssid aren’t even listed in the API JSON - OwnTracks Booklet

I did see that battery status is coming for android: Charging (battery) status for Android · Issue #841 · owntracks/android · GitHub

I’ve also opened an issue to ask for SSID/BSSID to be sent from android. Feel free to add your likes to this request.

I’ll update code tomorrow to show N/A If the items aren’t available. I’ll also be adding battery charging status.

I’m not doing anything with friends on the http endpoint. I’d say if you’re relying on friends feature, you should use MQTT and perhaps node-red? Not even sure how friends would be implemented without MQTT bridging.

Thanks for confirming. Funny, but I am on Android (S10) and I have been getting accurate battery status all day...it's been spot-on reporting my phone battery correctly.

My current reporting of 59% is below, and it is correct and has been all day. :slight_smile:

image

So funny they say it's coming - for me it's already here. :wink:

EDIT: Ah, just noticed that the link above says "Charging (battery) status..." not just battery level. My bad.

Can you please confirm what SSID and BSSID are necessary for in terms of using this for presence sensing?