-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathevent_camera.yaml
90 lines (82 loc) · 2.82 KB
/
event_camera.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
event_camera:
template:
- binary_sensor:
- name: cam_reolink411_auto_cast
state: >
{{ is_state('binary_sensor.reolink_411_ws_motion', 'on')
and is_state('binary_sensor.night_time', 'off')
}}
delay_off:
minutes: 1
automation:
- alias: cam_reolink411_cast
id: cam_reolink411_cast
initial_state: true
trigger:
## Aqara Opple на столе
- platform: state
entity_id: sensor.0x54ef4410004c1707_action
to: 'button_4_triple'
condition:
- condition: state
entity_id: switch.control_mode
state: 'on'
action:
- choose:
- conditions:
- condition: state
entity_id: media_player.nesthub7a33
state: 'off'
sequence:
- service: camera.play_stream
data:
media_player: media_player.nesthub7a33
target:
entity_id: camera.reolink_411_ws_sub
- conditions:
- condition: state
entity_id: media_player.nesthub7a33
state: 'playing'
sequence:
- service: media_player.turn_off
target:
entity_id: media_player.nesthub7a33
- alias: cam_reolink411_cast_motion
id: cam_reolink411_cast_motion
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.cam_reolink411_auto_cast
from: 'off'
to: 'on'
- platform: state
entity_id: binary_sensor.cam_reolink411_auto_cast
from: 'on'
to: 'off'
condition:
- condition: state
entity_id: switch.control_mode
state: 'on'
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.cam_reolink411_auto_cast
state: 'on'
- condition: state
entity_id: media_player.nesthub7a33
state: 'off'
sequence:
- service: camera.play_stream
data:
media_player: media_player.nesthub7a33
target:
entity_id: camera.reolink_411_ws_sub
- conditions:
- condition: state
entity_id: binary_sensor.cam_reolink411_auto_cast
state: 'off'
sequence:
- service: media_player.turn_off
target:
entity_id: media_player.nesthub7a33