Just moved my presence detection over to the iOS app after using Owntracks or a while. I am also using OT Recorder to log my locations points. Owntracks publishes the location data into an MQTT server which allows OT Recorder to capture that message and log the location.
Would be nice if the HA iOS app published to an MQTT server as well.
I am using HA for a few months and just yesterday I found the “Templates” sections in the Developer Tools: http://YOUR-IP-HERE:8123/dev-template
This is a great starting point to figure out the attributes of states. So this will give you an overview over all the stuff you can get from the device tracker object:
{{ states.device_tracker.<YOUR-DEVICE-ID> }}
If you just want the values of lat/long, you can use these:
There was some spacing reformatting required but in general works. It publishes to the MQTT server. Problem is the format of the payload is different to the format required for OT recorder.
Owntracks format is {“batt”:61,“lon”:xxx.7804054036401,“acc”:65,“p”:100.5022277832031,“vac”:10,“lat”:xxx.337309852767826,“t”:“p”,“conn”:“w”,“tst”:1492664080,“alt”:25,"_type":“location”,“tid”:“sc”}
HA iOS app format is
{‘source_type’: ‘gps’, ‘battery’: 28, ‘friendly_name’: ‘sams iphone6’, ‘gps_accuracy’: 30, ‘longitude’: xxx.7807049416972, ‘latitude’: xxx.337278001011663}
Is there a way to just extract the latitude and longitude. I can set fixed values for the other attributes as I don’t believe OT recorder needs them. - We also need the time stamp in unix epoch time format.
hm well … I think one of the great purposes of HomeAssistant is, that everyone can control where the gathered data should go. Personally, I don’t want CloudMQTT to have any of my location data. I can’t see any encryption of the data or am I wrong?
So CloudMQTT is using Mosquitto as their MQTT server and the connection can be secured via TLS/SSL, right?
But the content of your messages will be processed unencrypted on the AWS server. That might not be a big deal, but I definitely understand if one wants to leave as less (unencrypted) data on other servers as it is possible.
Yes its essentially a personal cloud instance of mosquitto, and messaging is TLS secured.
I agree that if you’re wearing your tin foil hat then you may prefer not to go there, but this is the same for all cloud services… you need to weight the cost/convenience/privacy/effort etc criteria to make a choice vs rolling your own.
Would be nice to get the hard coded variables above being provided by the iOS app but not essential.
Also wanted to note that I think the HA iOS app is less likely to report false locations - Owntracks seemed jump around to different locations even when stationary.
I just worked up this for my wife’s iPhone. I realized a few days ago that OwnTracks wasn’t updating properly on iOS 11. Luckily I found this post, and so far it looks like it’s doing the trick. I’ll remove OwnTracks from her phone and test the iOS updates when she goes out tonight. I should still be able to view her location in OwnTracks on my Android phone (which is useful if her vehicle has a problem and I need to get to her).