add a switcht in your configuration.yaml
switch:
platform: rfxtrx
automatic_add: True
devices:
0b1100d001487be201040f70:
name: Deurbel
fire_event: True
add this in the customize section:
switch.deurbel:
friendly_name: 'Deurbel'
icon: mdi:bell-ring
assumed_state: false
example automation:
alias: Doorbell pressed
trigger:
- platform: event
event_type: button_pressed
event_data: {"entity_id": "switch.deurbel"}
action:
service: notify.telegram_koen
data:
title: Doorbell pressed!
message: Doorbell pressed!
data:
photo:
- url: http://10.0.1.35:88/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=xxx&pwd=xxx
caption: 'Doorbell pressed'
trigger different sound on chime when a door opens:
add a input boolean:
input_boolean:
notify_doors:
name: Notify when doors open
initial: off
icon: mdi:alert-circle-outline
add a second switch for the alert sound
(my chime supports up to six different remotes)
0b1100d001500be201040f70:
name: Waarschuwing
fire_event: True
add this to your customize section:
switch.waarschuwing:
friendly_name: 'Waarschuwing'
icon: mdi:bell-ring
assumed_state: false
add this automation:
alias: Notify when doors open
trigger:
platform: state
entity_id: group.deuren
from: 'off'
to: 'on'
condition:
condition: state
entity_id: input_boolean.notify_doors
state: 'on'
action:
- service: notify.telegram_koen
data:
title: ''
message: Deur open!
- service: homeassistant.turn_on
entity_id: switch.waarschuwing
- delay: 0:10
- service: homeassistant.turn_off
entity_id: switch.waarschuwing
note: i have my automations in separate files and include the whole directory in the configuration.yaml so my indentations won’t work in a standard configuration.yaml (i think).