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.