Arm alarm when all devices 'not_home'

Hi All,

I’ve setup a group of devices when all devices are ‘not_home’ I’d like Home-Assistant to set alarm to armed.

The problem I have is this arms the alarm even if just one device leaves home.

I’ve tried adding, all: true to the device tracker but this didn’t seem to help.

Any advice please?

Device_Tracker:
    name: "Device Tracker"
    icon: mdi:home-outline
    entities:
      - device_tracker.Jon_s_iphone
      - device_tracker.jame_s_iphone
alias: Ring Alarm - Arm
description: When all devices are 'not_home' set alarm
trigger:
  - platform: state
    entity_id: group.Device_Tracker
    to: not_home
    from: home
condition: []
action:
  - device_id: xx
    domain: alarm_control_panel
    entity_id: alarm_control_panel.fleet_alarm
    type: arm_away
    code: ''
  - service: notify.all_devices
    data:
      title: Ring Alarm
      message: Alarm Set
mode: single

I had the same issue so set up an automation that checks every few minutes and then sets the alarm if all are not home/away

- alias: "Alarm Auto Set"

  initial_state: true

  trigger:

    - platform: time_pattern

      minutes: '/3'

  condition:

    condition: and

    conditions:

      - condition: state

        entity_id: sensor.status_tom

        state: "Away"

      - condition: state

        entity_id: sensor.status_trisha

        state: "Away"

      - condition: state

        entity_id: alarm_control_panel.house_alarm

        state: disarmed

  action:

    - service: alarm_control_panel.alarm_arm_away

      entity_id: alarm_control_panel.house_alarm

Hi,

I don’t have any real reason to say why, but i notice that your group name is device_tracker & that’s the same as the actual integration that tracks the devices. Perhaps, if nothing else, avoid confusion if you rename the group to be something else - like ‘family_phones’.

Also, what device_tracker integration(s) are you using to actually track these listed devices?

Nick