Hello, everyone,
I’m trying to create a local image as a background for a widget.
According to the description, forums, etc., it should be in “/static/Bild.png”. The path is in /etc/openhab/html/.
In the browser I can see the image by entering “IP address/static/image.png”.
However, when I type that in the YAML, the image doesn’t load:
f7 block:
…
styles:
background: url(/static/image.png)
or
background-image: url(/static/image.png)
I’m not sure which openHab installation method you’ve used, but you’re probably not using the correct folder to store the image. If you tried to create the html folder then that is not the correct location, the folder already exists when OH is installed. The html folder you are looking for is inside the conf folder where you find all the other folders related to adding text files (e.g., the items folder or the persistence folder, etc.). I doubt that is just /etc/openhab.
Hi, all my conf files are located in /etc/openhab. There are all Text configs. The html Folder was already created through openhab installation process.
I installed manually since Openhab 1.x
The Folder html and all containing files have the 777 permission and are owned by openhab user.
It’ll be much, much easier for users on this forum to help you debug your code if you put the code in “code fences”. Either push the button in the editor or just put three backticks before and after your code:
```
Your code goes here
```
One of the most important things with code fences is it will preserve the indentation of text and in yaml code the indentation is critical. If I assume the correct indentation, the code you’ve posted works for me with one small change (your relative path to the image has to start with a slash):
If that doesn’t work for you then double check the indentations to make sure they are correct and double check your quotes to make sure that you’re not getting “smart” quote-marks.