forked from avenger11/Apple-HomePlay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.yaml
397 lines (326 loc) · 13.3 KB
/
configuration.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
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# Loads default set of integrations. Do not remove.
default_config:
# +----------------------------------------------------------------------------+
# | Setting for the dashboard |
# +----------------------------------------------------------------------------+
lovelace:
dashboards:
lovelace-homeplay:
mode: yaml
filename: homeplay.yaml
title: HomePlay
icon: phu:homekit
show_in_sidebar: true
home-os:
mode: yaml
filename: HomeOS.yaml
title: HomeOS
icon: phu:homekit
show_in_sidebar: true
# +----------------------------------------------------------------------------+
# | Definition for the theme folder and file |
# +----------------------------------------------------------------------------+
frontend:
themes:
light: !include_dir_merge_named themes/HomeOS/light/
dark: !include_dir_merge_named themes/HomeOS/dark/
# +----------------------------------------------------------------------------+
# | Definition for extra module |
# +----------------------------------------------------------------------------+
extra_module_url:
- /local/community/custom-brand-icons/custom-brand-icons.js #Add new icon from elax46, use phu:
- /local/community/kiosk-mode/kiosk-mode.js
- /local/fonts.css
- /local/lovelace-card-mod/card-mod.js # Performance improvement called as fronted instead of lovelace resource
# Text to speech
tts:
- platform: google_translate
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
homekit: !include homekit.yaml
homeassistant:
packages: !include_dir_named packages
customize: !include customize.yaml
allowlist_external_dirs:
- /config
##############################################
# UI Librairies
##############################################
panel_iframe:
zigbeebasement:
title: "Zigbee Basement"
url: "http://192.168.0.20:8081"
icon: mdi:zigbee
##############################################
# Group
##############################################
group:
persons:
name: family
entities:
- person.sebastien_logeais
- person.lynn
hass_update_notification:
name: Home assistant Update
entities:
- update.home_assistant_core_update
- update.home_assistant_operating_system_update
- update.home_assistant_supervisor_update
router_update_notification:
name: Velop Mesh Wifi Notification
entities:
- update.bureau_update
- update.salon_update
- update.sous_sol_update
all_light:
name: All light (switch and Light)
entities:
- light.dimmerlivingroom
- light.dreamview_t1
- light.floodlight_kitchen
- light.grouplightkitchencounter
- light.groupspotlightkitchen
- light.groupspotlightkitchensink
- light.kitchen_leds
- light.lampe_salle_de_bain
- light.stairs_lights
- light.ambientlightbedroomclara_lightbulb
- light.wiz_rgbw_tunable_6261a4
- switch.switch_basement
- switch.switchexterieurback_switch
- switch.switchexteriorfront
- switch.smartplugclara
- switch.switchvestibule_switch
##############################################
# BINARY SENSOR
##############################################
binary_sensor:
- platform: tod
name: 7-9AM
after: "7:00"
before: "9:00"
sensor:
- platform: seventeentrack
username: !secret seventeentrack_username
password: !secret seventeentrack_password
# Documentation
# https://developpeurs.stm.info/documentation/gtfsrtv2
# https://github.com/zacs/ha-gtfs-rt/issues/22
- platform: gtfs_rt
trip_update_url: "https://api.stm.info/pub/od/gtfs-rt/ic/v2/tripUpdates"
vehicle_position_url: "https://api.stm.info/pub/od/gtfs-rt/ic/v2/vehiclePositions"
apikey: !secret gtfs_rt_apikey
departures:
- name: "191 Bus Est"
route: 191
stopid: 57237
- name: "491 Express Est"
route: 491
stopid: 57244
- platform: time_date
display_options:
- "time"
- "date"
- "time_date"
- platform: sun2
monitored_conditions:
- sun_phase
##########
# FILTER #
##########
- platform: filter
name: "Filter_feel_like_temperature"
entity_id: sensor.montreal_wind_chill
filters:
- filter: outlier
window_size: 4
radius: 4.0
- filter: lowpass
time_constant: 5
precision: 2
# Determine the min and max humidity in the house
- platform: min_max
name: humidity_min
type: min
entity_ids:
- sensor.temperaturesensor_masterbedroom_humidity
- sensor.temperaturesensor_basement_humidity
- sensor.temperaturesensor_clara_humidity
- platform: min_max
name: humidity_max
type: max
entity_ids:
- sensor.temperaturesensor_masterbedroom_humidity
- sensor.temperaturesensor_basement_humidity
- sensor.temperaturesensor_clara_humidity
#######################################################################################
## Templates (Used for updating text in the UI and converting sensors to CSS values )
#######################################################################################
- platform: template
sensors:
##################################################################################
### TOP BAR TEMPLATE #############################################################
##################################################################################
climate_temp:
value_template: "{{ state_attr('climate.entryway','current_temperature') | round(0)}}°"
climate_text:
value_template: >
{% if is_state_attr('climate.entryway', 'hvac_action', 'heating') %}
Chauffe à {{ state_attr('climate.entryway','target_temp_low') | round(1) }}°
{% elif is_state_attr('climate.entryway', 'hvac_action', 'cooling') %}
Refroidi à {{ state_attr('climate.entryway','target_temp_high') | round(1) }}°
{% else %}
{{ state_attr('climate.entryway','target_temp_low') | round(1) }} - {{ state_attr('climate.entryway','target_temp_high') | round(1) }}°
{% endif %}
humidity_min_max:
value_template: "{{ states('sensor.humidity_min') | round(0) }} - {{ states('sensor.humidity_max') | round(0) }} %"
## Find the Min and max temperature in the house
## Do not forget to add new temperature sensor to these math
temperature_min:
value_template: >
{{ [
states('sensor.entryway_temperature'),
states('sensor.temperaturesensor_basement_temperature'),
states('sensor.temperaturesensor_clara_temperature'),
states('sensor.temperaturesensor_masterbedroom_temperature')
] | min
}}
temperature_max:
value_template: >
{{ [
states('sensor.entryway_temperature'),
states('sensor.temperaturesensor_basement_temperature'),
states('sensor.temperaturesensor_clara_temperature'),
states('sensor.temperaturesensor_masterbedroom_temperature')
] | max
}}
temperature_min_max:
value_template: "{{ states('sensor.temperature_min') | round(1) }} - {{ states('sensor.temperature_max') | round(1) }}°"
lights_on_count:
friendly_name: "Lights on count"
value_template: "{{ expand('group.all_light') | selectattr('state','eq','on') | list | count }} lumières allumées"
battery_min_max:
value_template: >
{{ states.sensor
| selectattr('attributes.device_class', 'defined')
| selectattr('attributes.device_class', 'eq', 'battery')
| map(attribute='state')
| map('int', 0)
| list | min
}} -
{{ states.sensor
| selectattr('attributes.device_class', 'defined')
| selectattr('attributes.device_class', 'eq', 'battery')
| map(attribute='state')
| map('int', -1)
| list | max
}}%
##################################################################################
### TASKBAR TEMPLATE #############################################################
##################################################################################
## Converts time and date into sentence for UI
day:
value_template: >
{{["Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"][now().weekday()]}}
month:
value_template: >
{% set months = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"] %}
{{ strptime(states('sensor.date'), '%Y-%m-%d').day }}
{{ months[now().month-1] }}
date_string:
friendly_name: "Full Date"
value_template: "{{ states('sensor.day') }} {{ states('sensor.month') }}"
##################################################################################
### WEATHER CARD TEMPLATE ########################################################
##################################################################################
### feel like temperature
# Based on template sensor from https://www.home-assistant.io/integrations/environment_canada/
feel_like:
value_template: >
{% if not is_state('sensor.montreal_humidex', 'unknown') %}
{{ states('sensor.montreal_humidex') | round(0) }}°
{% elif not is_state('sensor.montreal_wind_chill', 'unknown') %}
{{ states('sensor.montreal_wind_chill') | round(0) }}°
{% else %}
{{ states('sensor.montreal_temperature') | round(0) }}°
{% endif %}
### High and low temperature
high_low_temp:
value_template: >
↑ {{ states('sensor.montreal_high_temperature') }}° ↓ {{ states('sensor.montreal_low_temperature') }}°
### Warning template
weather_warning:
value_template: >
{% if is_state('sensor.montreal_warnings', '0') %}
off
{% else %}
on
{% endif %}
weather_warning_statement_1:
value_template: >
{{ state_attr('sensor.montreal_warnings','alert_1')|capitalize }}
weather_bg_condition2:
value_template: >
{% if is_state('input_select.hass_theme_selected','light') %}
{{ states('sensor.montreal_icon_code') | round(0) }}
{% elif is_state('input_select.hass_theme_selected','dark') %}
{{ states('sensor.montreal_icon_code') | round(0) + 100 }}
{% endif %}
##################################################################################
### OTHERS TEMPLATE ##############################################################
##################################################################################
humidity_masterbedroom:
value_template: >
{{ states('sensor.temperaturesensor_masterbedroom_humidity') | round(0) }}%
temperature_delta: # if delta temp more than a certain value start fan to balance temperature
value_template: >
{{ '%.3f' | format (states('sensor.temperature_max') | float -
states('sensor.temperature_min') | float) }}
climate_hvac_action:
value_template: >
{{state_attr('climate.entryway','hvac_action')}}
climate_fan_mode:
value_template: >
{{state_attr('climate.entryway','fan_mode')}}
garbage_weekday:
value_template: >
{{as_timestamp(states.schedule.garbage.attributes.next_event) | timestamp_custom('%A',false) }}
recycling_weekday:
value_template: >
{{as_timestamp(states.schedule.recycling.attributes.next_event) | timestamp_custom('%A',false) }}
################################################################################
### SEPARATED SWITCH FOR CLIMATE ###############################################
################################################################################
switch:
- platform: template
switches:
climate_fan:
friendly_name: "Ventilateur"
value_template: "{{ is_state_attr('climate.entryway', 'fan_mode', 'on') }}"
turn_on:
service: climate.set_fan_mode
data:
entity_id: climate.entryway
fan_mode: "on"
turn_off:
service: climate.set_fan_mode
data:
entity_id: climate.entryway
fan_mode: "off"
climate_eco_mode:
friendly_name: "Eco Mode"
value_template: "{{ is_state_attr('climate.entryway', 'preset_mode', 'eco') }}"
turn_on:
service: climate.set_preset_mode
data:
entity_id: climate.entryway
preset_mode: "eco"
turn_off:
service: climate.set_preset_mode
data:
entity_id: climate.entryway
preset_mode: "none"
################################################################################
### GARBAGE ####################################################################
################################################################################