forked from matt8707/hass-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui-lovelace.yaml
executable file
·311 lines (291 loc) · 10.5 KB
/
ui-lovelace.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
button_card_templates: !include_dir_merge_named button_card_templates
views:
- type: custom:grid-layout
title: Home
layout:
#default
margin: 0
grid-gap: var(--custom-layout-card-padding)
grid-template-columns: repeat(4, 1fr) 0
grid-template-rows: 0 repeat(2, fit-content(100%)) 0fr
grid-template-areas: |
"sidebar . . . ."
"sidebar dining_room living_room office ."
"sidebar bedroom . . ."
"sidebar footer footer footer ."
mediaquery:
#phone
"(max-width: 800px)":
grid-gap: calc(var(--custom-layout-card-padding) * 1.7)
grid-template-columns: 0 repeat(2, 1fr) 0
grid-template-rows: 0 repeat(5, fit-content(100%)) 0fr
grid-template-areas: |
". . . ."
". sidebar sidebar ."
". dining_room living_room ."
". office bedroom ."
". footer footer ."
". . . ."
#portrait
"(max-width: 1200px)":
grid-gap: var(--custom-layout-card-padding)
grid-template-columns: repeat(3, 1fr) 0
grid-template-rows: 0 repeat(3, fit-content(100%)) 0fr
grid-template-areas: |
"sidebar . . ."
"sidebar dining_room living_room ."
"sidebar office bedroom ."
"sidebar footer footer ."
"sidebar . . ."
cards:
#extra_styles fix, do not remove
#also warn if theme is not set
- type: custom:button-card
view_layout:
grid-area: 1 / 2 / 2 / 5
name: SET THEME TO "tablet" IN PROFILE
tap_action:
action: navigate
navigation_path: /profile
styles:
card:
- display: >
[[[
return hass.themes.theme === 'tablet'
? 'none'
: 'initial';
]]]
name:
- z-index: 1
- overflow: visible
- color: red
- font-weight: bolder
- font-size: xxx-large
- background: yellow
#################################################
# #
# SIDEBAR #
# #
#################################################
- type: vertical-stack
view_layout:
grid-area: sidebar
cards:
- type: custom:button-card
entity: sensor.template_sidebar
template: sidebar
#################################################
# #
# LIVING ROOM #
# #
#################################################
- type: grid
title: Living Room
view_layout:
grid-area: living_room
columns: 2
cards:
- type: custom:button-card
entity: climate.living_room_ac
name: AC
double_tap_action: !include popup/living_room_ac.yaml
template:
- base
- icon_climate
- circle
variables:
circle_input: >
[[[
if (entity) {
return entity.state === 'cool'
? Math.round(entity.attributes.temperature).toString()
: Math.round(entity.attributes.current_temperature).toString();
}
]]]
circle_input_unit: "°C"
- type: custom:button-card
entity: media_player.shield
name: Tv
state_display: >
[[[
if (variables.state === 'playing') {
return 'On';
}
if (variables.state === true) {
return variables.translate_unknown;
}
]]]
double_tap_action: !include popup/living_room_tv.yaml
template:
- base
- icon_tv
- loader
#################################################
# #
# DINING ROOM #
# #
#################################################
- type: grid
title: Dining Room
view_layout:
grid-area: dining_room
columns: 2
cards:
- type: custom:button-card
entity: vacuum.vacuum
name: Vacuum
tap_action:
action: call-service
service: script.toggle_vacuum
template:
- base
- icon_vacuum
- loader
- type: custom:button-card
entity: climate.dining_room_ac
name: AC
double_tap_action: !include popup/dining_room_ac.yaml
template:
- base
- icon_climate
- circle
variables:
circle_input: >
[[[
if (entity) {
return entity.state === 'cool'
? Math.round(entity.attributes.temperature).toString()
: Math.round(entity.attributes.current_temperature).toString();
}
]]]
circle_input_unit: "°C"
- type: custom:button-card
entity: lock.front_door
name: Front Door
double_tap_action: !include popup/front_door.yaml
template:
- base
- icon_closet
- loader
### Office
- type: grid
title: Office
view_layout:
grid-area: office
columns: 2
cards:
- type: custom:button-card
name: AC
tap_action:
action: call-service
service: remote.send_command
service_data:
device: office_ac
command: "power"
entity_id: remote.office_remote
template:
- base
- icon_climate
#################################################
# #
# Bedroom #
# #
#################################################
- type: grid
title: Bedroom
view_layout:
grid-area: bedroom
columns: 2
cards:
- type: custom:button-card
entity: cover.bedroom_curtain
name: Curtain
tap_action: !include popup/bedroom_curtain.yaml
double_tap_action: !include popup/bedroom_curtain.yaml
template:
- base
- icon_curtain
- loader
#################################################
# #
# FOOTER #
# #
#################################################
- type: horizontal-stack
view_layout:
grid-area: footer
cards:
- type: custom:button-card
name: >
<ha-icon icon="mdi:nas"></ha-icon> NAS
tap_action: !include popup/footer_nas.yaml
triggers_update:
- binary_sensor.nas_update_available
- sensor.nas_volume_1_status
- binary_sensor.nas_security_status
- sensor.disk_use_percent
variables:
notify: >
[[[
let id = this._config.triggers_update;
if (id.every(e => states[e]))
return states[id[0]].state === 'on'
? 1
: states[id[1]].state === 'background_scrubbing' ||
states[id[2]].state === 'on' ||
parseFloat(states[id[3]].state) >= 85;
]]]
template: footer
- type: custom:button-card
name: >
<ha-icon icon="mdi:arrow-up-bold-circle-outline"></ha-icon> Updates
tap_action: !include popup/footer_updates.yaml
triggers_update:
- sensor.hacs
- sensor.docker_hub_beta
- sensor.docker_hub
variables:
notify: >
[[[
let id = this._config.triggers_update;
if (id.every(e => states[e])) {
let hacs = parseInt(states[id[0]].state),
installed = hass.config.version,
latest = installed.includes('b')
? states[id[1]].state
: states[id[2]].state;
if (latest.includes('.') && Number.isInteger(hacs))
return hacs + (installed !== latest ? 1 : 0);
}
return 0;
]]]
template: footer
- type: custom:button-card
name: >
<ha-icon icon="mdi:robot-vacuum-variant"></ha-icon> Vacuum
tap_action: !include popup/footer_vacuum.yaml
triggers_update:
- sensor.date
variables:
notify: >
[[[
let id = states['sensor.morty_last_clean_end'];
if (id) return (Date.now() - Date.parse(id.state)) > 6048e5;
]]]
template: footer
- type: custom:button-card
name: >
<ha-icon icon="mdi:router-wireless"></ha-icon> Router
tap_action: !include popup/footer_router.yaml
triggers_update:
- binary_sensor.template_udm_internet
variables:
notify: >
[[[
let id = this._config.triggers_update;
if (id.every(e => states[e]))
return states[id[0]].state === 'on'
? 1
: states[id[1]].state === 'off';
]]]
template: footer