Hi,
I wish to create a button or switch on my dashboard, to enable/disable an automation who is an active an “alarm mode”.
My automation send me notification if my cameras detect movement or if my windows detector receives open state.
alias: Alarm
description: Alarme
trigger:
- platform: device
device_id: 149b2799b5d82a300c5601165b9a2ce3
domain: select
entity_id: ce1d019c9d7a9853ebc8a197baf214c8
type: current_option_changed
from: Not Recording
to: Motion Record
- platform: device
type: changed_states
device_id: 6f103c1b1a43d909ba4d1b7ac02c5915
entity_id: c348971f284a1488f429242ac2e4eb4b
domain: switch
- type: opened
platform: device
device_id: db00d9e1535e6533dade812e8e0e2bc1
entity_id: d13149d5c0a13d70ff1b34d07bc1c38d
domain: binary_sensor
condition: []
action:
- choose:
- conditions:
- condition: device
device_id: 149b2799b5d82a300c5601165b9a2ce3
domain: select
entity_id: ce1d019c9d7a9853ebc8a197baf214c8
type: selected_option
option: Motion Record
sequence:
- service: telegram_bot.send_message
metadata: {}
data:
message: Un mouvement a été détecté sur la caméra intérieure.
title: Alerte mouvement intérieur!
- conditions:
- condition: device
type: is_on
device_id: 6f103c1b1a43d909ba4d1b7ac02c5915
entity_id: c348971f284a1488f429242ac2e4eb4b
domain: switch
sequence:
- service: telegram_bot.send_message
metadata: {}
data:
message: Un mouvement a été détecté dehors.
title: Alerte mouvement extérieur!
- conditions:
- type: is_open
condition: device
device_id: db00d9e1535e6533dade812e8e0e2bc1
entity_id: d13149d5c0a13d70ff1b34d07bc1c38d
domain: binary_sensor
sequence:
- service: telegram_bot.send_message
metadata: {}
data:
message: La baie vitrée a été ouverte.
title: Alerte baie vitrée ouverte!
mode: single
Then either your card is not changing the slider properly, or you’ve not re-loaded the automations. If that input boolean is on, the action block will not be reached when the automation is triggered.
If you run the automation manually (rather than by a trigger) then only the action section is executed. That is expected behaviour.
Is it always better to use a condition instead of disabling an Automation? So for example of you have a summer and winter automation check on summer/ winter to determine which should run?
alias: Alarm
description: Alarme
trigger:
- platform: device
device_id: 149b2799b5d82a300c5601165b9a2ce3
domain: select
entity_id: ce1d019c9d7a9853ebc8a197baf214c8
type: current_option_changed
from: Not Recording
to: Motion Record
- platform: device
type: turned_on
device_id: 6f103c1b1a43d909ba4d1b7ac02c5915
entity_id: d7da3ff4c10714c4dd42650161ff93d2
domain: switch
- type: opened
platform: device
device_id: db00d9e1535e6533dade812e8e0e2bc1
entity_id: d13149d5c0a13d70ff1b34d07bc1c38d
domain: binary_sensor
condition:
- condition: state
entity_id: input_boolean.alarm_override
state: "on"
action:
- choose:
- conditions:
- condition: device
device_id: 149b2799b5d82a300c5601165b9a2ce3
domain: select
entity_id: ce1d019c9d7a9853ebc8a197baf214c8
type: selected_option
option: Motion Record
sequence:
- service: telegram_bot.send_message
metadata: {}
data:
message: Un mouvement a été détecté sur la caméra intérieure.
title: Alerte mouvement intérieur!
- conditions:
- condition: device
type: is_on
device_id: 6f103c1b1a43d909ba4d1b7ac02c5915
entity_id: c348971f284a1488f429242ac2e4eb4b
domain: switch
sequence:
- service: telegram_bot.send_message
metadata: {}
data:
message: Un mouvement a été détecté dehors.
title: Alerte mouvement extérieur!
photo:
file: >-
/api/camera_proxy/camera.r4252_smart_outdoor_camera?token=93d768ac5b2bdbe75d3754e1267043cddabff79db77a93f97eb9036c4b6b0149
caption: Photo
- conditions:
- type: is_open
condition: device
device_id: db00d9e1535e6533dade812e8e0e2bc1
entity_id: d13149d5c0a13d70ff1b34d07bc1c38d
domain: binary_sensor
sequence:
- service: telegram_bot.send_message
metadata: {}
data:
message: La baie vitrée a été ouverte.
title: Alerte baie vitrée ouverte!
mode: single
Now, need to test if the three trigger work well (when motion is detected on camera 1, or when motion is detected on camera 2, or when window is open).
And after that, to succeed install and configure frigate to capture camera picture and send to telegram.