Possibility to add image from Media Browser on Picture Card

Have a possibility to add an image from the Media Browser (not available under www-root for unauthenticated users). A similar integration as when we can add a Media Browser image to an notification-message via the URL: /media/local/image.jpg
Some magic needs to be done to get the auth-token applied to the URL i guess.

See my thread here:

With all the recent improvements to the media library and allowing media uploads via the frontend, would love to see this implemented!

3 Likes

I’m also trying to display an image from /media to a lovelace card but I miserably failed. Is this still not possible ???

Looks like this isn’t possible yet.

I’m trying to find a way to set up a picture entity card using an image that can only be obtained if the user is authenticated. Using the media_source:// URI scheme described in Media Source docs doesn’t work. My browser makes the request, and returns an error:

GET media-source://media-source/local/kids_room.jpeg net::ERR_UNKNOWN_URL_SCHEME

I’ve also tried the URL that the image is loaded from when I open the image in the media browser, but without the authentication token (which is only short lived, and coding that in would be a bad idea anyway), it won’t load.

GET http://10.0.1.2:8123/media/local/kids_room.jpeg 401 (Unauthorized)

I’ve not really been able to hack together any solution so far that doesn’t involve putting the image in a public folder that can be accessed without any authentication.

2 Likes

This needs to be looked at.
Seeing a dashboard already requires a user to login, so access to media folder should be granted by such action. That means files from media folder should be possible to be linked to a dashboard card.

Forcing all files to be hosted from public www folder is a security concern.

1 Like

Any update on this?

This needs to be added to the top of the next WTH list.

I just reported this as a bug in github as what the docs explain is not working. Feel free to put some love there :slight_smile:

1 Like

I had this same issue but another solution was found elsewhere on the forums:

The used the Local File integration, to setup the image as a ā€œCameraā€ then used the camera_image in the picture elements card instead.

It’s a little extra setup, but it keeps the file from needing to be publicly accessible or using a custom integration.

I’m wondering if something similar can be used for notifications.

Example: Localfile entity ā€œlastdoorbellringā€ with /media/camera/frontdoor-bell.jpg

I came to the same solution but cannot figure out when the image shown through the Localfile integration is updated. Sometimes it seems to run 2 or 3 doorbells ā€œbehindā€

I’ve added a first round of support for this in next release (2025.8)

For the moment it’s limited to picture card only, and it doesn’t have a good UI yet, but will continue building it out a little more in the editor and other cards in future updates.

2 Likes

I built a card for this. It’s called Home Assistant Media Card and it’s available on HACS. markaggar/ha-media-card: A Home Assistant front end card that allows you to browse to your HA Media folder and select images and videos that autoplay and refresh. Something that should have probably been built into Home Assistant!

2 Likes