2023.7 image entity local image

Hi, i cant seem to create an image template with local image located in “/local/images/image.png”, it just displays the name i specified. Any tips? I dont want to point to external url.

- image:
    url: local/images/wifi.png
    name: "guestwifi"

just displays this:
obrazek

Thanks

/local maps to config/www. You have to restart home assistant after creating the www folder for this to work.

I have that image in that folder for many versions, so thats not the problem. Also tried /config/www/images but that doesnt work either.

The file and path are case sensitive. So something like wifi.png is not the same as wifi.PNG

Also what sort of installation do you have, core, container, supervised, HAOS?

See this solution for the core installation type:

I’m on HassOS. Just copied the path and file name, restarted home assistant but still doesnt work:)
Anything im missing?
obrazek

Cab]n you show the full card config?

Here it is, but it doesnt work even in entity viewer in entity list.
obrazek

If i put in a link pointing to image on the internet, it works just fine when i click on the card.

- image:
    url: https://design.home-assistant.io/images/logo-variants.png
    name: "guestwifi"

obrazek

I don’t know if the entity card can show an image. Or even if the more info card has been updated to show this new integration.

Could be a frontend bug.

Well its working with direct link to an image, like i posted in previous reply:) But i dont want that
If u use picture card that points to /local/images/wifi.png it works, but cant click it to show larger image

I think the problem is that /local is a path, not a URL.

Yeah, if it was called uri I’d expect a file path to be accepted too.

Ildar, I don’t disagree with your need though: I path (local file path or relative URL path) would make sense, but I’m just being pedantic here. The key would have to be renamed.

Agree, path & url are different terms; then this option should be renamed to smth which stands both for "/local/… " and “pure url”.

Yes, URI would cover that. :slight_smile: See the “URI Reference” here.

EDIT: HA fancies using the term “resource” instead.

“source” could be used too imho

besides that key word (btw, there is another variant in core for that too) there is a more fundamental challenge with those served images, and that has more serious implications: HTTP - Home Assistant

the files in www, or /local, are not protected.Thats why I had tried to first serve those from within the folder I save my snapshots in, in the /media share (opposed to the /config share).

But that requires one to always use a secure connection over https://, and I don’t do that locally, so my Frontend shows the broken image placeholder.

For now, Ive moved to the local version instead, but maybe some of the other options allow us to use the /media path and still be on http:// connection.


yes:

camera:

  - platform: local_file
    file_path: /media/snapshots/camera_oprit.jpg

fles that challenge. It allows to use the protected /media source files, and still have an updated image in the Frontend.

Just thought this could be helpful in the quest for serving those images and keep safe.
(there is ofc another ‘issue’ with the solution for the /media solution: it does not show the date of the taken snapshot as the new image format does, it shows the state of the camera. Why it does that I am not sure, but that is what is does…)