Hello,
Edit: I missed the last line, where you already solved it. I will leave this wall of text here, as it may be helpful to issues other than what you had
)
I got the icons from the thread for Template Example: Weather Binding. At the top of that thread, it shows where to extract the files.
In my example, I am using the ‘colorful’ icon set I believe. After you extract the files, you should have /etc/openhab2/html/images directory, with several subdirectories for colorful, dark, flat_white, etc. So if you want to use the colorful icons, you will need an /etc/openhab2/html/images/colorful directory.
The problems that I had are related to the fact that the image file used is based on the name of the weather condition. The names that come from your weather binding have to match the names of the files. In the original thread, it used the following code:
<img src="{{ServerPath}}/images/{{IconSet}}/{{itemValue('Condition1').replace(' ','-') | lowercase }}.png"/>
The replace(’ ‘,’-') stuff would change it so that if the condition was “partly cloudy” it would use the string “partly-cloudy”. That worked fine, except I found on my system when I had conditions with multiple spaces, it didn’t work correctly. (“chance of rain” became “chance-of rain”) I changed the code, which should be in my json, to use:
<img src="{{ServerPath}}/images/{{IconSet}}/{{itemValue('Weather_Condition1').split(' ').join('-') | lowercase }}.png"/>
The split and join seemed to work really well. That covered most of the problems, but I still had issues when the weather condition did not have a corresponding file. The icon set is good, but since it uses the names for the conditions, those names will change slightly based on which weather binding you use. I am using weather underground for my binding, which worked most of the time. If I got a broken image link, I would look at the name of the weather condition, and make sure a file existed to cover that condition.
For example, when I got a condition for “chance of a thunderstorm”, it showed a broken image link, as there is no “chance-of-a-thunderstorm.png” file. I copied an existing icon with a different name to cover the exact text of the condition I was missing. In that case, I think I used the cloudy icon, but you could use whatever one makes sense to you.