Place an Image from an External URL in a Card

I think this is going to be an easy answer, but my searches for help have come up empty.

I am using the Discogs Sensor.

There is a monitored_condition called random_record, and within it, there is an image (Sorry about my terminology, I am only new). Here is the JSON for that entity:

{
  "cat_no": "88875150651",
  "cover_image": "https://img.discogs.com/Rk_I49RWcsqUoe_zlz9GzQ4DWqk=/fit-in/300x300/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-7878779-1450759656-6334.jpeg.jpg",
  "format": "Vinyl (LP)",
  "label": "Columbia",
  "released": 2015,
  "attribution": "Data provided by Discogs",
  "identity": "",
  "friendly_name": "Discogs Random Record",
  "icon": "mdi:record-player"
}

I want to display this image (amongst other details) in a card, and can’t figure out how to do it. Please note, this image changes at certain intervals, so I can’t hard code it anywhere, I need to reference the field.

Once again, I have a feeling this is really easy, so sorry to bore all the gurus. But I really would appreciate any assistance.

make it a generic camera and show the camera on a picture-entity card.

camera:
  platform: generic
  still_image_url: "{{ state_attr('sensor.discogssensorname','cover_image') }}"

The still_image_url field accepts templates, even though it doesn’t explicitly say that it does.

1 Like

This works perfectly!

I marked this as a solution because at the moment I believe it is actually the only way to do it. However, to me, it seems to be a bit confusing as it’s not actually a camera. This solution comes across as more of a workaround. Maybe down the track, there might be a different solution.

@petro, Thanks for taking the time to answer my question.

1 Like

Unfortunately, this is not a work around. This is the way to implement an image that changes.

100% agree with you. I am new to this, but owned a web dev company for 15 years. I just think it is a little confusing as is really has nothing to do with a camera.

However, I can’t state enough… This is the correct procedure, and after reading your answer and doing some google searches, I can see that a lot of people use this as the way to show images.

Thanks again.

This solution saved me a lot pain when trying to show my images saved on another device (picture frame) that is served up as http.

Confirmed working through Nabu Casa.

There is now an Image integration, works as above but for still images:

It’s a bit confusing to set up but there are lots of posts in here on how to do it

1 Like