Р

Size: a a a
Р
ДЦ
ДЦ
Р
Р
ДЦ
ДЦ
AS
AS
O
A
O
A
A
folder_watcher:
- folder: /tmp
patterns:
- '*.mp4'
A
A
- alias: Capture outdoor movement video
initial_state: 'on'
hide_entity: true
trigger:
- platform: state
entity_id:
- binary_sensor.saturn_nvr_line_crossing_1
- binary_sensor.saturn_nvr_line_crossing_2
- binary_sensor.saturn_nvr_line_crossing_3
- binary_sensor.saturn_nvr_line_crossing_4
- binary_sensor.saturn_nvr_line_crossing_5
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: input_boolean.outdoor_motion_notify_video
state: 'on'
action:
- service: camera.record
data_template:
entity_id: "camera.{{ {
'1' : 'side_passage',
'2' : 'kitchen_side',
'3' : 'porch_roof',
'4' : 'kitchen_roof',
'5' : 'back_garden'
}[trigger.entity_id[-1]] }}"
filename: "/tmp/capture_saturn_{{ as_timestamp(now()) | int }}_{{ trigger.entity_id[-1] }}.mp4"
lookback: 5
duration: 15
- alias: Send outdoor movement video via Telegram
initial_state: 'on'
hide_entity: true
trigger:
platform: event
event_type: folder_watcher
event_data:
event_type: created
condition:
- condition: template
value_template: "{{ trigger.event.data.file.startswith('capture_saturn_') }}"
action:
- service: telegram_bot.send_video
data_template:
target:
- !secret telegram_chat_id_alexey
- !secret telegram_chat_id_marina
file: "{{ trigger.event.data.path }}"
caption: "Movement in {{ state_attr('binary_sensor.saturn_nvr_line_crossing_' + trigger.event.data.file[-5:-4], 'friendly_name') }}"
A
A
НВ
G