Actually, I don’t know about the behavior you described. I’ve read the code for the person integration, so I know basically how it uses its “input trackers”, although I will admit I haven’t reviewed it very recently.
I think the main difference is that the composite’s approach is that “new data” is better than “old data”, rather than trying to prioritize the types of the various input data. It also recognizes that for most non-GPS based inputs (routers, pings, blue-tooth, binary sensors, …) they are much better at determining when a device comes home than when it leaves, and by default, only uses the home states of those types of devices. I did add a new feature recently, though, that allows one to configure the composite to use all states of any given input if that makes more sense for the user’s scenario.
Another thing the composite does that I’m pretty sure the person integration doesn’t is to use attributes of input devices that indicates how “old” its GPS data is. E.g., both the life360 and google_maps integrations (which I happen to use) have last_seen
attributes. So, if one of these entities updates for some other reason, but the last_seen
“timestamp” hasn’t changed, it won’t be looked at as necessarily newer.
To describe that another way, let’s say input 1 updates, so the composite takes its data and updates itself. Now input 2 updates and its last_seen
is newer than the last_seen
from input 1, meaning it is newer data. In this case the composite takes the data from input 2 and updates itself. Now the input 1 entity updates for some other reason, but its last_seen
hasn’t, and is therefore still older than the recent last_seen
from input 2. In this case the composite ignores that update and retains the last information from input 2, because it’s newer and is a better representation of where the device actually is.
Agreed. Like I said, I use Life360 & Google Maps, and using both on the same phone results in more up-to-date data, and for the reasons given above (mainly checking the last_seen
attribute), the composite does a better job of always using the most up-to-date data than the person integration does (again, at least as far as I know since the last time I reviewed its code.)
Agreed. And if I cared about that feature I’d use the person integration “on top of” the composite integration to get the best of both worlds.