-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathsmart-clock.yaml
More file actions
619 lines (616 loc) Β· 36.4 KB
/
smart-clock.yaml
File metadata and controls
619 lines (616 loc) Β· 36.4 KB
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
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Description:
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Smart clock radio dashboard designed for viewing on 8" tablet, optimized for
# 1004x628 screen# resolutions. Functionality include:
#
# 1) Large digital clock display
# 2) Set alarm timer
# 3) Play music
# 5) View and control alarm system
# 5) View weather information
#
# Appearance may by different on other screen resolutions.
#
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Custom components required:
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Kiosk-mode: https://github.com/maykar/kiosk-mode
# Browser-mod: https://github.com/thomasloven/hass-browser_mod
# Custom button card: https://github.com/custom-cards/button-card
# Swipe card: https://github.com/bramkragten/swipe-card
# Spotify card: https://github.com/custom-cards/spotify-card
# Mini media-player: https://github.com/kalkih/mini-media-player
################################################################################
### Kiosk mode - hide default HA header ###
################################################################################
kiosk_mode:
hide_header: true
views:
- icon: mdi:radio
title: Clockradio
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Render dashboard in full-width. See more in HA documentation:
# https://www.home-assistant.io/lovelace/dashboards-and-views#panel
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
panel: true
cards:
- type: vertical-stack
cards:
######################################################################
### ROW #1: MAIN CONTENT ###
######################################################################
- type: horizontal-stack
cards:
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Swipe between clock, music and weather infor
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- type: custom:swipe-card
reset_after: 30
cards:
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Digital clock
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- type: "custom:button-card"
color_type: card
entity: sensor.local_time
show_state: true
show_name: false
show_icon: false
show_label: false
styles:
card:
- background-color: var(--card-background-color)
- color: var(--primary-foreground-color)
- border: 5px solid var(--card-background-color)
- font-size: 255pt
tap_action:
action: none
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Set timer
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- type: vertical-stack
cards:
- type: horizontal-stack
cards:
### Add hours
- type: "custom:button-card"
color_type: card
icon: mdi:chevron-up-circle
styles:
card:
- background-color: var(--card-background-color)
- color: var(--primary-foreground-color)
- border: 5px solid var(--card-background-color)
- height: 90px
tap_action:
action: call-service
service: input_datetime.set_datetime
service_data:
entity_id: input_datetime.alarm_anders
time: '[[[var newtime = new Date("1970-01-01 " + states["input_datetime.alarm_anders"].state);newtime.setTime(newtime.getTime()+60*60*1000);return newtime.toLocaleTimeString("da-DA").replaceAll(".",":");]]]'
### Add minutes
- type: "custom:button-card"
color_type: card
icon: mdi:chevron-up-circle
styles:
card:
- background-color: var(--card-background-color)
- color: var(--primary-foreground-color)
- border: 5px solid var(--card-background-color)
- height: 90px
tap_action:
action: call-service
service: input_datetime.set_datetime
service_data:
entity_id: input_datetime.alarm_anders
time: '[[[var newtime = new Date("1970-01-01 " + states["input_datetime.alarm_anders"].state);newtime.setTime(newtime.getTime()+60*1000);return newtime.toLocaleTimeString("da-DA").replaceAll(".",":");]]]'
### Current alarm time
- type: "custom:button-card"
color_type: card
name: '[[[var newtime = new Date("1970-01-01 " + states["input_datetime.alarm_anders"].state);newtime.setTime(newtime.getTime());return newtime.toLocaleTimeString("da-DA").replaceAll(".",":").replace(":00","");]]]'
show_state: false
show_name: true
show_icon: false
show_label: false
styles:
card:
- background-color: var(--card-background-color)
- color: var(--primary-foreground-color)
- border: 5px solid var(--card-background-color)
- font-size: 150pt
- height: 200px
- type: horizontal-stack
cards:
### Minus one hour
- type: "custom:button-card"
color_type: card
icon: mdi:chevron-down-circle
styles:
card:
- background-color: var(--card-background-color)
- color: var(--primary-foreground-color)
- border: 5px solid var(--card-background-color)
- height: 90px
tap_action:
action: call-service
service: input_datetime.set_datetime
service_data:
entity_id: input_datetime.alarm_anders
time: '[[[var newtime = new Date("1970-01-01 " + states["input_datetime.alarm_anders"].state);newtime.setTime(newtime.getTime()-60*60*1000);return newtime.toLocaleTimeString("da-DA").replaceAll(".",":");]]]'
### Minus one minute
- type: "custom:button-card"
color_type: card
icon: mdi:chevron-down-circle
styles:
card:
- background-color: var(--card-background-color)
- color: var(--primary-foreground-color)
- border: 5px solid var(--card-background-color)
- height: 90px
tap_action:
action: call-service
service: input_datetime.set_datetime
service_data:
entity_id: input_datetime.alarm_anders
time: '[[[var newtime = new Date("1970-01-01 " + states["input_datetime.alarm_anders"].state);newtime.setTime(newtime.getTime()-60*1000);return newtime.toLocaleTimeString("da-DA").replaceAll(".",":");]]]'
### Activate / Deactive alarm
- type: "custom:button-card"
color_type: card
name: Indstil alarm
entity: input_boolean.anders_alarm_active
show_state: false
show_name: true
show_icon: false
show_label: false
state:
- value: "on"
name: "Deaktiver vækning"
- value: "off"
name: "Indstil vækning"
styles:
card:
- background-color: var(--card-background-color)
- color: var(--primary-foreground-color)
- border: 5px solid var(--card-background-color)
- font-size: 30pt
- height: 60px
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Music control
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- type: horizontal-stack
cards:
- type: vertical-stack
cards:
### Music source selection
- type: "custom:button-card"
color_type: card
show_state: false
show_name: true
styles:
grid:
- grid-template-areas: "'i n'"
- grid-template-columns: 20% min-content
- grid-template-rows: min-content min-content min-content
- font-size: 20pt
card:
- background-color: var(--card-background-color)
- color: var(--primary-foreground-color)
- border-radius: 5px
- height: 67px
icon:
- margin: none
entity: input_select.music_source_type
state:
- value: "spotify_playlist"
name: Spotify - Afspilningslister
icon: mdi:spotify
- value: "spotify_featured"
icon: mdi:spotify
name: Spotify - Featured
- value: "radio"
icon: mdi:radio
name: Radiokanaler
tap_action:
action: call-service
service: input_select.select_next
service_data:
cycle: true
entity_id: input_select.music_source_type
### Spotify card - Playlists
- type: conditional
conditions:
- entity: input_select.music_source_type
state: "spotify_playlist"
card:
type: custom:spotify-card
name: Playlister
limit: 24
account: default
display_style: grid
grid_covers_per_row: 6
hide_currently_playing: true
hide_playback_controls: true
hide_top_header: true
device: Soveværelse
default_device: Soveværelse
### Spotify card - Featured
- type: conditional
conditions:
- entity: input_select.music_source_type
state: "spotify_featured"
card:
type: custom:spotify-card
name: Playlister
limit: 12
account: default
playlist_type: featured
spotify_entity: media_player.sovevaerelse
display_style: grid
grid_covers_per_row: 4
hide_currently_playing: true
hide_playback_controls: true
hide_top_header: true
device: Soveværelse
default_device: Soveværelse
### Radio channels
- type: conditional
conditions:
- entity: input_select.music_source_type
state: "radio"
card:
type: vertical-stack
cards:
### FIRST ROW
- type: horizontal-stack
cards:
### DR P3
- type: "custom:button-card"
color_type: card
styles:
card:
- background-image: "url(https://www.radioguide.fm/uploads/images/radiostation/1200px-DR_P3_logo_2020.svg.png)"
- background-repeat: no-repeat
- background-size: cover
- background-position: center
- border-radius: 10px
- height: 133px
tap_action:
action: call-service
service: media_player.play_media
service_data:
entity_id: media_player.sovevaerelse
media_content_id: http://live-icy.gss.dr.dk/A/A05H.mp3
media_content_type: audio/mp4
### DR P4
- type: "custom:button-card"
color_type: card
styles:
card:
- background-image: "url(https://www.radioguide.fm/uploads/images/radiostation/1200px-DR_P4_logo_2020.svg.png)"
- background-repeat: no-repeat
- background-size: cover
- background-position: center
- border-radius: 10px
- height: 133px
tap_action:
action: call-service
service: media_player.play_media
service_data:
entity_id: media_player.sovevaerelse
media_content_id: http://live-icy.gss.dr.dk/A/A08H.mp3
media_content_type: audio/mp4
### Nova FM
- type: "custom:button-card"
color_type: card
styles:
card:
#- background-image: "url(https://assets.planetradio.co.uk/img/ConfigWebListenBarLogoImageUrl/174.jpg)"
- background-image: "url(https://cdn-radiotime-logos.tunein.com/s87164g.png)"
- background-repeat: no-repeat
- background-size: cover
- background-position: center
- border-radius: 10px
- height: 133px
tap_action:
action: call-service
service: media_player.play_media
service_data:
entity_id: media_player.sovevaerelse
media_content_id: http://stream.novafm.dk/nova128
media_content_type: audio/mp4
### SECOND ROW
- type: horizontal-stack
cards:
### Radio 100
- type: "custom:button-card"
color_type: card
styles:
card:
- background-image: "url(https://www.radio.dk/images/broadcasts/d3/f9/4626/c175.png)"
- background-repeat: no-repeat
- background-size: contain
- background-position: center
- border-radius: 10px
- height: 133px
tap_action:
action: call-service
service: media_player.play_media
service_data:
entity_id: media_player.sovevaerelse
media_content_id: http://onair.100fmlive.dk/100fm_live.mp3
media_content_type: audio/mp4
### POP FM
- type: "custom:button-card"
color_type: card
styles:
card:
- background-image: "url(https://bluesmenchannel.com/_dr/1/41682169.png)"
- background-repeat: no-repeat
- background-size: cover
- background-position: center
- border-radius: 10px
- height: 133px
tap_action:
action: call-service
service: media_player.play_media
service_data:
entity_id: media_player.sovevaerelse
media_content_id: http://stream.popfm.dk/pop128
media_content_type: audio/mp4
### Soft
- type: "custom:button-card"
color_type: card
styles:
card:
- background-image: "url(https://www.radio.dk/images/broadcasts/86/85/4659/7/c175.png)"
- background-repeat: no-repeat
- background-size: cover
- background-position: center
- border-radius: 10px
- height: 133px
tap_action:
action: call-service
service: media_player.play_media
service_data:
entity_id: media_player.sovevaerelse
media_content_id: http://onair.100fmlive.dk/soft_live.mp3
media_content_type: audio/mp4
### THIRD ROW
- type: horizontal-stack
cards:
### Voice
- type: "custom:button-card"
color_type: card
styles:
card:
- background-image: "url(https://www.radio.dk/images/broadcasts/68/7c/10657/c175.png)"
- background-repeat: no-repeat
- background-size: cover
- background-position: center
- border-radius: 10px
- height: 133px
tap_action:
action: call-service
service: media_player.play_media
service_data:
entity_id: media_player.sovevaerelse
media_content_id: http://stream.voice.dk/voice128
media_content_type: audio/mp4
### NRJ
- type: "custom:button-card"
color_type: card
styles:
card:
- background-image: "url(https://digitalt.tv/wp-content/uploads/2019/04/NRJ-Radio.png)"
- background-repeat: no-repeat
- background-size: contain
- background-position: center
- border-radius: 10px
- height: 133px
tap_action:
action: call-service
service: media_player.play_media
service_data:
entity_id: media_player.sovevaerelse
media_content_id: https://stream.rcs.revma.com/vf65su7pshruv
media_content_type: audio/mp4
### MyROCK
- type: "custom:button-card"
color_type: card
styles:
card:
- background-image: "url(https://cdn-radiotime-logos.tunein.com/s216726q.png)"
- background-repeat: no-repeat
- background-size: contain
- background-position: center
- border-radius: 10px
- height: 133px
tap_action:
action: call-service
service: media_player.play_media
service_data:
entity_id: media_player.sovevaerelse
media_content_id: http://stream.myrock.fm/myrock128
media_content_type: audio/mp4
### Mediaplayer
- type: custom:mini-media-player
entity: media_player.sovevaerelse
artwork: full-cover
source: icon
hide:
power: true
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Weather information
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- type: vertical-stack
cards:
- type: weather-forecast
entity: weather.hjem
name: Vejrudsigt
- type: horizontal-stack
cards:
- type: sensor
graph: line
entity: sensor.netatmo_weather_home_ude_temperature
name: Temperatur, ude
- type: "vertical-stack"
cards:
- type: sensor
entity: sensor.ude_min_temp
name: Min
- type: sensor
entity: sensor.ude_max_temp
name: Max
- type: sensor
graph: line
entity: sensor.netatmo_weather_home_regn_rain
name: Regn
- type: sensor
graph: line
name: Luftfugtighed
entity: sensor.netatmo_weather_home_ude_humidity
######################################################################
### ROW #2: BUTTON BAR ###
######################################################################
- type: horizontal-stack
cards:
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Show surveilance camera feeds (external app)
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- type: "custom:button-card"
name: OvervΓ₯gning
icon: mdi:camera-wireless-outline
tap_action:
action: javascript
launch: |
[[[
fully.startApplication('com.mcu.reolink')
]]]
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Activate or deactivate alarm clock
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- type: "custom:button-card"
color_type: card
entity: input_boolean.anders_alarm_active
icon: mdi:alarm
name: Ingen vækning
styles:
card:
- background-color: var(--card-background-color)
- color: var(--primary-foreground-color)
- border-radius: 10px
state:
- value: "on"
name: '[[[var newtime = new Date("1970-01-01 " + states["input_datetime.alarm_anders"].state);newtime.setTime(newtime.getTime());return "Vækning kl. "+ newtime.toLocaleTimeString("da-DA").replaceAll(".",":").replace(":00","");]]]'
icon: mdi:alarm
- value: "off"
name: Ingen vækning
icon: mdi:bell-off-outline
tap_action:
action: none
hold_action:
action: call-service
service: input_boolean.toggle
service_data:
entity_id: input_boolean.anders_alarm_active
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Activate or deactivate alarm system
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- type: "custom:button-card"
color_type: card
icon: mdi:shield-check-outline
entity: alarm_control_panel.alarm
show_state: true
show_name: false
styles:
card:
- background-color: var(--card-background-color)
- color: var(--primary-foreground-color)
- border-radius: 10px
state:
- value: "armed_home"
styles:
icon:
- color: green
state:
- color: green
- value: "armed_away"
styles:
icon:
- color: green
state:
- color: green
- value: "arming"
styles:
icon:
- color: yellow
state:
- color: yellow
- value: "disarmed"
icon: mdi:shield-off-outline
styles:
icon:
- color: red
state:
- color: red
tap_action:
action: fire-dom-event
browser_mod:
command: popup
title: Alarm status
hide_header: false
card:
type: alarm-panel
entity: alarm_control_panel.alarm
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Control lights
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- type: "custom:button-card"
color_type: card
icon: mdi:lightbulb-off
name: Lys
styles:
card:
- background-color: var(--card-background-color)
- color: var(--primary-foreground-color)
- border-radius: 10px
entity: scene.sluk_stue_alrum
tap_action:
action: call-service
service: scene.turn_on
service_data:
entity_id: scene.sluk_stue_alrum
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Select home state
#βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- type: "custom:button-card"
color_type: card
icon: mdi:home
show_state: true
show_name: false
styles:
card:
- background-color: var(--card-background-color)
- color: var(--primary-foreground-color)
- border-radius: 10px
entity: input_select.home_state
state:
- value: "Hjemme"
icon: mdi:home
- value: "Ude"
icon: mdi:home-outline
- value: "Nat"
icon: mdi:weather-night
- value: "Gæster"
icon: mdi:party-popper
- value: "Ferie"
icon: mdi:beach
tap_action:
action: fire-dom-event
browser_mod:
command: popup
auto_close: true
large: true
card: !include include/cards/home_state_selection.yaml
title: " "