I am trying to figure out a way to modify gps coordinates parameters of a device_tracker object from within an automation. The reason is that I receive gps coordinates updated from another device (child watch). At the same time I want to keep the device_tracker object available so that when updates are coming from the iphone of my kid it also works as expected. Is there any way to do that, except with the dev tool console from the UI ?
No one? Ok, the latest thing I did, I successfully installed appdeamon and now it is running as service, so I will appreciate if someone gives me some advise how to achieve it with app?
This app should listen to changes of 2 sensors -> the gps coordinates and then to update the HA device_tracker.XXX.attributes for latitude and longitude, and perhaps to also update the state of it, based on some calculation (like calculation distance() from the gps to the zone1,2,3, etc.).
However, I have like ZERO experience with appdaemon.
Reason NOT to use alternatives: I need the very same device_tracker updated from 2 sources and also it is being used in many automations so I need 1 instance to check…
I would create a template sensor who’s value is updated based on which device tracker has the most recent update attribute. (or create two input numbers to hold the current lat / long values you need for automation)
Something like
If device tracker 1 update attribute is < device tracker 2 update attribture
Device tracker 1 - gps
else
Device tracker 2 - gps
Can I format such template sensor to look like a device tracker entity? to have the same json structure? Even if possible, still I need to have the device_tracker entity updated - otherwise I will lose other advantages, e.g. display on map, automations that expect such entity will not work, it will not be consistent. Thank you anyway, but I will need to find a way with appdaemon somehow.
Another possible solution is to use the owntrack device tracker without installing the app on your phone. If you setup HA for owntrack and then publish gps etc to mqtt, HA will see that as a device tracker.
You can automate the publishing of MQTT
Rob, I was using exactly this approach before but didnt know it will work without the app on the phone. I wanted to reduce the apps and make it more simple. I will give this a try. However i will try also with the appdaemon - now getting some knowledge about this nice way to build more complex things. Thank you!
Ok Rob, brilliant! I can confirm now it works now fine with just the owntracks and mqtt updates WITHOUT THE Owntracks APP on the iphones!
I will post here in this topic any outcome with the appdaemon, though… if I make it.
Thanks!
The other part of my system is sosumi to use the iphone’s ifind feature to push locate it.
now this is possible via the ios app by sending to the phone a notification with message “request_location_update”. It works and I’ve set that to 20 mins to update these statuses.
I can’t get the app to work on my iphone4
Yes, I confirm on my daughter’s iPhone 4 it stopped working but still I can send location update from the app (otherwise is just blank screen of the app with only the header and footer). On the iPhone 6S is fine.