I have a person entity group set up to arm my alarm when everyone leaves the house. I added in a push notification to allow us to cancel that for 2 minutes, for example if we forgot and had a baby sitter or house cleaner at the house when we left. I have it working but it doesn’t seem like its the best approach. I did it by cancelling an automation with enable/disable. I could redo it to make my cancel event set a boolean and then check the boolean as a condition afterwards and let the automation finish. This is because I don’t see a clean stop automation service call.
Any have any thoughts?
- id: '1619986218414'
alias: Arm alarm when everyone is away
description: ''
trigger:
- platform: state
entity_id: group.family
to: not_home
condition:
- condition: state
entity_id: alarm_control_panel.alarm_panel
state: disarmed
action:
- service: notify.mobile_app_all_phone
data:
message: Everyone is gone, arming alarm away in 2 minutes
data:
ttl: 0
priority: high
actions:
- action: CANCELARMAWAY
title: Cancel
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- service: alarm_control_panel.alarm_arm_away
entity_id: alarm_control_panel.alarm_panel
data:
code: '1234'
mode: single
- id: '1620487950934'
alias: Cancel arm alarm away
description: ''
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: CANCELARMAWAY
condition: []
action:
- service: automation.turn_off
target:
entity_id: automation.arm_alarm_when_away
- service: automation.turn_on
target:
entity_id: automation.arm_alarm_when_away
- service: notify.mobile_app_all_phone
data:
message: Arm alarm away cancelled
data:
ttl: 0
priority: high
mode: single