I’m looking at arming/disarming some Blink cameras when we (well, our phones) leave the house during the day.
Basically , if neither phone is connected to the network, then arm.
If someone is still at home (or comes home), then disarm.
I’m just wondering if there is a neater way than having four automations:
IF Phone1 is not_home, AND Phone 2 is not_home between 0516-2259, ARM.
IF Phone2 is not_home, AND Phone 1 is not_home between 0516-2259, ARM.
IF Phone1 IS home between 0516-2259, DISARM.
IF Phone2 IS home between 0516-2259, DISARM.
alias: Day Blink1
description: “Phone1 Arm”
trigger:
platform: state
entity_id:
device_tracker.phone1
from: home
to: not_home
condition:
The following automation will arm the alarm panel when the last person leaves but only if the time is between 5:16 and 22:59.
alias: example
trigger:
- platform: state
entity_id:
- device_tracker.phone1
- device_tracker.phone2
from: 'home'
to: 'not_home'
condition:
- condition: state
entity_id: device_tracker.phone1
state: 'not_home'
- condition: state
entity_id: device_tracker.phone2
state: 'not_home'
- condition: time
after: '05:16:00'
before: '22:59:00'
action:
- service: alarm_control_panel.alarm_arm_away
target:
entity_id: alarm_control_panel.blink_bean
You can create a second automation, very similar to the one above, to disarm the system. Just reverse the from/to values in the State Trigger, change the state of the State Conditions to ‘home’ and logically OR them (because either person arriving should be sufficient cause to disarm), and change the service call to alarm_control_panel.alarm_disarm.
Yep, just like that. So you’ve got device_tracker.phone1 and device_tracker.phone2 in both Trigger and Condition. That makes much better sense, thanks.
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.
I was just making sure it was working in the correct order and that it still worked with extra devices - such as turning off lights and down heating - which it does, so that’s great.