#Get Play-State of addon-spotify-connect
1 messages · Page 1 of 1 (latest)
@jaunty moth
Here's something similar that I use with my SpotifyPlus integration and Philips Hue lighting. It changes the Philips Hue lighting color to vibrant color of currently playing Spotify track cover art when the SpotifyPlus media player is playing something. You could easily modify the actions to turn your amp on (instead of modifying light colors); you could also add conditions that only apply if the selected Spotify source is the "Spotify Connect" device name.
Example Script:
alias: SpotifyPlus Hue Lights to Currently Playing Spotify Cover Art Vibrant Color
description: >-
Changes Philips Hue lighting color to vibrant color of currently playing
Spotify track cover art.
triggers:
- trigger: state
alias: Trigger when SpotifyPlus media player Track ID changes
entity_id:
- media_player.spotifyplus_todd_l
attribute: media_content_id
conditions:
- condition: state
alias: If SpotifyPlus media player is playing something
entity_id: media_player.spotifyplus_todd_l
state: playing
actions:
- action: spotifyplus.get_image_vibrant_colors
alias: Get vibrant colors from currently playing Spotify cover art image
data:
entity_id: media_player.spotifyplus_todd_l
color_count: 64
color_quality: 5
response_variable: vibe_colors
- action: light.turn_on
alias: Change Hue light color to vibrant color value
data:
entity_id: light.office
brightness_pct: 100
rgb_color: "{{ vibe_colors.result.vibrant.rgb }}"
mode: single
Hope it helps!
Another approach is to use the SpotifyPlus integration Turn On and Turn Off configuration options that can execute a script when the player is powered on / off respectively. Then it's a simple matter of creating a script to turn on the amp, and another to turn off the amp.
i will give this a try thank you !