when I look in the developertools, (or when I retrieve the attributes from “person” entity in pyscript, I see the device_tracker is attribute “source”
The documentation states this attribute is called : “device_trackers:”
Bit confused here…
I didn’t see it explicitly stated in my skimming of the docs so this is just an assumption, but I’d imagine the
source attribute is the device currently being used to determine that person’s location, whereas
device_trackers is the list of possible devices that can be used for that person. This assumption is supported by the example they give, since they make statements like:
the state of your Person entity will be
home with source
tracker_ble, whichever was most recently updated.
“device_trackers” ist used in the YAML configuration for the person ingeration.
The entity itself has the attribute “source” for the device which was updated last.
I find it a bit confusing that in yaml I have to use “device_trackers” and also in the “person” UI it’s called device trackers, but the attribute of the person is suddenly called “source”.
Anyway, thanks for the response. Now I know that the “source” attribute is the same as “device_trackers” in YAML or UI. (I thought I was missing something)
Maybe your confusion stems from a more core misunderstanding. Any entity configuration YAML is not the same as, and does not necessarily directly define, that entity’s attributes. The configuration definitions are just used to ascertain the entity’s various attributes. In this case,
device_trackers is used to determine
source by looking at which of the specified entities was last updated.
They are not the same thing.
device_trackers is a list of possible entities.
source is the currently used entity.
Yes that’s it! That makes sense!
Don’t know if I would need it, but, is there a way to retrieve all the device_trackers for a person?
It’s no problem for now. I now understand the “source” field.
Happy to help, glad it has clicked now!
As far as pulling the list, not that I’m aware of. It would have to be an attribute on some entity and I don’t believe it is.
That’s really close but not exactly correct.
A “person” location is determined by the likelihood that a device_tracker is giving accurate information.
for GPS trackers it will use the latest status location update from all the GPS trackers.
BUT, if there is a more specific tracker it will always use that instead no matter what the less specific trackers tell it.
an example is that using a router based tracker will override a GPS based tracker if the router based tracker shows the tracker as being “home”. And a ping based tracker will do the same.
I had that exact situation happen a couple of weeks ago when my Unifi router for some reason never released my wife’s phone as being connected to the router and, even tho she was out of the house for several hours, she always showed up as home in her “person” entity even tho all of the GPS based trackers (Life360 and the HA mobile app) showed the true location.
Yeah, i added my NETGEAR router too now.
Read a few times the docs.
My router seems to release my phone and my wife’s phone…
The script i write works now.