Hi There!
I’m trying to create an automation that based on our phone presence is activating the Alarm Panel which for now only consists some Blink cameras. So far I have one that is decativating it when one person is coming home, I’m also able to activate the panel when one person is leaving. However, I have some issues for two people.
I want the automation to get triggered whenever both phones are leaving and it should check against the condition if both phones are out and not only one phone. I potentially have a misunderstanding of the logic.
I create the automation via the frontend but here is the code from my automation.yaml:
- id: 'xxx'
alias: Leaving Home
description: ''
trigger:
- entity_id: device_tracker.xx1
from: home
platform: state
to: not_home
- entity_id: device_tracker.xx2
from: home
platform: state
to: not_home
condition:
- condition: state
entity_id: device_tracker.xx2
state: not_home
- condition: state
entity_id: device_tracker.xx1
state: not_home
action:
- device_id: abc
domain: switch
entity_id: switch.jasco_products_14291_in_wall_smart_switch_switch_2
type: turn_off
- device_id: def
domain: switch
entity_id: switch.jasco_products_14291_in_wall_smart_switch_switch_2
type: turn_off
- data: {}
entity_id: alarm_control_panel.blink_home
service: alarm_control_panel.alarm_arm_away
Any ideas what I’m missing here?