I have an existing alert that sends me an actionable notification every X (defined) minutes when my garage door is open. I would like to enhance this by also “triggering” my VPE to start a conversation asking me if I want to close the garage door on the same schedule.
I cannot see any way to trigger an automation from an alert.
Here are my existing alert, notify and automation configs:
alert:
inner_garage_door:
name: Inner garage door open
message: "Door has been open for {{ relative_time(states.cover.garage_door_inner.last_changed) }}"
entity_id: cover.garage_door_inner
state: 'open'
repeat:
- 5
- 10
- 15
- 30
- 60
can_acknowledge: true
notifiers:
- inner_garage_door_open
notify:
- name: inner_garage_door_open
platform: group
services:
- service: mobile_app_shamuss_iphone
data:
title: 'Inner garage door open'
data:
tag: "inner_garage_door_open" # used for grouping
actions:
- title: "Close garage door"
action: "CLOSE_INNER_GARAGE_DOOR"
destructive: true
- title: "Cancel further alerts"
action: "CANCEL_INNER_GARAGE_DOOR_ALERT"
automation:
- alias: iOS app notification inner garage door
initial_state: True
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: CLOSE_INNER_GARAGE_DOOR
action:
service: cover.close_cover
data: {}
target:
entity_id: cover.garage_door_inner
- alias: iOS app cancel inner garage door alert
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: CANCEL_INNER_GARAGE_DOOR_ALERT
action:
service: alert.turn_off
target:
entity_id: alert.inner_garage_door
- alias: iOS app clear notification inner garage door
trigger:
- entity_id: cover.garage_door_inner
platform: state
to: 'closed'
action:
- service: notify.mobile_app_shamuss_iphone
data:
message: "clear_notification"
data:
tag: "inner_garage_door_open"