- alias: "Turn off: Fuchsbau lights"
  id: "1721662805884"
  description: "If nobody is home"
  triggers:
    - entity_id: person.faelis_skribblekitty
      zone: zone.home
      event: leave
      trigger: zone
    - entity_id: person.lucy_foxx
      zone: zone.home
      event: leave
      trigger: zone
  conditions:
    - condition: and
      conditions:
        - condition: state
          entity_id: person.lucy_foxx
          state: not_home
        - condition: state
          entity_id: person.faelis_skribblekitty
          state: not_home
  actions:
    - action: notify.mobile_app_lucy_s_phone
      metadata: {}
      data:
        title: "Fuchsbau Lights: turned off"
        message: Because nobody is home
    - action: notify.mobile_app_lucys_mi_9
      metadata: {}
      data:
        title: "Fuchsbau Lights: turned off"
        message: Because nobody is home
    - action: light.turn_off
      metadata: {}
      data: {}
      target:
        entity_id: light.group_fuchsbau
  mode: single
- alias: Notify on Zone leave
  id: "1727535398162"
  description: ""
  triggers:
    - entity_id:
        - person.faelis_skribblekitty
      from:
      to:
      trigger: state
  conditions:
    - condition: template
      value_template:
        "{{states('sensor.home_2_faelis_skribblekitty_direction_of_travel')
        == 'towards'}}"
      enabled: false
  actions:
    - variables:
        content:
          "***{{ states('sensor.home_2_faelis_skribblekitty_distance')|round(2)}}
          km*** away. *(moving {{states('sensor.home_2_faelis_skribblekitty_direction_of_travel')
          }})* *{{ states('sensor.faelis_phone_geocoded_location') }}*

          "
        title: "{{ 'Faelis entered Zone: ' ~ trigger.to_state.state if

          trigger.to_state.state != 'not_home' else 'Faelis left Zone: ' ~

          trigger.from_state.state }}

          "
    - action: notify.mobile_app_lucy_s_phone
      data:
        message: "{{content}}"
        title: "{{title}}"
        data:
          importance: high
          channel: faelis_tracker
  mode: single
