I have an automation to notify me when a person’s state changes from home to away or away to home.
- alias: a_person_alert
initial_state: True
trigger:
platform: state
entity_id: person.person1, person.person2, group.presence_guest
action:
- service: notify.sms
data_template:
#title: "Locale notification"
message: >
{{ trigger.to_state.attributes.friendly_name }}{% if trigger.to_state.state == 'home' %} arrived home{% else %} has left{% endif %}.
This automation has been working great for months. However, before I was using “device_tracker” sensors for the entity_ids. Now I am able to add “person” entity_ids.
The previous device_trackers were just based on WIFI connection using the Linksys device tracker component. Since the wifi tracker isn’t always perfectly reliable, I added owntracks as well. So the person entity consists of wifi AND owntracks.
The problem I am having now is that when I leave the house (or anyone else does), I am repeatedly getting notified every few minutes. So this automation will say “person1 has left” over and over again…
This is something to do with the “person” entity because if I just use wifi then it works as expected, and if I look at the history for the OwnTracks entities, it shows properly the comings and goings (no repeated coming and going like the notifications I am getting)…
Is this a bug with the person entity? Or is there something else I can look at?