Skip to content

Instantly share code, notes, and snippets.

@Jonas-Sander
Last active May 22, 2024 04:22
Show Gist options
  • Select an option

  • Save Jonas-Sander/ec44121aa1a03f8d60c038cccd132251 to your computer and use it in GitHub Desktop.

Select an option

Save Jonas-Sander/ec44121aa1a03f8d60c038cccd132251 to your computer and use it in GitHub Desktop.
awtrix_spotify_nowPlaying.yaml
alias: Awtrix Spotify NowPlaying 🎹
description:
trigger:
- platform: state
entity_id: media_player.spotify
action:
- choose:
- conditions:
- condition: state
entity_id: media_player.spotify
state: playing
- condition: state
entity_id: media_player.spotify
attribute: media_content_type
state: music
sequence:
- service: mqtt.publish
data:
qos: 0
retain: false
payload: |-
{
"text": "{{ state_attr('media_player.spotify', 'media_artist') }} - {{ state_attr('media_player.spotify', 'media_title') }}",
"icon": "18207",
"rainbow": true,
"repeat": 2,
"pushIcon": 0,
"textCase": 0,
"textOffset": 15,
"progress": {{ ( states.media_player.spotify.attributes.media_position / states.media_player.spotify.attributes.media_duration * 100 ) | round() }},
"progressC": "18B04C"
}
topic: awtrix_0aea8c/custom/spotify
- conditions:
- condition: template
value_template: >-
{{ not states.media_player.spotify.state ==
'playing' }}
sequence:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: awtrix_0aea8c/custom/spotify
@appsfinder2
Copy link

please can you make blueprint to work with spotifyPlus in home assistant thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment