From 666b3a0d0c345f0a441c1dd4fff650c03c27a610 Mon Sep 17 00:00:00 2001 From: Victor Vostrikov <1998617+gorynychzmey@users.noreply.github.com> Date: Tue, 5 Mar 2019 22:56:04 +0100 Subject: [PATCH] Add example of choice of sources for Person (#8779) * Added description for source priority. * Changed description of source priority. * Added example of sources' choice. * Corrected example * Added TL;DR to example * Updated TL:DR * Added hint for consider_home --- source/_components/person.markdown | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/source/_components/person.markdown b/source/_components/person.markdown index 6a0782635c8..37203c01855 100644 --- a/source/_components/person.markdown +++ b/source/_components/person.markdown @@ -13,7 +13,27 @@ ha_qa_scale: internal ha_release: 0.88 --- -The person component allows to connect device tracker entities to one or more person entities. The last state update of a connected device tracker will set the state of the person. For example if you connect your router and your OwnTracks device as trackers to your person, the last state update from either the router or your OwnTracks device will set the state of your person. +The person component allows to connect device tracker entities to one or more person entities. The state updates of a connected device trackers will set the state of the person. When multiple device tracers used, the state of berson will be determined next way: + +1. If there are stationary sources (which type is not 'gps') presenting status 'home', than latest of this sources will be taken. +2. If there are sources of type 'gps', than latest of this sources will be taken. +3. Otherwise will be taken latest source with status 'not_home'. + +Lets say for example, that you have 3 trackers: 'tracker_gps', 'tracker_router' and 'tracker_ble'. + +1. You're at home, all 3 devices shows status 'home' - status of your Person entity will be 'home' with source 'tracker_router' or 'tracker_ble', whatever was latest. +2. You're going out. 'tracker_gps' shows status 'not_home', but other two trackers show status 'home' according to their setting 'consider_home'. You are still considered to be at home. +3. After some time both stationary trackers show status 'not_home'. Now your Person entity has status 'not_home' with source 'tracker_gps'. +4. While you are outside your home, your Home Assistant was suddenly restarted. Until 'tracker_gps' receives update, your status will be determined by stationary tracker, which gets latest update after restart. Obviously the status will be 'not_home'. +5. Than you're going into area marked as 'zone1', 'tracker_gps' is getting update, and now your status is 'zone1' with source 'tracker_gps'. +6. You've returned home, and your mobile device has connected to router, but GPS update yet didn't occur. Your status will be 'home' with source 'tracker_router'. +7. After GPS update occurs, your status still be 'home' with source 'tracker_router' or 'tracker_ble', whatever updates later. + +TL;DR: When you're at home, your position is determined firstly by stationary trackers (if any) and then by GPS. When you're outside your home, your position is determined firstly by GPS and then by stationary trackers. + + +**Hint**: When you use multiple device trackers together, especially stationary and GPS trackers, it's advisable to set `consider_home`for stationary trackers as low as possible. + You can manage persons via the UI from the person page inside the configuration panel or via `YAML`.