[SOLVED] Image URL on raspberry HabPanel

i want di display a image file on raspberry ( openhabian )
But when i set widget Image url to “/tmp/image.jpg”
ist this file not found please help

The image must be in your config html folder:

/etc/openhab2/html

And accessed using http://openhabserver:8080/static/image.jpg

openHAB cannot serve or access files outside of this path. It is a security feature. You do not want someone able to access any arbitrary file on your system by just using arbitrary urls.

2 Likes

I have tried migrating my config to a docker container and by shifting files manually gotten most of it working.
I seem to still have issues getting habpanel to render anything from
The html folder (/static/…)
Any guesses on this? Is there a different set of rights to allocate?
Thanks

There shouldn’t be. I’ve run in docker for years and all the files in the html folder should have the same ownership and permissions as everything else. Make sure they are owned by openhab:openhab and it should be fine. I don’t know anything that might be different in HABPanel.

Ok. I copied files over and had to blanket change permissions all over the show.
My docker container runs as openhab:openhab and I have made sure the perms are allocated the same way. (openhab:openhab - even drwxrwxr)
I am able to view a malformed habpanel view, but any files like css and jpgs fail to load.
Any wild guesses what else it could be? - oh and thanks for a very prompt response

Oh - only anomaly is that I run a different default port (8888 instead of 8080)

This should probably be opened as it’s own posting rather than adding a new topic to a year old discussion.

I don’t know anything about HABPanel so I don’t have any suggestions.

Okie - thanks for trying.
I’ll try a few more things before cutting a full cry for help :slight_smile:
Bit frustrating, since I got all the the bits that I expected to be tricky functioning just fine (persistence, bindings etc) have a good evening

Hi, sorry but for me is not working…
I’m using openhabian 3.2.0M4 on raspberry,
I put my rooms images inside the folder …html/ambienti :
image

and use this address in configuration : /etc/openhab/html/ambienti/Esterno.png

but on the card the image in not showed,
what I wrong ??
thanks

I don’t know. That post above was two years ago and I’ve not used HABPanel for quite some time. But this should work.

All I can suggest is double check the URL used. Notice the static part of the url in the post marked as the solution. So for you it would be something like http://<address of OH>:<port>/staic/ambienti/Esterno.png

background: url(’…/static/ambienti/Esterno.png’); should work

yes, you are right, there where a little syntax errore…no problem…
but it still doesn’t work for me,
in my browser i can see this image :
http://192.168.1.67:8080/static/ambienti/Esterno.png
but in tab view image is not loaded with /etc/openhab/html/ambienti/Esterno.png

Im on raspberry with location standard tab view, i’m not using HABpanel
thanks

If you are not using HABPanel then why are you reopening a two year old thread about HABPanel? You should have opened a separate thread and made clear you are talking about MainUI.

What do you mean “not loaded with /etc/openhab/html/ambienti/Esterno.png”? You shouldn’t be entering that path in anywhere. Use the HTTP url.