SM
Size: a a a
SM
Р
SM
Р
SP
G
SM
ДН
G
M
A
AS
Р
AK
AK
AK
AS
A
camera.record
можно использовать data_template и делать подобное:A
- alias: Neptune capture outdoor movement video
initial_state: 'on'
hide_entity: true
trigger:
- platform: state
entity_id:
- binary_sensor.neptune_nvr_line_crossing_1
- binary_sensor.neptune_nvr_line_crossing_2
- binary_sensor.neptune_nvr_line_crossing_3
- binary_sensor.neptune_nvr_line_crossing_4
- binary_sensor.neptune_nvr_line_crossing_5
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: input_boolean.neptune_motion_notify
state: 'off'
action:
- service: camera.record
data_template:
entity_id: "camera.{{ {
'1' : 'neptune_front_left',
'2' : 'neptune_front_right',
'3' : 'neptune_back_garden',
'4' : 'neptune_patio',
'5' : 'neptune_side_passage'
}[trigger.entity_id[-1]] }}"
filename: "/tmp/{{ trigger.entity_id }}.mp4"
lookback: 5
duration: 15
- service: telegram_bot.send_video
data_template:
target:
- !secret telegram_chat_id_alexey
file: "/tmp/{{ trigger.entity_id }}.mp4"
caption: "Movement in {{ trigger.to_state.attributes.friendly_name }}"