forked from jlpouffier/home-assistant-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.yaml
More file actions
209 lines (209 loc) · 6.27 KB
/
scripts.yaml
File metadata and controls
209 lines (209 loc) · 6.27 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
reset_lights_day_area:
alias: Réinitialisation Lumières Coin Jour
sequence:
- service: hue.activate_scene
data:
transition: 2
target:
entity_id:
- scene.salon_salon_100
- scene.entree_entree_100
- scene.cuisine_cuisine_100
alias: ACTIVATE HUE SCENES ON SALON ENTREE AND CUISINE
mode: restart
icon: mdi:lightbulb-on
lights_set_tv:
alias: Réglage lumières lors que la TV joue un média
sequence:
- data:
transition: 2
service: light.turn_off
target:
entity_id:
- light.cuisine
- light.entree
alias: TURN OFF CUISINE ENTREE
- service: hue.activate_scene
data:
transition: 2
target:
entity_id: scene.salon_salon_tv_playing
alias: ACTIVATE HUE SCENE ON SALON
mode: restart
icon: mdi:lightbulb-on-20
lights_set_tv_paused:
alias: Réglage lumières lors que la TV est en pause
sequence:
- service: hue.activate_scene
data:
transition: 2
target:
entity_id:
- scene.cuisine_cuisine_tv_paused
- scene.entree_entree_tv_paused
- scene.salon_salon_tv_paused
alias: ACTIVATE HUE SCENE ON SALON ENTEE AND CUISINE
mode: restart
icon: mdi:lightbulb-on-50
leave_home:
alias: Quitter l'appartement
sequence:
- service: light.turn_off
data:
transition: 2
target:
entity_id:
- light.all_lights
- service: media_player.turn_off
target:
entity_id: media_player.philips_android_tv
data: {}
- service: media_player.turn_off
target:
entity_id: media_player.kef
data: {}
- service: switch.turn_off
target:
entity_id:
- switch.coffeemaker
data: {}
mode: single
icon: mdi:home-import-outline
turn_on_media_center:
alias: Turn On Media center
sequence:
- parallel:
- if:
- condition: state
entity_id: binary_sensor.is_tv_on
state: "off"
alias: IF TV OFF
then:
- if:
- condition: state
entity_id: media_player.philips_android_tv
state: unavailable
alias: IF TV UNAVAILABLE
then:
- service: wake_on_lan.send_magic_packet
data:
mac: 68:07:0A:4A:F5:AB
alias: WOL TV
- wait_for_trigger:
- platform: state
entity_id:
- media_player.philips_android_tv
not_to: unavailable
alias: WAIT UNTIL TV IS AVAILABLE
timeout:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
continue_on_timeout: true
alias: IF TV UNAVAILABLE THEN WOL TV
- service: media_player.turn_on
data: {}
target:
entity_id: media_player.philips_android_tv
alias: TURN TV ON
alias: IF TV OFF THEN TURN ON TV
- if:
- condition: state
entity_id: media_player.kef
state: "off"
alias: IF LSK OFF
then:
- service: media_player.turn_on
data: {}
target:
entity_id: media_player.kef
alias: TURN ON LSX
- wait_for_trigger:
- platform: state
entity_id:
- media_player.kef
not_to: "off"
timeout:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
continue_on_timeout: true
alias: WAIT FOR LSK TO TURN ON
- if:
- condition: not
conditions:
- condition: state
entity_id: media_player.kef
attribute: source
state: Opt
alias: LSK SOURCE OPT
alias: IF LSK SOURCE NOT OPT
then:
- service: media_player.select_source
data:
source: Opt
target:
entity_id: media_player.kef
alias: CHANGE LSK SOURCE TO OPT
alias: CHANGE LSK SOURCE
alias: IF LSX ARE OFF THEN TURN ON LSX
- if:
- condition: state
entity_id: media_player.kef
state: "on"
alias: IF LSK ON
- condition: not
conditions:
- condition: state
entity_id: media_player.kef
attribute: source
state: Opt
alias: LSK SOURCE OPT
alias: IF LSK SOURCE NOT OPT
then:
- service: media_player.select_source
data:
source: Opt
target:
entity_id: media_player.kef
alias: CHANGE LSK SOURCE TO OPT
alias: IF LSX ARE ON THEN CHANGE LSX SOURCE
alias: TURN ON TV AND LSX IN PARALLEL
mode: single
icon: mdi:television
turn_off_media_center:
alias: Turn Off Media center
sequence:
- parallel:
- if:
- condition: state
entity_id: binary_sensor.is_tv_on
state: "on"
alias: IF TV ON
then:
- service: media_player.turn_off
data: {}
target:
entity_id: media_player.philips_android_tv
alias: TURN TV OFF
alias: IF TV ON THEN TURN OFF TV
- if:
- condition: not
conditions:
- condition: state
entity_id: media_player.kef
state: "off"
alias: IF LSK OFF
alias: IF KEF NOT OFF
then:
- service: media_player.turn_off
data: {}
target:
entity_id: media_player.kef
alias: TURN OFF KEF
alias: IF LSK ON THEN TURN OFF LSX
alias: TURN OFF TV AND LSX IN PARALLEL
mode: single
icon: mdi:television-off