Device tracker, trigger on either one not_home, or both home, but not if one is home

so the update automation gets triggered, but the light did not turn on when we got home

i think i will add a motion sensor instead or just use the app to turn on the light a bit before we get home

Hi,

In order to automate my (EUFY) cams (set to away mode when both out, set to home mode when 1 of us is home), I created a group for the 2 trackers and made 2 simple automations. However nothing happens. Calling the services manually, everything seems to work. Is there anyone who can spy where I go wrong? Thanks So much!

groups.yaml:

Iphone Trackers:
    name: iphonetrackers
    entities:
      - device_tracker.iphone_van_saskia
      - device_tracker.iphone_jurgen

automations:

alias: turn cams in away mode when both away
description: ''
trigger:
  - platform: state
    entity_id: group.iphone_trackers
    to: not home
condition: []
action:
  - service: alarm_control_panel.alarm_arm_away
    data: {}
    target:
      device_id: xxxxxxxxxx
mode: single


alias: turn cams in home mode when one of us is home
description: ''
trigger:
  - platform: state
    entity_id: group.iphone_trackers
    to: home
condition:
  - condition: time
    after: '06:00'
    before: '22:00'
action:
  - service: alarm_control_panel.alarm_arm_home
    data: {}
    target:
      device_id: xxxxxxxxxx
mode: single

I think your state values need quotes (e.g. ‘not_home’), here’s some automations that have been working for me since I originally wrote this thread.

 - alias: Unlock garage door when we get home
  trigger:
    - platform: state
      entity_id: group.device_trackers
      to: 'home'
  condition:
    - condition: state
      entity_id: lock.garage_door_lock
      state: 'locked'
  action:
    - service: lock.unlock
      entity_id: lock.garage_door_lock

- alias: Lock garage door when we get leave
  trigger:
    - platform: state
      entity_id: group.device_trackers
      to: 'not_home'
  action:
    - service: lock.lock
      entity_id: lock.garage_door_lock

Your state is wrong. It should be not_home

1 Like