-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfloorplan.yaml
504 lines (500 loc) · 20.3 KB
/
floorplan.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
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
decluttering_templates: !include lovelace/decluttering_templates.yaml
apexcharts_card_templates: !include lovelace/apexcharts_card_templates.yaml
views:
- type: custom:grid-layout
layout:
grid-gap: var(--custom-layout-card-padding)
grid-template-columns: 32% auto
grid-template-areas: |
"sidebar floorplan"
badges: []
cards:
- type: horizontal-stack
view_layout:
grid-arena: floorplan
cards:
- type: custom:floorplan-card
card_mod:
style: |
ha-card {
max-width: 100%;
margin: 0 auto;
background: none;
border: none;
}
config:
image: /local/floorplan/House_2023_optimized.svg
stylesheet: /local/floorplan/House_2023.css
defaults:
tap_action: none
rules:
- name: Hőmérséklet
entities:
- sensor.haloszoba_temperature
- sensor.konyha_temperature
- sensor.nappali_temperature
- sensor.ebedlo_temperature
- sensor.gyerekszoba_temperature
- sensor.furdoszoba_homerseklet
state_action:
- service: floorplan.text_set
service_data: '${(entity.state !== undefined) ? Math.round(entity.state* 10) / 10 + "°C" : "unknown"}'
- name: Páratartalom
entities:
- sensor.haloszoba_humidity
- sensor.konyha_humidity
- sensor.nappali_humidity
- sensor.ebedlo_humidity
- sensor.gyerekszoba_humidity
- sensor.furdoszoba_paratartalom
state_action:
- service: floorplan.text_set
service_data: '${(entity.state !== undefined) ? Math.round(entity.state * 10) / 10 + "%" : "unknown"}'
- name: Entitások
entities:
- switch.sonoff_furdo_szelloztetes
- switch.sonoff_illatosito
- switch.sonoff_furdoszoba_futes
- media_player.samsung_q80_series_65
- fan.aroma_diffuser
- climate.gree_klima
state_action:
action: call-service
service: floorplan.class_set
service_data: entities entity-state-${entity.state}
- name: Ajtók
entities:
- binary_sensor.sonoff_bejarati_ajto
- binary_sensor.kamra_contact
- binary_sensor.wc_contact
state_action:
action: call-service
service: floorplan.class_set
service_data: motion door-${entity.state}
- name: Ablakok
entities:
- binary_sensor.haloszoba_ablak_contact
- binary_sensor.nappali_ablak_contact
- binary_sensor.gyerekszoba_ablak_contact
- binary_sensor.konyha_ablak_contact
- binary_sensor.furdoszoba_ablak_contact
state_action:
action: call-service
service: floorplan.class_set
service_data: motion window-${entity.state}
- name: Fények 1
entities:
- light.eloszoba_main
- light.furdo_main
- light.kamra_main
- light.kazan_main
- light.wc_main
- light.halo_main
- light.ebedlo_main
- light.szoba_main
- light.nappali_asztali_lampa
- light.aroma_diffuser_nightlight
state_action:
action: call-service
service: floorplan.class_set
service_data: light-${entity.state}
- name: Fények 2
entities:
- light.eloszoba_main
- light.furdo_main
- light.kamra_main
- light.kazan_main
- light.wc_main
- light.halo_main
- light.ebedlo_main
- light.szoba_main
- light.nappali_asztali_lampa
- light.aroma_diffuser_nightlight
tap_action:
action: toggle
state_action:
action: call-service
service: floorplan.style_set
service_data:
element: ${entity.entity_id.replace('light.', 'light_overlay.')}
style: |
>
if( entity.state !== "on" )
return "display: none;";
let hue = 0;
let sat = 0;
if( entity.attributes.hs_color ) {
hue = entity.attributes.hs_color[0];
sat = entity.attributes.hs_color[1];
}
if( sat < 10 ) {
return `
display: block;
filter:
brightness(calc( ${entity.attributes.brightness} / 255));`
}
return `
display: block;
filter:
sepia(100%)
hue-rotate(calc( ${hue}deg - 55deg ))
saturate(calc( ${sat}% * 2 ))
brightness(calc( ${entity.attributes.brightness} / 255));`
- name: Fények 3
entities:
- light.kamra_main
- light.wc_main
- light.nappali_asztali_lampa
hold_action: more-info
- name: Párásító
entity: fan.aroma_diffuser
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
style: &browser_mod
|
--popup-border-width: var(--ha-card-border-width);
--popup-border-radius: var(--ha-card-border-radius);
content:
type: custom:layout-card
layout_type: custom:grid-layout
cards:
- !include lovelace/parasitas.yaml
- name: Törölköző szárító
entity: switch.sonoff_furdoszoba_futes
tap_action: toggle
hold_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
style: *browser_mod
content:
type: custom:decluttering-card
template: mushroom_number_template
variables:
- entity: input_number.furdoszoba_futes
- name: Szellőztetés
entity: switch.sonoff_furdo_szelloztetes
tap_action: toggle
- name: Tv
entity: media_player.samsung_q80_series_65
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
style: *browser_mod
content:
type: vertical-stack
cards:
!include lovelace/tv.yaml
- name: Klíma
entity: climate.gree_klima
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
style: &browser_mod_1080
|
--popup-min-width: 1080px;
--popup-border-width: var(--ha-card-border-width);
--popup-border-radius: var(--ha-card-border-radius);
content:
type: custom:layout-card
layout_type: custom:grid-layout
cards:
- !include lovelace/klima.yaml
- !include lovelace/grafikon.yaml
- name: Tablet
entities:
- switch.hipad_xpro_kepernyo
- binary_sensor.hipad_xpro_csatlakoztatva
element: switch.hipad_xpro_kepernyo
state_action:
action: call-service
service: floorplan.class_set
service_data: |
>
let classes = [];
if (entities['binary_sensor.hipad_xpro_csatlakoztatva'].state === 'on')
classes.push('charging charge-state-on');
else
classes.push('charging charge-state-off')
if (entities['switch.hipad_xpro_kepernyo'].state === 'on')
classes.push('entities entity-state-on');
else
classes.push('entities entity-state-off');
return classes.join(' ');
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
style: *browser_mod_1080
content:
!include lovelace/tablet.yaml
- name: Fűtés
entity: climate.honeywell_home_termosztat
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
style: *browser_mod
content:
type: custom:layout-card
layout_type: custom:grid-layout
cards:
- !include lovelace/futes.yaml
- !include lovelace/grafikon.yaml
hold_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
style: *browser_mod
content:
type: custom:layout-card
layout_type: custom:grid-layout
cards:
- !include lovelace/schedule.yaml
state_action:
action: call-service
service: floorplan.class_set
service_data: entities entity-state-${entity.attributes.hvac_action}
- type: custom:mod-card
card_mod:
style: |
:host {
transform: translate( 0, 0 );
top: calc( var(--header-height) + 10px );
right: 350px;
position: absolute;
width: 175px;
}
card:
type: horizontal-stack
cards:
- type: custom:decluttering-card
template: person_template
variables:
- entity_person: person.hunyadvari_zoltan
- background_url: /local/person/zoolesz.png
- icon_person: mdi:face-man
- entity_wifi: sensor.sm_a536b_wifi_connection
- find_service: notify.mobile_app_sm_a536b
- entity_battery: sensor.sm_a536b_battery_level
- entity_device: device_tracker.sm_a536b
- type: custom:decluttering-card
template: person_template
variables:
- entity_person: person.szakacs_katalin
- background_url: /local/person/kata.png
- icon_person: mdi:face-woman
- entity_wifi: sensor.sm_a336b_wifi_connection
- find_service: notify.mobile_app_sm_a336b
- entity_battery: sensor.sm_a336b_battery_level
- entity_device: device_tracker.sm_a336b
- type: custom:mod-card
card_mod:
style: |
:host {
transform: translate( 0, 0 );
top: 310px;
right: 655px;
position: absolute;
width: 75px;
}
card:
type: vertical-stack
cards:
- type: custom:mushroom-template-card
card_mod: &background_none
style: |
ha-card {
background: none;
box-shadow: none;
border: none;
}
primary: ''
secondary: ''
icon: mdi:information-outline
layout: vertical
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
style: *browser_mod_1080
content:
type: custom:layout-card
layout_type: custom:grid-layout
layout:
grid-template-columns: 25% 25% 25% 25%
grid-template-rows: auto
grid-template-areas: |
"HA Debian Network Tablet"
"Grafikon Grafikon Grafikon Grafikon"
cards:
!include lovelace/system2.yaml
- type: custom:mushroom-template-card
card_mod: *background_none
primary: ''
secondary: ''
icon: mdi:robot-vacuum
layout: vertical
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
style: *browser_mod
content:
type: vertical-stack
cards:
!include lovelace/vacuum.yaml
- type: custom:mushroom-template-card
card_mod:
style: |
ha-card {
box-shadow: none;
background: none;
border: none;
}
ha-state-icon:after {
{% if states('plant.new_zealand_spinach') == "problem" %}
content: "{{ states('sensor.noveny_problema') }}";
{% endif %}
background: rgb(var(--rgb-red-color));
color: var(--card-background-color);
position: absolute;
display: flex;
justify-content: center;
align-items: center;
font-weight: bolder;
border-radius: 50%;
top: -5px;
right: -5px;
width: 18px;
height: 18px;
font-size: 8px;
}
primary: ''
secondary: ''
icon: mdi:leaf
icon_color: |
{% if states(entity) == 'problem' %}
var(--rgb-red-color)
{% else %}
var(--rgb-green-color)
{% endif %}
layout: vertical
entity: plant.new_zealand_spinach
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
style: *browser_mod
content:
type: vertical-stack
cards:
!include lovelace/novenyek.yaml
- type: custom:mushroom-template-card
card_mod: *background_none
primary: ''
secondary: ''
icon: mdi:pine-tree
layout: vertical
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
style: *browser_mod_1080
content:
type: vertical-stack
cards:
!include lovelace/karacsony.yaml
- type: custom:mushroom-template-card
card_mod:
style: |
ha-card {
box-shadow: none;
background: none;
border: none;
}
ha-state-icon:after {
{% if states('sensor.devices_with_low_battery') | int > 0 %}
content: "{{ states('sensor.devices_with_low_battery') }}";
{% endif %}
background: rgb(var(--rgb-red-color));
color: var(--card-background-color);
position: absolute;
display: flex;
justify-content: center;
align-items: center;
font-weight: bolder;
border-radius: 50%;
top: -5px;
right: -5px;
width: 18px;
height: 18px;
font-size: 8px;
}
primary: ''
secondary: ''
icon: mdi:battery-alert
icon_color: |
{% if states(entity) | int > 0 %}
var(--rgb-red-color)
{% endif %}
entity: sensor.devices_with_low_battery
layout: vertical
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
style: *browser_mod
content:
!include lovelace/battery.yaml
hold_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
style: *browser_mod
content:
type: custom:mushroom-number-card
tap_action: none
hold_action: none
doubletap_action: none
entity: input_number.battery_threshold
double_tap_action: none
- type: custom:popup-card
entity: light.kamra_main
card:
type: custom:decluttering-card
template: mushroom_light_template
variables:
- entity: light.kamra_main
- type: custom:popup-card
entity: light.wc_main
card:
type: custom:decluttering-card
template: mushroom_light_template
variables:
- entity: light.wc_main
- type: custom:popup-card
entity: light.nappali_asztali_lampa
card:
type: custom:decluttering-card
template: mushroom_light_template
variables:
- entity: light.nappali_asztali_lampa
- !include lovelace/sidebar.yaml