Below is my automation. Problem is when I use “choose”. No trigger seems appropriate. But can’t find better solution.
alias: frigate-notify-on-livingroom-tv
description: frigate-notify-on-livingroom-tv
trigger:
- platform: state
entity_id: binary_sensor.door_bell
to: "on"
id: doorbell-notify-tv
- platform: state
entity_id:
- binary_sensor.porch_person_occupancy
id: porch-notify-tv
to: "on"
from: "off"
- platform: state
entity_id:
- binary_sensor.driveway_person_occupancy
id: driveway-notify-tv
to: "on"
from: "off"
- platform: state
entity_id:
- binary_sensor.east_person_occupancy
id: east-notify-tv
to: "on"
from: "off"
- platform: state
entity_id:
- binary_sensor.west_person_occupancy
id: west-notify-tv
to: "on"
from: "off"
condition:
- condition: and
conditions:
- condition: state
entity_id: sun.sun
state: below_horizon
- condition: state
entity_id: binary_sensor.all_doors
state: "off"
for:
hours: 0
minutes: 5
seconds: 0
action:
- choose:
- conditions:
- condition: trigger
id: doorbell-notify-tv
sequence:
- service: notify.living_room_tv
data:
message: >-
'Someone Pressed The DoorBell! at "{{states('sensor.time')}}"
triggered by "{{ trigger.entity_id }}"!'
- service: persistent_notification.create
data:
title: The Doorbell was pressed.
message: >-
'Someone Pressed The DoorBell! at "{{states('sensor.time')}}" on
"{{now().strftime("%D")}}". Triggered by "{{ trigger.entity_id
}}"!'
notification_id: "{{ trigger.entity_id }}"
- service: notify.steve_and_stacie_mobile_app
data:
message: Someone Pressed the Doorbell!
data:
image: /api/camera_proxy/camera.porch
actions:
- action: "{{ action_toggle }}"
title: Trigger Siren
- action: "{{ action_ignore }}"
title: Ignore
- action: URI
title: Open Camera
uri: entityId:camera.porch
- choose:
- conditions: []
sequence:
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_toggle }}"
id: action-toggle
timeout:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
continue_on_timeout: false
- service: script.toogle_sirens
data: {}
default:
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_ignore }}"
id: action-ignore
timeout:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
continue_on_timeout: true
- stop: ignored
- conditions:
- condition: trigger
id: porch-notify-tv
sequence:
- service: notify.living_room_tv
data:
message: >-
'At "{{states('sensor.time')}}" A Person was Detected by "{{
trigger.entity_id }}"!'
- service: persistent_notification.create
data:
title: Person detected on camera.
message: >-
'At "{{states('sensor.time')}}" on "{{now().strftime("%D")}}", A
Person was Detected by "{{ trigger.entity_id }}"!'
notification_id: "{{ trigger.entity_id }}"
- service: notify.steve_and_stacie_mobile_app
data:
message: Someone on Porch!
data:
image: /api/camera_proxy/camera.porch
actions:
- action: "{{ action_toggle }}"
title: Trigger Siren
- action: "{{ action_ignore }}"
title: Ignore
- action: URI
title: Open Camera
uri: entityId:camera.porch
- choose:
- conditions: []
sequence:
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_toggle }}"
id: action-toggle
timeout:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
continue_on_timeout: false
- service: script.toogle_sirens
data: {}
default:
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_ignore }}"
id: action-ignore
timeout:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
continue_on_timeout: true
- stop: ignored
- conditions:
- condition: trigger
id: driveway-notify-tv
sequence:
- service: notify.living_room_tv
data:
message: >-
'At "{{states('sensor.time')}}" A Person was Detected by "{{
trigger.entity_id }}"!'
- service: persistent_notification.create
data:
title: Person detected on camera.
message: >-
'At "{{states('sensor.time')}}" on "{{now().strftime("%D")}}", A
Person was Detected by "{{ trigger.entity_id }}"!'
notification_id: "{{ trigger.entity_id }}"
- service: notify.steve_and_stacie_mobile_app
data:
message: Someone is in the Driveway!
data:
image: /api/camera_proxy/camera.driveway
actions:
- action: "{{ action_toggle }}"
title: Trigger Siren
- action: "{{ action_ignore }}"
title: Ignore
- action: URI
title: Open Camera
uri: entityId:camera.driveway
- choose:
- conditions: []
sequence:
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_toggle }}"
id: action-toggle
timeout:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
continue_on_timeout: false
- service: script.toogle_sirens
data: {}
default:
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_ignore }}"
id: action-ignore
timeout:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
continue_on_timeout: true
- stop: ignored
- conditions:
- condition: trigger
id: east-notify-tv
sequence:
- service: notify.living_room_tv
data:
message: >-
'At "{{states('sensor.time')}}" A Person was Detected by "{{
trigger.entity_id }}"!'
- service: persistent_notification.create
data:
title: Person detected on camera.
message: >-
'At "{{states('sensor.time')}}" on "{{now().strftime("%D")}}", A
Person was Detected by "{{ trigger.entity_id }}"!'
notification_id: "{{ trigger.entity_id }}"
- service: notify.steve_and_stacie_mobile_app
data:
message: Someone is on Camera!
data:
image: /api/camera_proxy/camera.east
actions:
- action: "{{ action_toggle }}"
title: Trigger Siren
- action: "{{ action_ignore }}"
title: Ignore
- action: URI
title: Open Camera
uri: entityId:camera.east
- choose:
- conditions: []
sequence:
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_toggle }}"
id: action-toggle
timeout:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
continue_on_timeout: false
- service: script.toogle_sirens
data: {}
default:
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_ignore }}"
id: action-ignore
timeout:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
continue_on_timeout: true
- stop: ignored
- conditions:
- condition: trigger
id: west-notify-tv
sequence:
- service: notify.living_room_tv
data:
message: >-
'At "{{states('sensor.time')}}" A Person was Detected by "{{
trigger.entity_id }}"!'
- service: persistent_notification.create
data:
title: Person detected on camera.
message: >-
'At "{{states('sensor.time')}}" on "{{now().strftime("%D")}}", A
Person was Detected by "{{ trigger.entity_id }}"!'
notification_id: "{{ trigger.entity_id }}"
- service: notify.steve_and_stacie_mobile_app
data:
message: Someone is on Camera!
data:
image: /api/camera_proxy/camera.west
actions:
- action: "{{ action_toggle }}"
title: Trigger Siren
- action: "{{ action_ignore }}"
title: Ignore
- action: URI
title: Open Camera
uri: entityId:camera.west
- choose:
- conditions: []
sequence:
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_toggle }}"
id: action-toggle
timeout:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
continue_on_timeout: false
- service: script.toogle_sirens
data: {}
default:
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_ignore }}"
id: action-ignore
timeout:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
continue_on_timeout: true
- stop: ignored
default:
- service: notify.living_room_tv
data:
message: >-
'"{{ trigger.entity_id }}" Triggered this notification! at
"{{states('sensor.time')}}"!'
- service: persistent_notification.create
data:
title: Person in yard or doorbell pressed at "{{states('sensor.time')}}"
message: >-
'"{{ trigger.entity_id }}" Triggered this notification! at
"{{states('sensor.time')}}" on "{{now().strftime("%D")}}"!'
notification_id: "{{ trigger.entity_id }}"
- service: notify.steve_and_stacie_mobile_app
data:
message: Someone is outside!
data:
image: /api/camera_proxy/camera.porch
actions:
- action: "{{ action_toggle }}"
title: Trigger Siren
- action: "{{ action_ignore }}"
title: Ignore
- action: URI
title: Open Camera
uri: entityId:camera.porch
- choose:
- conditions: []
sequence:
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_toggle }}"
id: action-toggle
timeout:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
continue_on_timeout: false
- service: script.toogle_sirens
data: {}
default:
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_ignore }}"
id: action-ignore
timeout:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
continue_on_timeout: true
- stop: ignored
variables:
action_toggle: "{{ 'TOGGLE_' ~ context }}"
action_ignore: "{{ 'IGNORE_' ~ context }}"
mode: restart