-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathda_speaker.yaml
More file actions
96 lines (84 loc) · 2.97 KB
/
da_speaker.yaml
File metadata and controls
96 lines (84 loc) · 2.97 KB
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
91
92
93
94
95
96
da_speaker:
template:
- binary_sensor:
# Сенсор определяющий недоступность WLED ленты
- name: da_speaker_night
unique_id: da_speaker_night
state: >
{{ is_state('media_player.mi_speaker', 'playing')
and is_state('binary_sensor.notification_time', 'off') }}
delay_on:
minutes: 1
automation:
- alias: da_reboot_speaker_auto_off
id: da_reboot_speaker_auto_off
description: Mi Speaker Night Auto off
initial_state: false
trigger:
- platform: state
entity_id: binary_sensor.da_speaker_night
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: switch.control_mode
state: 'on'
action:
- service: media_player.turn_off
target:
entity_id: media_player.mi_speaker
- alias: da_speaker_threat_notification
id: da_speaker_threat_notification
description: Детская А динамик - тревога
initial_state: false
trigger:
# Сборный сенсор тревоги
- platform: state
entity_id: binary_sensor.m_kiyiv_air
from: 'off'
to: 'on'
condition:
# Переключатель режима работы сервера
- condition: state
entity_id: switch.control_mode
state: 'on'
# Дневное время
- condition: state
entity_id: binary_sensor.night_time
state: 'off'
action:
- service: media_player.volume_set
data:
volume_level: 0.4
target:
entity_id: media_player.mi_speaker
- service: tts.reversotts_say
data:
cache: false
entity_id: media_player.mi_speaker
message: Воздушная тревога
- alias: da_speaker_threat_cancel
id: da_speaker_threat_cancel
description: Детская А динамик - отмена тревоги
initial_state: false
trigger:
# Сборный сенсор тревоги
- platform: state
entity_id: binary_sensor.m_kiyiv_air
from: 'on'
to: 'off'
condition:
# Переключатель режима работы сервера
- condition: state
entity_id: switch.control_mode
state: 'on'
# Дневное время
- condition: state
entity_id: binary_sensor.night_time
state: 'off'
action:
- service: tts.reversotts_say
data:
cache: false
entity_id: media_player.mi_speaker
message: Отмена воздушной тревоги