Composite Device Tracker Platform
Click the link above to get the custom integration.
Continuing the discussion from Composite GPS-based Device Tracker?:
Ok, well there wasn’t much discussion, but…
As I understand it, if you have a GPS-based device tracker and one or more network-based device trackers for a given person, they can be combined by simply editing known_devices.yaml. However, what do you do if you have more than one GPS-based device tracker per person? I couldn’t find anything that would combine them (although I’ll admit I didn’t look too hard. If something already exists for this situation, please let me know!)
“But why would you have more than one GPS-based device tracker per person”, you ask?
Well in my case I’ve been using Life360 to provide presence detection for a few family members, and it’s worked pretty well. I also started using Google Maps Location Sharing for family members that weren’t using Life360. I immediately realized that for some people I could use either … or both!
Then, as chance would have it, one of the people whose device location was being obtained via Life360 (but could be obtained via either method) put their phone into a power saving mode, which caused Life360 updates to become irregular. No matter what I changed in the phone’s settings to let Life360 run whenever it wants, nothing seemed to help. So I tried changing that user over to Google location sharing. But I discovered that it was inconsistent, too, on this phone.
After further monitoring with both enabled, I noticed that although they were both inconsistent, they weren’t inconsistent at the same time. To put that another way, when one would seem to drop out for a while, the other seemed to be updating fine, and vice versa. Weird, because they’re both running on the same phone, using the same GPS service.
It occurred to me, I could use an automation that triggered on either entity (Life360 or Google Maps) updating, and use that to create a “composite” device_tracker entity using the device_tracker.see service. And it worked, and worked well!! The biggest downside was now my logs were clogged with this automation triggering all the time.
So, I decided to create a new Device Tracker platform that would do the same thing as the automation. And so far it’s working pretty well.
If anyone has a similar scenario and would like to try this out, by all means, follow the link at the top of the page … and don’t forget to let me know how it works for you, if you can think of any improvements, or if run into any problems using it.