I understand what this change is about. What I am struggling with is that I seem to get it tripped in cases I did not expect. Below is one example that causes it to be tripped. Any ideas why?
##########################################################
## Location Status - Location Change
##########################################################
- alias: Location Change
initial_state: False
trigger:
- platform: state
entity_id:
- device_tracker.johns_iphone
- device_tracker.kimberleys_iphone
condition:
- condition: template
value_template: >-
{{ trigger.from_state.state is defined and
trigger.to_state.state is defined and
trigger.to_state.state != trigger.from_state.state }}
action:
- wait_template: "{{ is_state('script.notify_ios_engine' , 'off') }}"
- service: script.notify_ios_engine
data_template:
message: >-
{%- set name = trigger.to_state.attributes.friendly_name -%}
{%- set to_state = trigger.to_state.state -%}
{%- set from_state = trigger.from_state.state -%}
{%- if to_state == 'not_home' -%}
{{ name }} departed {{from_state}}
{%- elif from_state == 'not_home' -%}
{{ name }} arrived at {{to_state}}
{%- else -%}
{{ name }} left {{from_state}} and arrived at {{to_state}}
{%- endif -%}
who: >-
{%- if trigger.entity_id == 'device_tracker.kimberleys_iphone' -%}
john
{%- elif trigger.entity_id == 'device_tracker.johns_iphone' -%}
kim
{%- endif -%}
notify: "{{ states('input_boolean.notify_locations') }}"