Lysshow: brug Sonos-cover i stedet for Spotify API - virker for alle konti og kilder
This commit is contained in:
@@ -5,5 +5,5 @@ panel: true
|
|||||||
|
|
||||||
cards:
|
cards:
|
||||||
- type: iframe
|
- type: iframe
|
||||||
url: /local/snapshots/indkorsel_loader.html?v=20260910185021
|
url: /local/snapshots/indkorsel_loader.html?v=20260910190142
|
||||||
aspect_ratio: 100%
|
aspect_ratio: 100%
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
# SpotifyPlus + Hue lysshow pr. værelse.
|
# Sonos + Hue lysshow pr. værelse.
|
||||||
# Baseret på thlucas1's "SpotifyPlus Hue Lightshow"-blueprint:
|
# Baseret på thlucas1's "SpotifyPlus Hue Lightshow"-blueprint:
|
||||||
# https://github.com/thlucas1/homeassistant_blueprints/blob/master/spotifyplus/spotifyplus_hue_lightshow.md
|
# https://github.com/thlucas1/homeassistant_blueprints/blob/master/spotifyplus/spotifyplus_hue_lightshow.md
|
||||||
#
|
#
|
||||||
# SpotifyPlus konfigureret 10/9 2026 — entity: media_player.spotifyplus_claus_dethlefsen
|
# Coveret hentes fra Sonos-afspilleren (virker for alle konti/kilder);
|
||||||
|
# SpotifyPlus bruges kun til farvepalette-analysen (get_image_palette_colors).
|
||||||
|
|
||||||
- id: lightshow_andreas
|
- id: lightshow_andreas
|
||||||
alias: "Lysshow: Andreas"
|
alias: "Lysshow: Andreas"
|
||||||
description: Synkroniserer Hue-lys med Spotify-albumcover (SpotifyPlus)
|
description: Lys skifter mellem albumcoverets farver (Sonos Andreas)
|
||||||
mode: restart
|
mode: restart
|
||||||
max_exceeded: silent
|
max_exceeded: silent
|
||||||
triggers:
|
triggers:
|
||||||
@@ -14,29 +15,31 @@
|
|||||||
entity_id: input_boolean.lightshow_andreas
|
entity_id: input_boolean.lightshow_andreas
|
||||||
to: "on"
|
to: "on"
|
||||||
- trigger: state
|
- trigger: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.andreas
|
||||||
attribute: media_content_id
|
attribute: entity_picture
|
||||||
- trigger: state
|
- trigger: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.andreas
|
||||||
to: playing
|
to: playing
|
||||||
conditions:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.lightshow_andreas
|
entity_id: input_boolean.lightshow_andreas
|
||||||
state: "on"
|
state: "on"
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.andreas
|
||||||
state: playing
|
state: playing
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ state_attr('media_player.andreas', 'entity_picture') is not none }}"
|
||||||
actions:
|
actions:
|
||||||
- variables:
|
- variables:
|
||||||
media_player_entity: media_player.spotifyplus_claus_dethlefsen
|
media_player_entity: media_player.andreas
|
||||||
lights:
|
lights:
|
||||||
- light.andreas_lysstrip
|
- light.andreas_lysstrip
|
||||||
- light.andreas_stol
|
- light.andreas_stol
|
||||||
spotify_image_url: "{{ state_attr(media_player_entity, 'sp_nowplaying_image_url') }}"
|
cover_url: "{{ state_attr(media_player_entity, 'entity_picture') }}"
|
||||||
- action: spotifyplus.get_image_palette_colors
|
- action: spotifyplus.get_image_palette_colors
|
||||||
data:
|
data:
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.spotifyplus_claus_dethlefsen
|
||||||
image_source: "{{ spotify_image_url }}"
|
image_source: "{{ 'http://localhost:8123' ~ cover_url }}"
|
||||||
color_count: 10
|
color_count: 10
|
||||||
color_quality: 1
|
color_quality: 1
|
||||||
brightness_filter_low: 100
|
brightness_filter_low: 100
|
||||||
@@ -51,10 +54,10 @@
|
|||||||
entity_id: input_boolean.lightshow_andreas
|
entity_id: input_boolean.lightshow_andreas
|
||||||
state: "on"
|
state: "on"
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.andreas
|
||||||
state: playing
|
state: playing
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ spotify_image_url == state_attr(media_player_entity, 'sp_nowplaying_image_url') }}"
|
value_template: "{{ colors_rgb | count > 0 and cover_url == state_attr(media_player_entity, 'entity_picture') }}"
|
||||||
sequence:
|
sequence:
|
||||||
- repeat:
|
- repeat:
|
||||||
count: "{{ colors_rgb | count }}"
|
count: "{{ colors_rgb | count }}"
|
||||||
@@ -70,7 +73,7 @@
|
|||||||
|
|
||||||
- id: lightshow_daniel
|
- id: lightshow_daniel
|
||||||
alias: "Lysshow: Daniel"
|
alias: "Lysshow: Daniel"
|
||||||
description: Synkroniserer Hue-lys med Spotify-albumcover (SpotifyPlus)
|
description: Lys skifter mellem albumcoverets farver (Sonos Daniel)
|
||||||
mode: restart
|
mode: restart
|
||||||
max_exceeded: silent
|
max_exceeded: silent
|
||||||
triggers:
|
triggers:
|
||||||
@@ -78,29 +81,31 @@
|
|||||||
entity_id: input_boolean.lightshow_daniel
|
entity_id: input_boolean.lightshow_daniel
|
||||||
to: "on"
|
to: "on"
|
||||||
- trigger: state
|
- trigger: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.daniel
|
||||||
attribute: media_content_id
|
attribute: entity_picture
|
||||||
- trigger: state
|
- trigger: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.daniel
|
||||||
to: playing
|
to: playing
|
||||||
conditions:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.lightshow_daniel
|
entity_id: input_boolean.lightshow_daniel
|
||||||
state: "on"
|
state: "on"
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.daniel
|
||||||
state: playing
|
state: playing
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ state_attr('media_player.daniel', 'entity_picture') is not none }}"
|
||||||
actions:
|
actions:
|
||||||
- variables:
|
- variables:
|
||||||
media_player_entity: media_player.spotifyplus_claus_dethlefsen
|
media_player_entity: media_player.daniel
|
||||||
lights:
|
lights:
|
||||||
- light.daniel_lysstrip
|
- light.daniel_lysstrip
|
||||||
- light.bamse
|
- light.bamse
|
||||||
spotify_image_url: "{{ state_attr(media_player_entity, 'sp_nowplaying_image_url') }}"
|
cover_url: "{{ state_attr(media_player_entity, 'entity_picture') }}"
|
||||||
- action: spotifyplus.get_image_palette_colors
|
- action: spotifyplus.get_image_palette_colors
|
||||||
data:
|
data:
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.spotifyplus_claus_dethlefsen
|
||||||
image_source: "{{ spotify_image_url }}"
|
image_source: "{{ 'http://localhost:8123' ~ cover_url }}"
|
||||||
color_count: 10
|
color_count: 10
|
||||||
color_quality: 1
|
color_quality: 1
|
||||||
brightness_filter_low: 100
|
brightness_filter_low: 100
|
||||||
@@ -115,10 +120,10 @@
|
|||||||
entity_id: input_boolean.lightshow_daniel
|
entity_id: input_boolean.lightshow_daniel
|
||||||
state: "on"
|
state: "on"
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.daniel
|
||||||
state: playing
|
state: playing
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ spotify_image_url == state_attr(media_player_entity, 'sp_nowplaying_image_url') }}"
|
value_template: "{{ colors_rgb | count > 0 and cover_url == state_attr(media_player_entity, 'entity_picture') }}"
|
||||||
sequence:
|
sequence:
|
||||||
- repeat:
|
- repeat:
|
||||||
count: "{{ colors_rgb | count }}"
|
count: "{{ colors_rgb | count }}"
|
||||||
@@ -134,7 +139,7 @@
|
|||||||
|
|
||||||
- id: lightshow_sovevaerelse
|
- id: lightshow_sovevaerelse
|
||||||
alias: "Lysshow: Soveværelse"
|
alias: "Lysshow: Soveværelse"
|
||||||
description: Synkroniserer Hue-lys med Spotify-albumcover (SpotifyPlus)
|
description: Lys skifter mellem albumcoverets farver (Sonos Soveværelse)
|
||||||
mode: restart
|
mode: restart
|
||||||
max_exceeded: silent
|
max_exceeded: silent
|
||||||
triggers:
|
triggers:
|
||||||
@@ -142,32 +147,34 @@
|
|||||||
entity_id: input_boolean.lightshow_sovevaerelse
|
entity_id: input_boolean.lightshow_sovevaerelse
|
||||||
to: "on"
|
to: "on"
|
||||||
- trigger: state
|
- trigger: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.sovevaerelse
|
||||||
attribute: media_content_id
|
attribute: entity_picture
|
||||||
- trigger: state
|
- trigger: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.sovevaerelse
|
||||||
to: playing
|
to: playing
|
||||||
conditions:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.lightshow_sovevaerelse
|
entity_id: input_boolean.lightshow_sovevaerelse
|
||||||
state: "on"
|
state: "on"
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.sovevaerelse
|
||||||
state: playing
|
state: playing
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ state_attr('media_player.sovevaerelse', 'entity_picture') is not none }}"
|
||||||
actions:
|
actions:
|
||||||
- variables:
|
- variables:
|
||||||
media_player_entity: media_player.spotifyplus_claus_dethlefsen
|
media_player_entity: media_player.sovevaerelse
|
||||||
lights:
|
lights:
|
||||||
- light.sov_midt
|
- light.sov_midt
|
||||||
- light.sov_vindue
|
- light.sov_vindue
|
||||||
- light.sov_dor
|
- light.sov_dor
|
||||||
- light.anne
|
- light.anne
|
||||||
- light.claus
|
- light.claus
|
||||||
spotify_image_url: "{{ state_attr(media_player_entity, 'sp_nowplaying_image_url') }}"
|
cover_url: "{{ state_attr(media_player_entity, 'entity_picture') }}"
|
||||||
- action: spotifyplus.get_image_palette_colors
|
- action: spotifyplus.get_image_palette_colors
|
||||||
data:
|
data:
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.spotifyplus_claus_dethlefsen
|
||||||
image_source: "{{ spotify_image_url }}"
|
image_source: "{{ 'http://localhost:8123' ~ cover_url }}"
|
||||||
color_count: 10
|
color_count: 10
|
||||||
color_quality: 1
|
color_quality: 1
|
||||||
brightness_filter_low: 100
|
brightness_filter_low: 100
|
||||||
@@ -182,10 +189,10 @@
|
|||||||
entity_id: input_boolean.lightshow_sovevaerelse
|
entity_id: input_boolean.lightshow_sovevaerelse
|
||||||
state: "on"
|
state: "on"
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.sovevaerelse
|
||||||
state: playing
|
state: playing
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ spotify_image_url == state_attr(media_player_entity, 'sp_nowplaying_image_url') }}"
|
value_template: "{{ colors_rgb | count > 0 and cover_url == state_attr(media_player_entity, 'entity_picture') }}"
|
||||||
sequence:
|
sequence:
|
||||||
- repeat:
|
- repeat:
|
||||||
count: "{{ colors_rgb | count }}"
|
count: "{{ colors_rgb | count }}"
|
||||||
@@ -201,7 +208,7 @@
|
|||||||
|
|
||||||
- id: lightshow_stue
|
- id: lightshow_stue
|
||||||
alias: "Lysshow: Stue"
|
alias: "Lysshow: Stue"
|
||||||
description: Synkroniserer Hue-lys med Spotify-albumcover (SpotifyPlus)
|
description: Lys skifter mellem albumcoverets farver (Sonos Stue)
|
||||||
mode: restart
|
mode: restart
|
||||||
max_exceeded: silent
|
max_exceeded: silent
|
||||||
triggers:
|
triggers:
|
||||||
@@ -209,31 +216,33 @@
|
|||||||
entity_id: input_boolean.lightshow_stue
|
entity_id: input_boolean.lightshow_stue
|
||||||
to: "on"
|
to: "on"
|
||||||
- trigger: state
|
- trigger: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.stue
|
||||||
attribute: media_content_id
|
attribute: entity_picture
|
||||||
- trigger: state
|
- trigger: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.stue
|
||||||
to: playing
|
to: playing
|
||||||
conditions:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.lightshow_stue
|
entity_id: input_boolean.lightshow_stue
|
||||||
state: "on"
|
state: "on"
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.stue
|
||||||
state: playing
|
state: playing
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ state_attr('media_player.stue', 'entity_picture') is not none }}"
|
||||||
actions:
|
actions:
|
||||||
- variables:
|
- variables:
|
||||||
media_player_entity: media_player.spotifyplus_claus_dethlefsen
|
media_player_entity: media_player.stue
|
||||||
# Kun farve-lamper (pendle1/syd/spisebord kan ikke farve)
|
# Kun farve-lamper (pendle1/syd/spisebord kan ikke farve)
|
||||||
lights:
|
lights:
|
||||||
- light.pendle2
|
- light.pendle2
|
||||||
- light.raket
|
- light.raket
|
||||||
- light.panton
|
- light.panton
|
||||||
spotify_image_url: "{{ state_attr(media_player_entity, 'sp_nowplaying_image_url') }}"
|
cover_url: "{{ state_attr(media_player_entity, 'entity_picture') }}"
|
||||||
- action: spotifyplus.get_image_palette_colors
|
- action: spotifyplus.get_image_palette_colors
|
||||||
data:
|
data:
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.spotifyplus_claus_dethlefsen
|
||||||
image_source: "{{ spotify_image_url }}"
|
image_source: "{{ 'http://localhost:8123' ~ cover_url }}"
|
||||||
color_count: 10
|
color_count: 10
|
||||||
color_quality: 1
|
color_quality: 1
|
||||||
brightness_filter_low: 100
|
brightness_filter_low: 100
|
||||||
@@ -248,10 +257,10 @@
|
|||||||
entity_id: input_boolean.lightshow_stue
|
entity_id: input_boolean.lightshow_stue
|
||||||
state: "on"
|
state: "on"
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: media_player.spotifyplus_claus_dethlefsen
|
entity_id: media_player.stue
|
||||||
state: playing
|
state: playing
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ spotify_image_url == state_attr(media_player_entity, 'sp_nowplaying_image_url') }}"
|
value_template: "{{ colors_rgb | count > 0 and cover_url == state_attr(media_player_entity, 'entity_picture') }}"
|
||||||
sequence:
|
sequence:
|
||||||
- repeat:
|
- repeat:
|
||||||
count: "{{ colors_rgb | count }}"
|
count: "{{ colors_rgb | count }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user