Lysshow: SpotifyPlus+Hue automationer, input_booleans og knapper på Andreas/Daniel/soveværelse/stue views

This commit is contained in:
2026-09-10 17:51:22 +02:00
parent 7f4331b214
commit fa5bd76f7e
11 changed files with 391 additions and 14 deletions
+269
View File
@@ -0,0 +1,269 @@
# SpotifyPlus + Hue lysshow pr. værelse.
# 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.
- id: lightshow_andreas
alias: "Lysshow: Andreas"
description: Synkroniserer Hue-lys med Spotify-albumcover (SpotifyPlus)
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: input_boolean.lightshow_andreas
to: "on"
- trigger: state
entity_id: media_player.spotifyplus
attribute: media_content_id
- trigger: state
entity_id: media_player.spotifyplus
to: playing
conditions:
- condition: state
entity_id: input_boolean.lightshow_andreas
state: "on"
- condition: state
entity_id: media_player.spotifyplus
state: playing
actions:
- variables:
media_player_entity: media_player.spotifyplus
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
image_source: "{{ spotify_image_url }}"
color_count: 10
color_quality: 1
brightness_filter_low: 100
brightness_filter_high: 600
hue_distance_filter: 10
response_variable: palette_response
- variables:
colors_rgb: "{{ palette_response['result']['items'][:6] | map(attribute='rgb') | list }}"
- repeat:
while:
- condition: state
entity_id: input_boolean.lightshow_andreas
state: "on"
- condition: state
entity_id: media_player.spotifyplus
state: playing
- condition: template
value_template: "{{ spotify_image_url == state_attr(media_player_entity, 'sp_nowplaying_image_url') }}"
sequence:
- repeat:
count: "{{ colors_rgb | count }}"
sequence:
- action: light.turn_on
target:
entity_id: "{{ lights }}"
data:
rgb_color: "{{ colors_rgb[repeat.index - 1] }}"
brightness_pct: 100
transition: 2
- delay: "00:00:02"
- id: lightshow_daniel
alias: "Lysshow: Daniel"
description: Synkroniserer Hue-lys med Spotify-albumcover (SpotifyPlus)
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: input_boolean.lightshow_daniel
to: "on"
- trigger: state
entity_id: media_player.spotifyplus
attribute: media_content_id
- trigger: state
entity_id: media_player.spotifyplus
to: playing
conditions:
- condition: state
entity_id: input_boolean.lightshow_daniel
state: "on"
- condition: state
entity_id: media_player.spotifyplus
state: playing
actions:
- variables:
media_player_entity: media_player.spotifyplus
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
image_source: "{{ spotify_image_url }}"
color_count: 10
color_quality: 1
brightness_filter_low: 100
brightness_filter_high: 600
hue_distance_filter: 10
response_variable: palette_response
- variables:
colors_rgb: "{{ palette_response['result']['items'][:6] | map(attribute='rgb') | list }}"
- repeat:
while:
- condition: state
entity_id: input_boolean.lightshow_daniel
state: "on"
- condition: state
entity_id: media_player.spotifyplus
state: playing
- condition: template
value_template: "{{ spotify_image_url == state_attr(media_player_entity, 'sp_nowplaying_image_url') }}"
sequence:
- repeat:
count: "{{ colors_rgb | count }}"
sequence:
- action: light.turn_on
target:
entity_id: "{{ lights }}"
data:
rgb_color: "{{ colors_rgb[repeat.index - 1] }}"
brightness_pct: 100
transition: 2
- delay: "00:00:02"
- id: lightshow_sovevaerelse
alias: "Lysshow: Soveværelse"
description: Synkroniserer Hue-lys med Spotify-albumcover (SpotifyPlus)
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: input_boolean.lightshow_sovevaerelse
to: "on"
- trigger: state
entity_id: media_player.spotifyplus
attribute: media_content_id
- trigger: state
entity_id: media_player.spotifyplus
to: playing
conditions:
- condition: state
entity_id: input_boolean.lightshow_sovevaerelse
state: "on"
- condition: state
entity_id: media_player.spotifyplus
state: playing
actions:
- variables:
media_player_entity: media_player.spotifyplus
lights:
- light.sov_midt
- light.sov_vindue
- light.sov_dor
- light.anne
- light.claus
spotify_image_url: "{{ state_attr(media_player_entity, 'sp_nowplaying_image_url') }}"
- action: spotifyplus.get_image_palette_colors
data:
entity_id: media_player.spotifyplus
image_source: "{{ spotify_image_url }}"
color_count: 10
color_quality: 1
brightness_filter_low: 100
brightness_filter_high: 600
hue_distance_filter: 10
response_variable: palette_response
- variables:
colors_rgb: "{{ palette_response['result']['items'][:6] | map(attribute='rgb') | list }}"
- repeat:
while:
- condition: state
entity_id: input_boolean.lightshow_sovevaerelse
state: "on"
- condition: state
entity_id: media_player.spotifyplus
state: playing
- condition: template
value_template: "{{ spotify_image_url == state_attr(media_player_entity, 'sp_nowplaying_image_url') }}"
sequence:
- repeat:
count: "{{ colors_rgb | count }}"
sequence:
- action: light.turn_on
target:
entity_id: "{{ lights }}"
data:
rgb_color: "{{ colors_rgb[repeat.index - 1] }}"
brightness_pct: 100
transition: 2
- delay: "00:00:02"
- id: lightshow_stue
alias: "Lysshow: Stue"
description: Synkroniserer Hue-lys med Spotify-albumcover (SpotifyPlus)
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: input_boolean.lightshow_stue
to: "on"
- trigger: state
entity_id: media_player.spotifyplus
attribute: media_content_id
- trigger: state
entity_id: media_player.spotifyplus
to: playing
conditions:
- condition: state
entity_id: input_boolean.lightshow_stue
state: "on"
- condition: state
entity_id: media_player.spotifyplus
state: playing
actions:
- variables:
media_player_entity: media_player.spotifyplus
lights:
- light.pendle1
- light.pendle2
- light.syd
- light.raket
- light.spisebord
- light.panton
spotify_image_url: "{{ state_attr(media_player_entity, 'sp_nowplaying_image_url') }}"
- action: spotifyplus.get_image_palette_colors
data:
entity_id: media_player.spotifyplus
image_source: "{{ spotify_image_url }}"
color_count: 10
color_quality: 1
brightness_filter_low: 100
brightness_filter_high: 600
hue_distance_filter: 10
response_variable: palette_response
- variables:
colors_rgb: "{{ palette_response['result']['items'][:6] | map(attribute='rgb') | list }}"
- repeat:
while:
- condition: state
entity_id: input_boolean.lightshow_stue
state: "on"
- condition: state
entity_id: media_player.spotifyplus
state: playing
- condition: template
value_template: "{{ spotify_image_url == state_attr(media_player_entity, 'sp_nowplaying_image_url') }}"
sequence:
- repeat:
count: "{{ colors_rgb | count }}"
sequence:
- action: light.turn_on
target:
entity_id: "{{ lights }}"
data:
rgb_color: "{{ colors_rgb[repeat.index - 1] }}"
brightness_pct: 100
transition: 2
- delay: "00:00:02"
+15
View File
@@ -0,0 +1,15 @@
lightshow_andreas:
name: Lysshow Andreas
icon: mdi:party-popper
lightshow_daniel:
name: Lysshow Daniel
icon: mdi:party-popper
lightshow_sovevaerelse:
name: Lysshow Soveværelse
icon: mdi:party-popper
lightshow_stue:
name: Lysshow Stue
icon: mdi:party-popper
+3 -3
View File
@@ -50,7 +50,7 @@ varme_komfort_forgang:
max: 28
step: 0.5
unit_of_measurement: "°C"
initial: 22
initial: 24
icon: mdi:thermometer
varme_komfort_lille_bad:
@@ -59,7 +59,7 @@ varme_komfort_lille_bad:
max: 28
step: 0.5
unit_of_measurement: "°C"
initial: 22
initial: 24
icon: mdi:thermometer
varme_komfort_badevarelse:
@@ -77,7 +77,7 @@ varme_komfort_stue:
max: 28
step: 0.5
unit_of_measurement: "°C"
initial: 21
initial: 23
icon: mdi:thermometer
# Globale sænkninger