-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.yaml
executable file
·327 lines (302 loc) · 10.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
homeassistant:
customize: !include customize.yaml
# Configures various services: updater, cloud, webhooks etc.
# https://www.home-assistant.io/integrations/default_config/
default_config:
frontend:
themes: !include_dir_merge_named themes
ios:
browser_mod:
http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
recorder:
db_url: !secret db_connection
purge_keep_days: 30
sensor: # All sensors with multiple states
- platform: openerz
zip: 8048
waste_type: cargotram, etram, organic, textile
- platform: rest
name: Migros Fitnesspark Puls 5
resource: https://www.fitnesspark.ch/wp/wp-admin/admin-ajax.php?action=single_park_update_visitors&location_id=29&location_name=FP_Puls5
verify_ssl: false
unit_of_measurement: "people"
- platform: rest
name: Flussbad Au-Höngg
resource: https://baditicker.herokuapp.com
device_class: temperature
verify_ssl: false
value_template: "{{ value_json.pools[0].temperature }}"
unit_of_measurement: "C°"
json_attributes_path: $.pools[0]
json_attributes:
- name
- updatedAt
- open
- platform: rest
name: Seebad Utoquai
resource: https://baditicker.herokuapp.com
device_class: temperature
verify_ssl: false
value_template: "{{ value_json.pools[14].temperature }}"
unit_of_measurement: "C°"
json_attributes_path: $.pools[14]
json_attributes:
- name
- updatedAt
- open
- platform: rest
name: Tumbler Power
resource: http://192.168.178.160/report
device_class: power
value_template: "{{ value_json.power }}"
- platform: rest
name: Washing Machine Power
resource: http://192.168.178.52/report
device_class: power
value_template: "{{ value_json.power }}"
- platform: rest
name: Dishwasher Power
resource: http://192.168.178.39/report
device_class: power
value_template: "{{ value_json.power }}"
- platform: rest
name: Office Power
resource: http://192.168.178.37/report
device_class: power
value_template: "{{ value_json.power }}"
- platform: rest
name: TV Utilities Power
resource: http://192.168.178.40/report
device_class: power
value_template: "{{ value_json.power }}"
sensor power: !include config/power-measurement-sensors.yaml
binary_sensor: # All sensors with just two states (ON/OFF)
- platform: template
sensors:
washingmachine_state:
friendly_name: "Washing Machine State"
delay_on:
minutes: 3
delay_off: # Only switches states after new state existed for x minutes
minutes: 3
icon_template: mdi:washing-machine
value_template: "{{ states('sensor.washing_machine_power') | default(0) |float > 10}}"
tumbler_state:
friendly_name: "Tumbler State"
delay_on:
minutes: 3
delay_off: # Only switches states after new state existed for x minutes
minutes: 3
icon_template: mdi:washing-machine
value_template: "{{ states('sensor.tumbler_power') | default(0) |float > 10}}"
dishwasher_state:
friendly_name: "Dishwasher State"
delay_off: # Only switches states after new state existed for x minutes
minutes: 3
icon_template: mdi:dishwasher
value_template: "{{ states('sensor.dishwasher_power') | default(0) |float > 10}}"
entrance_logi_motion:
friendly_name: "Entrance Motion"
device_class: motion
value_template: "{{ is_state('input_boolean.homekit_entrance_logi_motion_relay', 'on') }}"
livingroom_logi_motion:
friendly_name: "Living Room Motion"
device_class: motion
value_template: "{{ is_state('input_boolean.homekit_livingroom_logi_motion_relay', 'on') }}"
apartment_occupancy:
friendly_name: "Apartment Occupancy"
delay_on:
minutes: 5
delay_off:
minutes: 3
device_class: occupancy
value_template: "{{ is_state('person.theo_winter', 'home') }}"
intrusion_detection:
friendly_name: "Intrusion Detection"
device_class: motion
value_template: "{{ is_state('input_boolean.intrusion_detection_sensor_switch', 'on') }}"
bed_state:
friendly_name: Bed
device_class: occupancy
icon_template: mdi:bed-empty
value_template: "{{ is_state('input_boolean.bed_occupied_input', 'on') }}"
light:
- platform: switch
name: Loggia Fairy Lights
entity_id: switch.loggia_fairy_lights
light groups: !include config/light-groups.yaml
ifttt:
key: !secret ifttt_key
cloud:
switch:
- platform: wake_on_lan
mac: !secret omen_pc_mac_address
name: Omen Gaming PC
host: !secret omen_pc_ip_address
- platform: template
switches:
samsung_tv:
friendly_name: TV
value_template: "{{ is_state('binary_sensor.samsung_tv', 'on') }}"
turn_on:
event: ACTION_TV_STATE_CHANGE
event_data_template:
tv_action: "tv_on"
turn_off:
event: ACTION_TV_STATE_CHANGE
event_data_template:
tv_action: "tv_off"
icon_template: >-
{% if is_state('binary_sensor.samsung_tv', 'on') %}
mdi:television
{% else %}
mdi:television-off
{% endif %}
vacuum_control: #Used for frontend vacuum button (on/off/settings)
friendly_name: Vacuum Control
value_template: "{{ is_state('vacuum.roborock_s7', 'cleaning') }}"
turn_on:
service: vacuum.start
entity_id: vacuum.roborock_s7
turn_off:
service: vacuum.return_to_base
entity_id: vacuum.roborock_s7
music_control:
friendly_name: Music Control
value_template: "{{ is_state('media_player.everywhere', 'playing') }}"
icon_template: mdi:music
turn_on:
service: spotcast.start
data:
entity_id: media_player.everywhere
uri: 'spotify:playlist:440DwvrtJWWM3v0AgRSRNx'
shuffle: true
turn_off:
service: media_player.turn_off
entity_id: media_player.everywhere
input_boolean:
play_energy_zurich_everywhere:
name: Energy Zürich (everyhwere)
initial: off
homekit_entrance_logi_motion_relay: # Logi Camera Motion Sensor
name: Logi Entrance Motion Sensor Relay
initial: off
homekit_livingroom_logi_motion_relay: # Logi Camera Motion Sensor
name: Logi Living Room Motion Sensor Relay
initial: off
alarm_clock_enabled:
name: Alarm Clock
icon: mdi:alarm
bed_occupied_input:
name: Bed Occupied Input
initial: off
icon: mdi:bed-empty
input_datetime:
work_week_alarm:
name: Work Alarm
has_date: false
has_time: true
weekend_alarm:
name: Weekend Alarm
has_date: false
has_time: true
telegram_bot:
- platform: broadcast
api_key: !secret telegram_api_token
allowed_chat_ids:
- !secret telegram_chat_id
utility_meter:
daily_energy:
source: sensor.apartment_energy_consumption
cycle: daily
tariffs:
- peak
- offpeak
logi_circle:
client_id: !secret logi_client_id
client_secret: !secret logi_client_secret
api_key: !secret logi_api_key
redirect_uri: !secret logi_redirect_url
yahoofinance:
symbols:
- VOO
- VXUS
- AVUV
- RKLB
- CHFUSD=X
notify:
- name: notify_all
platform: group
services:
- service: mobile_app_theos_iphone_11
template:
- trigger:
- platform: time_pattern
seconds: "/1"
sensor:
- name: "Lifetime"
unit_of_measurement: "%"
state: >
{% set birthdate = state_attr("sensor.theo_details", "birthdate") | as_datetime %}
{% set deathdate = birthdate + timedelta(state_attr("sensor.theo_details", "life_expectancy")*365) %}
{% set totalLifeInDays = (deathdate - birthdate).days %}
{% set lifetime = deathdate - now() %}
{% set lifetimeInDays = lifetime.days %}
{% set lifetimeInSeconds = lifetimeInDays*24*60*60+lifetime.seconds %}
{% set percentageOfLifeUsed = ((totalLifeInDays - lifetimeInDays) / totalLifeInDays * 100) | round(1) %}
{{percentageOfLifeUsed}}
attributes:
deathdate: >
{% set birthdate = state_attr("sensor.theo_details", "birthdate") | as_datetime %}
{% set deathdate = birthdate + timedelta(state_attr("sensor.theo_details", "life_expectancy")*365) %}
{{deathdate}}
totalLifeInDays: >
{% set birthdate = state_attr("sensor.theo_details", "birthdate") | as_datetime %}
{% set deathdate = birthdate + timedelta(state_attr("sensor.theo_details", "life_expectancy")*365) %}
{% set totalLifeInDays = (deathdate - birthdate).days %}
{{totalLifeInDays}}
remainingLifeInDays: >
{% set birthdate = state_attr("sensor.theo_details", "birthdate") | as_datetime %}
{% set deathdate = birthdate + timedelta(state_attr("sensor.theo_details", "life_expectancy")*365) %}
{% set totalLifeInDays = (deathdate - birthdate).days %}
{% set lifetime = deathdate - now() %}
{% set lifetimeInDays = lifetime.days %}
{{lifetimeInDays}}
remainingLifeInSeconds: >
{% set birthdate = state_attr("sensor.theo_details", "birthdate") | as_datetime %}
{% set deathdate = birthdate + timedelta(state_attr("sensor.theo_details", "life_expectancy")*365) %}
{% set totalLifeInDays = (deathdate - birthdate).days %}
{% set lifetime = deathdate - now() %}
{% set lifetimeInDays = lifetime.days %}
{% set lifetimeInSeconds = lifetimeInDays*24*60*60+lifetime.seconds %}
{{lifetimeInSeconds}}
- sensor:
- name: "Sun Daylight"
unit_of_measurement: "h"
state: >
{% set nr = as_timestamp(state_attr('sun.sun','next_rising')) %}
{% set ns = as_timestamp(state_attr('sun.sun','next_setting')) %}
{% if nr > ns %}
{% set nr = nr - 60*60*24 %}
{% endif %}
{{ (ns - nr) / (60*60) }}
- name: "theo_details"
state: alive
attributes:
birthdate: !secret theo_birthday
life_expectancy: "{{85 | int}}" # Based on average swiss life expectancy, to be updated if research changes
# HACS integration: https://github.com/fondberg/spotcast
spotcast:
sp_dc: !secret spotcast_dc
sp_key: !secret spotcast_key
knx: !include config/knx.yaml
media_player: !include config/media_player.yaml
homekit: !include config/homekit.yaml
camera: !include config/camera.yaml
influxdb: !include config/influx-db.yaml
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml