I tried making another automation to test using “State = 0 persons” as the trigger and ran it and it still did the task even though my phone is home (as confirmed by looking at HA to verify the GPS is correctly showing that I am home)
If you associate these trackers with person entities:
Then you can simplify your triggers and conditions to:
alias: Thermostat off when gone
description: ""
trigger:
- platform: state
entity_id: zone.home
to: 0
action:
- device_id:
domain: climate
entity_id:
type: set_hvac_mode
hvac_mode: "off"
- device_id:
domain: mobile_app
type: notify
message: Nobody is home, Thermostat is disabled!
mode: single
The state of the zone is the count of the number of people (not trackers) in it. So when it goes to 0 there is no one home and so disables your thermostat.
That must be my problem now then! I didn’t realize when I manually run the action it would be completed regardless I assumed it would run, recognize I was home and cease the action from being completed.
So I will switch over my automations now using this and see what happens later when the house is empty and report back. Thank you!
Yeah manually running an automation only tests the actions, not the triggers or conditions.
You can test the conditions as well as the actions (but still not triggers) by using the automation.trigger service in Developer Tools → Services and setting the skip conditions option to false:
I think I figured it out! Turns out I have TWO entities for myself?
It looks like my phone as well as my computer are registered as entities. Is there any way that I can set it to ignore every entity except for me, my dad and my wife?
Or is there a way to remove/exclude this entity from all automations/zones?