Not really sure what you are asking.
You could certainly use the additional conditions to limit only certain zone change or people, and you could leave the entering and leaving blank, and only populate the leave and enter.
Read thru the documentation again and try some things.
The thing is that if you are counting on a jump from school to home, there canāt be any not_home between.
If you canāt use the BP direct, you could take pieces and parts of the BP and build your own automation.
You are going to have to look at the trace to see what is happening and the zones to see what itās state is.
Generally home is home, though, myHome, not sure what that is. If it is a zone you set to overlay the actual home, weird things can happen.
Sorry, my fault, my text about the zone āmyHomeā is a little bit confusing.
I have only one zone defined which is my home address. I call it āmyHomeā in my last post. The name in HA is āhomeā (like āhomeā, not āHomeā or āhOmEā or something else).
I added now the following code to your BP:
trace:
stored_traces: 25
to have a little bit more traces to investigate in this.
Thanks for the hint. I will come back with my results.
It should go to the step under the arrow (i presume) .
Here is the step config which I struggle to find the problem:
My guess is there is something wrong in the conditions of āHas Person arrived at Zone?ā.
alias: Determine if there was an actionable event
choose:
- conditions:
- alias: Has Person arrived at Zone?
condition: and
conditions:
- condition: template
alias: person is in target zone
value_template: '{{ to_state in friend_zone }}'
- condition: template
alias: person is arriving from another zone
value_template: '{{ not from_state in friend_zone }}'
sequence:
- service: notify.mobile_app_chmp
data:
message: '1 Test is at home'
- service: notify.notify
data:
message: 2 Test is at home
- type: turn_on
device_id: 90cb399ceaf3d1a46e27f844663093af
entity_id: 53ee8ba0aa12919497ef715291c5e82e
domain: light
brightness_pct: 100
- conditions:
- alias: Person left Zone?
condition: and
conditions:
- alias: Person was in Zone
condition: template
value_template: '{{ from_state in friend_zone }}'
- alias: Person not in zone now
condition: template
value_template: '{{ not to_state in friend_zone }}'
sequence: []
- conditions:
- alias: Person jumped from known zone to known zone
condition: and
conditions:
- alias: Person left known zone
condition: template
value_template: '{{ from_state in friend_zone }}'
- alias: Person arrived in known zone
condition: template
value_template: '{{ to_state in friend_zone }}'
sequence: []
The trace is saying that trigger is probably to and from the same zone. Hard to say without the words but that is the most likely.
You don;'t need to post it here, just look at it yourself, but in the trace click the top asterix and then changed variables on the right. there it will tell you the from_state for person and zone, and the to_state person and zone. If they match then there was no zone change so it wonāt pick āleft a zoneā, āentered a zoneā, or āleft and entered a zoneā in the decision tree at the bottom, which looks like the case.
There will be a trigger every few minutes where the GPS changes a few digits and the person doesnāt move far enough to change a zone. Those have to be screened out. Try to manually change te device location out of the zone and let it come back while testing.
This seems to be ok.
So this looks like its fulfilled but does not start the āHas Person arrived at Zone?ā step.
- alias: Has Person arrived at Zone?
condition: and
conditions:
- condition: template
alias: person is in target zone
value_template: '{{ to_state in friend_zone }}'
- condition: template
alias: person is arriving from another zone
value_template: '{{ not from_state in friend_zone }}'
I just wrote this up to help here and anywhere else when working with zones.
It might or might not help you @chris345433 but it should help others.
I realized the docs were a bit weak on this and in reading about 4 forum posts, I finally figured out how to do it myself, so I decided it should be pulled into a guide.