diff --git a/configuration.yaml b/configuration.yaml index 8651c51..286e31a 100755 --- a/configuration.yaml +++ b/configuration.yaml @@ -159,6 +159,9 @@ cover: - cover.venstre - cover.terrasse_dor +# Dominerende farve fra albumcover (bruges af coverfarve-automatiseringer) +color_extractor: + ################################################## # Modular Includes ################################################## diff --git a/dashboards/views/03_andreas.yaml b/dashboards/views/03_andreas.yaml index f6a5448..7e03304 100644 --- a/dashboards/views/03_andreas.yaml +++ b/dashboards/views/03_andreas.yaml @@ -38,6 +38,31 @@ sections: name: - font-size: 11px + - type: custom:button-card + entity: input_boolean.coverfarve_andreas + name: Coverfarve + icon: mdi:palette + tap_action: + action: toggle + state: + - value: "on" + styles: + card: + - background-color: "#2c4a5e" + - color: "#a8d8f0" + icon: + - color: "#a8d8f0" + name: + - color: "#a8d8f0" + styles: + card: + - height: 52px + - padding: 6px 8px + icon: + - width: 18px + name: + - font-size: 11px + - type: grid columns: 2 square: false diff --git a/dashboards/views/04_daniel.yaml b/dashboards/views/04_daniel.yaml index 11a7725..f20595a 100644 --- a/dashboards/views/04_daniel.yaml +++ b/dashboards/views/04_daniel.yaml @@ -38,6 +38,31 @@ sections: name: - font-size: 11px + - type: custom:button-card + entity: input_boolean.coverfarve_daniel + name: Coverfarve + icon: mdi:palette + tap_action: + action: toggle + state: + - value: "on" + styles: + card: + - background-color: "#2c4a5e" + - color: "#a8d8f0" + icon: + - color: "#a8d8f0" + name: + - color: "#a8d8f0" + styles: + card: + - height: 52px + - padding: 6px 8px + icon: + - width: 18px + name: + - font-size: 11px + - type: grid columns: 2 square: false diff --git a/dashboards/views/04b_sovevaerelse.yaml b/dashboards/views/04b_sovevaerelse.yaml index 9c6670d..28fda9a 100644 --- a/dashboards/views/04b_sovevaerelse.yaml +++ b/dashboards/views/04b_sovevaerelse.yaml @@ -63,6 +63,31 @@ sections: name: - font-size: 11px + - type: custom:button-card + entity: input_boolean.coverfarve_sovevaerelse + name: Coverfarve + icon: mdi:palette + tap_action: + action: toggle + state: + - value: "on" + styles: + card: + - background-color: "#2c4a5e" + - color: "#a8d8f0" + icon: + - color: "#a8d8f0" + name: + - color: "#a8d8f0" + styles: + card: + - height: 52px + - padding: 6px 8px + icon: + - width: 18px + name: + - font-size: 11px + - type: grid columns: 2 square: false diff --git a/dashboards/views/05_rooms.yaml b/dashboards/views/05_rooms.yaml index e35e41c..17f9690 100644 --- a/dashboards/views/05_rooms.yaml +++ b/dashboards/views/05_rooms.yaml @@ -48,6 +48,31 @@ sections: name: - font-size: 11px + - type: custom:button-card + entity: input_boolean.coverfarve_stue + name: Coverfarve + icon: mdi:palette + tap_action: + action: toggle + state: + - value: "on" + styles: + card: + - background-color: "#2c4a5e" + - color: "#a8d8f0" + icon: + - color: "#a8d8f0" + name: + - color: "#a8d8f0" + styles: + card: + - height: 52px + - padding: 6px 8px + icon: + - width: 18px + name: + - font-size: 11px + # 💡 Lys (kompakt + alle lys) - type: grid diff --git a/dashboards/views/06c_indkorsel_snapshots.yaml b/dashboards/views/06c_indkorsel_snapshots.yaml index eb01391..dcd666b 100644 --- a/dashboards/views/06c_indkorsel_snapshots.yaml +++ b/dashboards/views/06c_indkorsel_snapshots.yaml @@ -5,5 +5,5 @@ panel: true cards: - type: iframe - url: /local/snapshots/indkorsel_loader.html?v=20260910174711 + url: /local/snapshots/indkorsel_loader.html?v=20260910175555 aspect_ratio: 100% diff --git a/include/automations/coverfarve.yaml b/include/automations/coverfarve.yaml new file mode 100644 index 0000000..2429836 --- /dev/null +++ b/include/automations/coverfarve.yaml @@ -0,0 +1,129 @@ +# Coverfarve: sætter værelsets Hue-lys til albumcoverets dominerende farve (color_extractor). +# Virker med Sonos-afspilning (favoritter, radio, Spotify) — modsat SpotifyPlus-lysshowet. + +- id: coverfarve_andreas + alias: "Coverfarve: Andreas" + description: Lys følger albumcover på Sonos Andreas + mode: restart + max_exceeded: silent + triggers: + - trigger: state + entity_id: input_boolean.coverfarve_andreas + to: "on" + - trigger: state + entity_id: media_player.andreas + attribute: entity_picture + conditions: + - condition: state + entity_id: input_boolean.coverfarve_andreas + state: "on" + - condition: state + entity_id: media_player.andreas + state: playing + - condition: template + value_template: "{{ state_attr('media_player.andreas', 'entity_picture') is not none }}" + actions: + - action: color_extractor.turn_on + data: + color_extract_url: "{{ 'http://localhost:8123' ~ state_attr('media_player.andreas', 'entity_picture') }}" + entity_id: + - light.andreas_lysstrip + - light.andreas_stol + transition: 2 + +- id: coverfarve_daniel + alias: "Coverfarve: Daniel" + description: Lys følger albumcover på Sonos Daniel + mode: restart + max_exceeded: silent + triggers: + - trigger: state + entity_id: input_boolean.coverfarve_daniel + to: "on" + - trigger: state + entity_id: media_player.daniel + attribute: entity_picture + conditions: + - condition: state + entity_id: input_boolean.coverfarve_daniel + state: "on" + - condition: state + entity_id: media_player.daniel + state: playing + - condition: template + value_template: "{{ state_attr('media_player.daniel', 'entity_picture') is not none }}" + actions: + - action: color_extractor.turn_on + data: + color_extract_url: "{{ 'http://localhost:8123' ~ state_attr('media_player.daniel', 'entity_picture') }}" + entity_id: + - light.daniel_lysstrip + - light.bamse + transition: 2 + +- id: coverfarve_sovevaerelse + alias: "Coverfarve: Soveværelse" + description: Lys følger albumcover på Sonos Soveværelse + mode: restart + max_exceeded: silent + triggers: + - trigger: state + entity_id: input_boolean.coverfarve_sovevaerelse + to: "on" + - trigger: state + entity_id: media_player.sovevaerelse + attribute: entity_picture + conditions: + - condition: state + entity_id: input_boolean.coverfarve_sovevaerelse + state: "on" + - condition: state + entity_id: media_player.sovevaerelse + state: playing + - condition: template + value_template: "{{ state_attr('media_player.sovevaerelse', 'entity_picture') is not none }}" + actions: + - action: color_extractor.turn_on + data: + color_extract_url: "{{ 'http://localhost:8123' ~ state_attr('media_player.sovevaerelse', 'entity_picture') }}" + entity_id: + - light.sov_midt + - light.sov_vindue + - light.sov_dor + - light.anne + - light.claus + transition: 2 + +- id: coverfarve_stue + alias: "Coverfarve: Stue" + description: Lys følger albumcover på Sonos Stue + mode: restart + max_exceeded: silent + triggers: + - trigger: state + entity_id: input_boolean.coverfarve_stue + to: "on" + - trigger: state + entity_id: media_player.stue + attribute: entity_picture + conditions: + - condition: state + entity_id: input_boolean.coverfarve_stue + state: "on" + - condition: state + entity_id: media_player.stue + state: playing + - condition: template + value_template: "{{ state_attr('media_player.stue', 'entity_picture') is not none }}" + actions: + - action: color_extractor.turn_on + data: + color_extract_url: "{{ 'http://localhost:8123' ~ state_attr('media_player.stue', 'entity_picture') }}" + entity_id: + - light.pendle1 + - light.pendle2 + - light.syd + - light.raket + - light.spisebord + - light.panton + transition: 2 diff --git a/include/automations/lightshow.yaml b/include/automations/lightshow.yaml index a3ba739..0427789 100644 --- a/include/automations/lightshow.yaml +++ b/include/automations/lightshow.yaml @@ -2,8 +2,7 @@ # Baseret på thlucas1's "SpotifyPlus Hue Lightshow"-blueprint: # https://github.com/thlucas1/homeassistant_blueprints/blob/master/spotifyplus/spotifyplus_hue_lightshow.md # -# OBS: Kræver at SpotifyPlus-integrationen er sat op (Spotify Premium + OAuth). -# Ret media_player.spotifyplus til den faktiske entity efter opsætning. +# SpotifyPlus konfigureret 10/9 2026 — entity: media_player.spotifyplus_claus_dethlefsen - id: lightshow_andreas alias: "Lysshow: Andreas" @@ -15,28 +14,28 @@ entity_id: input_boolean.lightshow_andreas to: "on" - trigger: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen attribute: media_content_id - trigger: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen to: playing conditions: - condition: state entity_id: input_boolean.lightshow_andreas state: "on" - condition: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen state: playing actions: - variables: - media_player_entity: media_player.spotifyplus + media_player_entity: media_player.spotifyplus_claus_dethlefsen lights: - light.andreas_lysstrip - light.andreas_stol spotify_image_url: "{{ state_attr(media_player_entity, 'sp_nowplaying_image_url') }}" - action: spotifyplus.get_image_palette_colors data: - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen image_source: "{{ spotify_image_url }}" color_count: 10 color_quality: 1 @@ -52,7 +51,7 @@ entity_id: input_boolean.lightshow_andreas state: "on" - condition: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen state: playing - condition: template value_template: "{{ spotify_image_url == state_attr(media_player_entity, 'sp_nowplaying_image_url') }}" @@ -79,28 +78,28 @@ entity_id: input_boolean.lightshow_daniel to: "on" - trigger: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen attribute: media_content_id - trigger: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen to: playing conditions: - condition: state entity_id: input_boolean.lightshow_daniel state: "on" - condition: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen state: playing actions: - variables: - media_player_entity: media_player.spotifyplus + media_player_entity: media_player.spotifyplus_claus_dethlefsen lights: - light.daniel_lysstrip - light.bamse spotify_image_url: "{{ state_attr(media_player_entity, 'sp_nowplaying_image_url') }}" - action: spotifyplus.get_image_palette_colors data: - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen image_source: "{{ spotify_image_url }}" color_count: 10 color_quality: 1 @@ -116,7 +115,7 @@ entity_id: input_boolean.lightshow_daniel state: "on" - condition: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen state: playing - condition: template value_template: "{{ spotify_image_url == state_attr(media_player_entity, 'sp_nowplaying_image_url') }}" @@ -143,21 +142,21 @@ entity_id: input_boolean.lightshow_sovevaerelse to: "on" - trigger: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen attribute: media_content_id - trigger: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen to: playing conditions: - condition: state entity_id: input_boolean.lightshow_sovevaerelse state: "on" - condition: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen state: playing actions: - variables: - media_player_entity: media_player.spotifyplus + media_player_entity: media_player.spotifyplus_claus_dethlefsen lights: - light.sov_midt - light.sov_vindue @@ -167,7 +166,7 @@ spotify_image_url: "{{ state_attr(media_player_entity, 'sp_nowplaying_image_url') }}" - action: spotifyplus.get_image_palette_colors data: - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen image_source: "{{ spotify_image_url }}" color_count: 10 color_quality: 1 @@ -183,7 +182,7 @@ entity_id: input_boolean.lightshow_sovevaerelse state: "on" - condition: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen state: playing - condition: template value_template: "{{ spotify_image_url == state_attr(media_player_entity, 'sp_nowplaying_image_url') }}" @@ -210,21 +209,21 @@ entity_id: input_boolean.lightshow_stue to: "on" - trigger: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen attribute: media_content_id - trigger: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen to: playing conditions: - condition: state entity_id: input_boolean.lightshow_stue state: "on" - condition: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen state: playing actions: - variables: - media_player_entity: media_player.spotifyplus + media_player_entity: media_player.spotifyplus_claus_dethlefsen lights: - light.pendle1 - light.pendle2 @@ -235,7 +234,7 @@ spotify_image_url: "{{ state_attr(media_player_entity, 'sp_nowplaying_image_url') }}" - action: spotifyplus.get_image_palette_colors data: - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen image_source: "{{ spotify_image_url }}" color_count: 10 color_quality: 1 @@ -251,7 +250,7 @@ entity_id: input_boolean.lightshow_stue state: "on" - condition: state - entity_id: media_player.spotifyplus + entity_id: media_player.spotifyplus_claus_dethlefsen state: playing - condition: template value_template: "{{ spotify_image_url == state_attr(media_player_entity, 'sp_nowplaying_image_url') }}" diff --git a/include/input/boolean/lightshow.yaml b/include/input/boolean/lightshow.yaml index 0562dba..0ece726 100644 --- a/include/input/boolean/lightshow.yaml +++ b/include/input/boolean/lightshow.yaml @@ -13,3 +13,19 @@ lightshow_sovevaerelse: lightshow_stue: name: Lysshow Stue icon: mdi:party-popper + +coverfarve_andreas: + name: Coverfarve Andreas + icon: mdi:palette + +coverfarve_daniel: + name: Coverfarve Daniel + icon: mdi:palette + +coverfarve_sovevaerelse: + name: Coverfarve Soveværelse + icon: mdi:palette + +coverfarve_stue: + name: Coverfarve Stue + icon: mdi:palette