Created
August 29, 2023 07:16
-
-
Save BerriJ/51333094064a6565fec004502512e96c to your computer and use it in GitHub Desktop.
Awtrix Spotify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias: pixelclock_spotify | |
description: "" | |
trigger: | |
- platform: state | |
entity_id: media_player.spotify_vistagamer | |
condition: [] | |
action: | |
- choose: | |
- conditions: | |
- condition: state | |
entity_id: media_player.spotify_vistagamer | |
state: playing | |
sequence: | |
- service: mqtt.publish | |
data: | |
qos: 2 | |
retain: false | |
payload: |- | |
{ | |
"text": "{{ state_attr('media_player.spotify_vistagamer', 'media_artist') }} - {{ state_attr('media_player.spotify_vistagamer', 'media_title') }}", | |
"icon": "spotify", | |
"rainbow": false, | |
"duration": 10, | |
"pushIcon": 0, | |
"textCase": 2, | |
"progress": {{ ( states.media_player.spotify_vistagamer.attributes.media_position / states.media_player.spotify_vistagamer.attributes.media_duration * 100 ) | round() }}, | |
"progressC": "18B04C" | |
} | |
topic: awtrix_ec/custom/spotify | |
- conditions: | |
- condition: template | |
value_template: >- | |
{{ not states.media_player.spotify_vistagamer.state == 'playing' | |
}} | |
sequence: | |
- service: mqtt.publish | |
data: | |
qos: 2 | |
retain: false | |
topic: awtrix_ec/custom/spotify | |
mode: single |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment