alias: Doorbell
description: ''
triggers:
- type: turned_on
device_id: [DEVICE ID]
entity_id: [ENTITY ID]
domain: binary_sensor
trigger: device
conditions: []
actions:
- action: reolink.play_chime
data:
device_id:[DEVICE ID]
ringtone: citybird
- target:
entity_id: [ENTITY ID]
data:
rgb_color:
- 255
- 0
- 0
brightness: 255
action: light.turn_on
- variables:
base_dir: /config/www/camera_snapshots/doorbell
ts: '{{ now().strftime(''%Y-%m-%d_%H-%M-%S'') }}'
ts_filename: '{{ base_dir }}/{{ ts }}.jpg'
last_file: '{{ base_dir }}/last.jpg'
ts_url: /local/camera_snapshots/doorbell/{{ ts }}.jpg
- data:
filename: '{{ ts_filename }}'
target:
device_id: [DEVICE ID]
action: camera.snapshot
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- action: shell_command.copy_image_last
data:
src: '{{ ts_filename }}'
dst: '{{ last_file }}'
- data:
message: Er staat iemand aan de deur
data:
image: '{{ ts_url }}'
notification_icon: mdi:mailbox-up-outline
title: Deurbel
action: notify.mobile_app_sm_s901b
- delay:
hours: 0
minutes: 0
seconds: 11
milliseconds: 0
- target:
entity_id: [ENTITY ID]
action: light.turn_off
data: {}
mode: single