looking for some assistance in setting up an automation, and where i went wrong.
it’s a location based automation to turn on a light when someone enters the “home” zone. they have the iOS app installed, and i can see their location on the map. in their person profile their device tracker for the iphone is applied to their profile.
when they entered the zone nothing happened, so i assume i have something set up a little wrong.
alias: Hall Light When Approaching Home
description: ""
triggers:
- trigger: zone
entity_id: person.sarah_jane
zone: zone.home
event: enter
- trigger: zone
entity_id: person.simon
zone: zone.home
event: enter
conditions: []
actions:
- action: light.turn_on
metadata: {}
data: {}
target:
device_id: b7c59356ca04deaccbe01ee607b28734
mode: single
as a test i went into developer tools > states > set state on that automation and the light came on, so i assume the issue is with the location based trigger?
Another way to look at this if it helps you is to trigger on the state of zone.home.
If it’s 0, noone is home.
It stores the number of persons in the home zone.
how does that help with turning the light on when anyone enters the zone?
isn’t it more complicated to count the value of that state to decide if the light is turned on or not?
also, the automation may only apply to certain people, the state count doesn’t know “who” is in the zone.
Just offering alternatives if they fit.
What you are doing is as right as anything else, but would be a bit annoying if you wanted to apply it to an everyone light, for instance.
Add a map card on your dashboard and set the hours to show a few hours, then you should be able to see what HA believes your position is in comparison to when the light turns on. Take note what time you arrived home.
I have a feeling the position tracking is lacking behind and because of this the light turns on when you already sit in the sofa.
it didn’t trigger from what i can tell, the light certainly didn’t turn on
in developer tools > states > set state - the light turns on
no idea, this was yesterday and we’ve not had an instance yet today where it would be triggered - both are currently at home.
i would need to wait again today to see what happens when someone leaves then re-enters the home zone. the home zone is wide enough to pick them up as they enter the street.
so at least i know that part is working correctly.
it changed to not_home shortly after leaving the house (enough time get out the zone defined area)
So you are you suggesting something like this?
alias: Hall Light When Approaching Home
description: ""
- trigger: state
entity_id:
- person.sarah_jane
- person.simon
to: home
conditions: []
actions:
- action: light.turn_on
metadata: {}
data: {}
target:
device_id: b7c59356ca04deaccbe01ee607b28734
mode: single