Automation do not triggers gateway arm

Hello, i’ve set up simple automation to arm Mi gateway when we leave home, but its not working, here’s code:
id: ‘1608227461834’
alias: Alarm po wyjściu włącz
description: ‘’
trigger:

  • platform: zone
    entity_id: person.ariel
    zone: zone.home
    event: leave
  • platform: zone
    entity_id: person.sandra
    zone: zone.home
    event: leave
    condition: []
    action:
  • device_id: 5247ff5dc3653076712292415e835843
    domain: alarm_control_panel
    entity_id: alarm_control_panel.xiaomi_gateway_alarm
    type: arm_away
    code: ‘’

Im using tracking of persons by bt scanning and router connection

Ok, fixed it by changing to

platform: state
entity_id: person.xxx
from: home
to: not_home

Also had to create group containing all persons to arm it when everyone is away
so: “entity_id: group.xxx”