Now playing album cover based on rest sensor

Hi there,

I have a rest sensor that provides me an url to an album cover for the current song on my favorite radio station.
How can i show a lovelace card with that cover image that updates the cover image automatic based on an state update of that sensor. What type of card should i use?

Create a camera with that URL:

camera:
  - platform: generic
    name: now_playing
    still_image_url: url_goes_here

Then display it in lovelace:

    cards:
    - type: picture-glance
      camera_image: camera.now_playing

[Edit]
if the URL is obtained via a sensor, replace

still_image_url: url_goes_here

with

still_image_url: '{{states("sensor.radio_url")}}'

Unfortunately that’s not working. I can’t add the template for the sensor to the camera…

my bad, forgot the quotes.
try this:

still_image_url: '{{states("sensor.radio_url")}}'
1 Like

Thanks man!

no worries. Just edited the solution so nobody else has a issues :wink:

1 Like

I know this is an old thread, but I am looking for the same thing. Are you able to show your automation and url on how you are doing this?

1 Like