-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfiguration.yaml
462 lines (438 loc) · 14.8 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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
###################################################
# Home Assistant Main Configuration File #
###################################################
homeassistant:
# Name of the location where Home Assistant is running
name: Cesson-Sévigné
# Location required to calculate the time the sun rises and sets
latitude: !secret homeLatitude
longitude: !secret homeLongitude
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 47
# metric for Metric, imperial for Imperial
unit_system: metric
# Pick yours from here:
# http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: Europe/Paris
# Country
country: FR
# Customization file
customize: !include customize.yaml
# allowlist_external_dirs: #TODO: reaad external dirs
# - !secret externalDirShare
# - !secret externalDirTmp
# - !secret externalDirDafang
external_url: !secret base_url
internal_url: !secret internal_url
auth_providers:
- type: trusted_networks
trusted_networks:
- 127.0.0.1
- 192.168.0.0/24 #TODO: secret?
- 192.168.1.0/24
- 192.168.86.0/24
- 192.168.86.100
# - 216.98.48.0/20 # All Ubisoft
allow_bypass_login: true
- type: homeassistant
# - type: legacy_api_password
# api_password: !secret http_password
# https://www.home-assistant.io/docs/configuration/splitting_configuration/
# https://www.home-assistant.io/docs/configuration/packages/
# Splitted between integrations and entites as https://github.com/jonathanadams/Home-Assistant-Configuration
packages: !include_dir_named integrations
# things in default config that should be moved in integrations/
bluetooth:
dhcp:
energy:
hardware:
homeassistant_alerts:
media_source:
my:
ssdp:
usb:
zeroconf:
####################################################
# Sensors and components #
####################################################
binary_sensor:
- platform: template
sensors:
people_home:
friendly_name: "People Home"
device_class: presence
value_template: >
{{ is_state('person.guillaume', 'home') or is_state('person.claire', 'home') }}
- platform: threshold
name: "TV is in use"
device_class: presence
entity_id: sensor.tv_active_power
upper: 75
- platform: threshold
name: "Are Auroras potentially visible?"
entity_id: sensor.aurora_visibility_aurora_visibility
upper: 1
# Example configuration entry
template:
- trigger:
- platform: state
entity_id: sensor.bleuette_ev_battery_level
sensor:
- name: "Bleuette autonomie max"
unique_id: bleuette_max_autonomy
unit_of_measurement: km
state_class: measurement
state: >
{{ (states('sensor.bleuette_ev_range') | float / states('sensor.bleuette_ev_battery_level') | float * 100 ) | int }}
- trigger:
- platform: time
at:
- "00:00"
- "00:05"
- "06:20"
- "06:25"
- "22:20"
- "22:25"
- platform: time_pattern
minutes: 30
- platform: time_pattern
minutes: 0
binary_sensor:
- name: "Heure creuse"
unique_id: heure_creuse
state: >
{% if now().hour >= 23 or now().hour < 6 %}
true
{% elif now().hour == 22 and now().minute >= 20 %}
true
{% elif now().hour == 22 and now().minute < 20 %}
false
{% else %}
false
{% endif %}
- trigger:
- platform: state
entity_id: sensor.edf_tempo_prix_actuel
sensor:
- name: "Electricity price"
unique_id: electricity_price
unit_of_measurement: EUR/kWh
state_class: measurement
state: >
{{ (states('sensor.edf_tempo_prix_actuel') | float / 100) | round(4) }}
- trigger:
- platform: webhook
webhook_id: googleDesktop-giom1
allowed_methods:
- POST
- PUT
local_only: true
sensor:
- name: "Google Desktop"
unique_id: google_desktop
state: "{{trigger.json.state}}"
icon: mdi:eye-lock-open-outline
# Pollens from Tomorrow.io (copied from https://community.home-assistant.io/t/uk-and-worldwide-pollen-count-using-tomorrow-io-api/306560)
- sensor:
- name: Pollen - Grass
unique_id: sensor.pollen_grass
state: "{{ states('sensor.pollen_grass_index_day_0') }}"
icon: "mdi:grass"
attributes:
Today: "{{ states('sensor.pollen_grass_index_day_0') }}"
Tomorrow: "{{ states('sensor.pollen_grass_index_day_1') }}"
Today + 2: "{{ states('sensor.pollen_grass_index_day_2') }}"
Today + 3: "{{ states('sensor.pollen_grass_index_day_3') }}"
Today + 4: "{{ states('sensor.pollen_grass_index_day_4') }}"
- name: Pollen - Tree
unique_id: sensor.pollen_tree
state: "{{ state_attr('sensor.pollen_grass_index_day_0', 'treeIndex') }}"
icon: "mdi:tree"
attributes:
Today: "{{ state_attr('sensor.pollen_grass_index_day_0', 'treeIndex') }}"
Tomorrow: "{{ state_attr('sensor.pollen_grass_index_day_1', 'treeIndex') }}"
Today + 2: "{{ state_attr('sensor.pollen_grass_index_day_2', 'treeIndex') }}"
Today + 3: "{{ state_attr('sensor.pollen_grass_index_day_3', 'treeIndex') }}"
Today + 4: "{{ state_attr('sensor.pollen_grass_index_day_4', 'treeIndex') }}"
- name: Pollen - Weed
unique_id: sensor.pollen_weed
state: "{{ state_attr('sensor.pollen_grass_index_day_0', 'weedIndex') }}"
icon: "mdi:spa"
attributes:
Today: "{{ state_attr('sensor.pollen_grass_index_day_0', 'weedIndex') }}"
Tomorrow: "{{ state_attr('sensor.pollen_grass_index_day_1', 'weedIndex') }}"
Today + 2: "{{ state_attr('sensor.pollen_grass_index_day_2', 'weedIndex') }}"
Today + 3: "{{ state_attr('sensor.pollen_grass_index_day_3', 'weedIndex') }}"
Today + 4: "{{ state_attr('sensor.pollen_grass_index_day_4', 'weedIndex') }}"
# Pollens from Tomorrow.io (copied from https://community.home-assistant.io/t/uk-and-worldwide-pollen-count-using-tomorrow-io-api/306560)
rest:
- resource: !secret tomorrow-api-pollen
scan_interval: 3600
sensor:
### Pollen - Tree Index
- name: "Pollen - Grass Index - Day 0"
value_template: "{{ value_json.data.timelines[0].intervals[0]['values']['grassIndex'] }}"
json_attributes_path: "$.data.timelines[0].intervals[0].values"
json_attributes:
- treeIndex
- weedIndex
- grassIndex
- grassGrassIndex
- weedRagweedIndex
- name: "Pollen - Grass Index - Day 1"
value_template: "{{ value_json.data.timelines[0].intervals[1]['values']['grassIndex'] }}"
json_attributes_path: "$.data.timelines[0].intervals[1].values"
json_attributes:
- treeIndex
- weedIndex
- grassIndex
- grassGrassIndex
- weedRagweedIndex
- name: "Pollen - Grass Index - Day 2"
value_template: "{{ value_json.data.timelines[0].intervals[2]['values']['grassIndex'] }}"
json_attributes_path: "$.data.timelines[0].intervals[2].values"
json_attributes:
- treeIndex
- weedIndex
- grassIndex
- grassGrassIndex
- weedRagweedIndex
- name: "Pollen - Grass Index - Day 3"
value_template: "{{ value_json.data.timelines[0].intervals[3]['values']['grassIndex'] }}"
json_attributes_path: "$.data.timelines[0].intervals[3].values"
json_attributes:
- treeIndex
- weedIndex
- grassIndex
- grassGrassIndex
- weedRagweedIndex
- name: "Pollen - Grass Index - Day 4"
value_template: "{{ value_json.data.timelines[0].intervals[4]['values']['grassIndex'] }}"
json_attributes_path: "$.data.timelines[0].intervals[4].values"
json_attributes:
- treeIndex
- weedIndex
- grassIndex
- grassGrassIndex
- weedRagweedIndex
- resource: !secret tomorrow-api-pollen-current
scan_interval: 600
sensor:
### Pollen - Tree Index
- name: "Pollen - Current"
value_template: "{{ value_json.data.timelines[0].intervals[0]['values']['grassIndex'] }}"
json_attributes_path: "$.data.timelines[0].intervals[0].values"
json_attributes:
- treeIndex
- weedIndex
- grassIndex
- grassGrassIndex
- weedRagweedIndextree
- AcaciaIndex
- treeAshIndex
- treeBeechIndex
- treeBirchIndex
- treeCedarIndex
- treeCypressIndex
- treeElderIndex
- treeElmIndex
- treeHemlockIndex
- treeHickoryIndex
- treeJuniperIndex
- treeMahoganyIndex
- treeMapleIndex
- treeMulberryIndex
- treeOakIndex
- treePineIndex
- treeCottonwoodIndex
- treeSpruceIndex
- treeSycamoreIndex
- treeWalnutIndex
- treeWillowIndex
# Yeelights
# yeelight:
# devices:
# 192.168.86.130:
# name: Solarium
# transition: 1000
# use_music_mode: False #(defaults to False)
# save_on_change: False #(defaults to True)
# 192.168.86.131:
# name: Color
# transition: 1000
# use_music_mode: True #(defaults to False)
# save_on_change: False #(defaults to True)
# 192.168.86.132:
# name: Freezer
# transition: 1000
# use_music_mode: False #(defaults to False)
# save_on_change: False #(defaults to True)
# 192.168.86.134:
# name: Canapé Droite
# transition: 1000
# use_music_mode: False #(defaults to False)
# save_on_change: False #(defaults to True)
# 192.168.86.135:
# name: Bedroom
# transition: 1000
# use_music_mode: False #(defaults to False)
# save_on_change: False #(defaults to True)
# 192.168.86.136:
# name: Canapé Gauche
# transition: 1000
# use_music_mode: False #(defaults to False)
# save_on_change: False #(defaults to True)
media_player:
# Google Cast
- platform: cast
#Emby
#- platform: emby
# host: !secret NAS_IP
# api_key: !secret emby_APIKey
device_tracker:
# Google Map location sharing
- platform: google_maps
username: !secret google_account
max_gps_accuracy: 1000
new_device_defaults:
track_new_devices: True
# - platform: nmap_tracker
# hosts: 192.168.86.100-109
# new_device_defaults:
# track_new_devices: True
# https://www.home-assistant.io/components/person/
# person:
# - name: Giom
# id: giom
# user_id: !secret giomUserId
# device_trackers:
# - device_tracker.google_maps_108886437999779306059
# - device_tracker.pixel_7_pro_8
# - device_tracker.mes_cles
# - device_tracker.portefeuille
# - name: Claire
# id: claire
# user_id: !secret claireUserId
# device_trackers:
# - device_tracker.google_maps_116551309970452496819
notify:
- platform: slack
name: Slack
api_key: !secret slack_APIKey
default_channel: "#hass"
- name: SMS
platform: free_mobile
username: !secret freeMobileUsername
access_token: !secret freeMobileToken
# panel_iframe:
# slack:
# title: "Slack"
# url: "https://gi-home.slack.com/unreads/"
# sonarr:
# title: "Sonarr"
# url: !secret sonarrUrl
# utorrent:
# title: "uTorrent"
# url: "https://remote.bittorrent.com/"
# weblink:
# entities:
# - name: Slack
# url: 'https://gi-home.slack.com/unreads/'
# - name: Sonarr
# url: !secret sonarrUrl
shell_command:
resize_sunrise_pic: mogrify -resize 1080x720 /home/homeassistant/.homeassistant/Share/last_sunrise.jpg
create_daily_gif: 'convert -delay 20 -limit area 0 -resize 25% -loop 0 {rpi_camera_{{ now().strftime("%Y%m%d") }}-*_night.jpg,rpi_camera_{{ now().strftime("%Y%m%d") }}-*_day.jpg} {{ now().strftime("%Y%m%d") }}.gif'
####################################################
# Zones #
####################################################
# https://www.home-assistant.io/components/zone/
zone:
- name: Université
latitude: !secret universityLatitude
longitude: !secret universityLongitude
radius: 250
icon: mdi:beaker
- name: Ubisoft
latitude: !secret ubisoftLatitude
longitude: !secret ubisoftLongitude
radius: 100
icon: mdi:gamepad-variant
- name: Google
latitude: !secret googleLatitude
longitude: !secret googleLongitude
radius: 100
icon: mdi:google
- name: École
latitude: !secret schoolLatitude
longitude: !secret schoolLongitude
radius: 100
icon: mdi:school
- name: Nozay
latitude: !secret nozayLatitude
longitude: !secret nozayLongitude
radius: 250
icon: mdi:home-modern
# This will override the default home zone
- name: Home
latitude: !secret homeLatitude
longitude: !secret homeLongitude
radius: 100
icon: mdi:home-circle
# temporarily disabling the google calendar integration to fix the rest
#google:
# client_id: !secret googleDeveloperClientID
# client_secret: !secret googleDeveloperSecret
#tplink:
# mqtt:
# broker: localhost
# discovery: true
# discovery_prefix: homeassistant
# password: !secret mqttPassword
# vacuum:
# - platform: xiaomi_miio
# host: !secret vaccumIP
# token: !secret roborockToken
light:
- platform: switch
name: Cuisine
entity_id: switch.lumiere_cuisine
- platform: dlight
host: 192.168.1.89
device_id: E5b18418
####################################################
# Work in progress #
####################################################
# rest:
# - resource: http://192.168.86.219:8249/state
# binary_sensor:
# - name: "In a meeting"
# value_template: "{{ value_json.in_meeting }}"
rest_command:
gchat:
url: !secret gchatWebhook
method: POST
content_type: "application/json; charset=utf-8"
verify_ssl: true
payload: '{"text": {{ text | to_json }}}'
gchatalert:
url: !secret gchatAlertWebhook
method: POST
content_type: "application/json; charset=utf-8"
verify_ssl: true
payload: '{"text": {{ text | to_json }}}'
# Tests
nanoleaf:
url: !secret nanoleafUrl
method: PUT
payload: >
{ "write" : {"command": "display", "animType": "static", "animData":
{%- set all = [ 3329, 26694, 35769, 64745, 22722, 0 ] %}
{%- set ns = namespace(panels=[panels | count | string]) %}
{%- for panel in panels %}
{%- set ns.panels = ns.panels + [ '{} 1 {} {} {} 0 20'.format(all[panel.number-1], panel.r, panel.g, panel.b) ] %}
{%- endfor %}
"{{ ns.panels | join(' ') }}",
"loop": false, "palette": [], "colorType": "HSB"}
}
content_type: "application/json"