The below Trigger by itself works, however, with the conditions, it fires every time someone arrives home. This doesn’t seem to be working and wonder if the conditions are cancelling out the Trigger. I want this to only fire once when the first person arrives home. Is there better way to write this?
- id: '1568072625365'
alias: Someone Home
trigger:
- entity_id: device_tracker.life360_s
event: enter
platform: zone
zone: zone.home
- entity_id: device_tracker.life360_j
event: enter
platform: zone
zone: zone.home
condition:
- condition: state
entity_id: device_tracker.life360_s
state: not_home
- condition: state
entity_id: device_tracker.life360_j
state: not_home
action:
- data:
message: Someone is Home
service: notify.notify
Funny thing…I had just created a tracker group for my Everyone Away automation; I had not read closely what the trigger conditions would be. Thank you.
- id: '1568072625365'
alias: Someone Home
trigger:
- platform: state
entity_id: group.my_people
to: home
condition: []
action:
- data:
message: Someone is Home
service: notify.notify
Thanks. Regarding the single quotations…what is the point of them? I do not see them in all code. They are not added in the GUI Automation editor, and if you do add them, they get quoted in the yaml file. I am confused about that.
quote generally denote a string.
Most of the time HA will be clever enough to recognise the text and class it as a string, but sometimes it doesn’t and this can lead to errors.
It’s always a good idea / practice to enclose your strings in quotes. You can use either single or double.
More info here: https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html
This is not firing (with and w/o quotes). No notifications received, History shows it always On, and the logbook shows Trigger as Never. There would have been multiple opportunities for this to execute over the past 24 hrs.
{% if is_state("device_tracker.paulus", "home") and
is_state("device_tracker.anne_therese", "home") -%}
You are both home, you silly
{%- else -%}
Anne Therese is at {{ states("device_tracker.anne_therese") }}
Paulus is at {{ states("device_tracker.paulus") }}
{%- endif %}
go to Developer Tools > States, locate your group and click on the blue icon next to it, you’ll see its history and whether its status changed over time.
Don’t forget you need just 1 of the device trackers in the group for the group to show home, don’t add to many devices, especially sedentary devices that might always be home…