The layout did not fit my screen either, so I arranged the code within habpanel editor.
You don’t see it, but the icons are even animated
see here:
My habpanel code for the upper part of th weather widget:
Please note: I habe changed the image syntax to match the animated icons - the original syntax is included in the commented lines (
Thank you @NCO, I spent time last night looking through the code and at w3schools.com trying to figure it out. I didn’t see the grid system link you mentioned so I’ll take a peek.
It’s nearly impossible to build a widget that looks great on all kinds of different screen sizes. Making it tailor fit for your need and learning some basic html5 / angular / css / bootstrap coding a long the way is a bonus. Great to see you guys going into the source code
@bastiaan_van_h, I considered that but was afraid it would undo what I’ve done so far.
With @NCO’s encouragement (and a good website link) I have actually been able to figure it out. Here’s where I stand now:
I did it by splitting the current weather conditions into three <div>s with the icon and weather condition in their own rather than sharing one. I then fidgeted with the size of each one till I got it right.
Then I commented out the condition text for the forecast to save space and I bumped the font size down for the temp.
It all fits on my RPi 7" Touch Screen now!
In case anyone else is trying, here’s my code for the widget:
It really is! You did a great job getting this set up, I just needed to come to understand bootstrap so I could make the adjustments. Thank you very much @bastiaan_van_h for the work you’ve done.
I just implemented the updated Widget. Very nice work!!
It is a decent approach to take the midday temp. I woul still like to see max and min of the day to receive a good forecast.
Also I’ll try to implement rain probability as well.
But awesome Work!! That java is genius
don’t want to disturb but I don’t get the widget working.
Followed the instructions plenty of times. The only thing I get is a blank frame. Not even NULLs or anything:
Question:
Although I have the items file, I can not see any value for these parameters in openhab log.
Furthermore I get following error when setting Hours to 96 and days to 1.
Somehow it doesn’t take the 1 and goes in “unknown” state:
2019-02-19 22:57:34.359 [hingStatusInfoChangedEvent] - 'openweathermap:weather-and-forecast:8ec80e30' changed from UNINITIALIZED (HANDLER_INITIALIZING_ERROR): Duplicate channels openweathermap:weather-and-forecast:8ec80e30:forecastHours27#time-stamp to ONLINE
Thanks. Found the problem. I was reading your tutorial too stryctly and forgot to place the js file in the html folder.
Furthermore, in your items file, I had to remove the “:local”, then the items got populated with data from OWM.
Great widget!!
ps: any idea how I could change the icons to use animated climacons?
I too just got caught out by this. Took me a couple of hours as I was following the instructions directly.
It’s a great widget - thank you, but please can the instructions be updated with the following (perhaps obvious bits of instruction):
make folder conf/html/openweathermap
download/clone/etc the content of https://github.com/BasvanH/habpanel-widget-openweathermap to conf/html/openweathermap
this would populate the ‘images’ folder and the ‘owm.controller.js’ file (as well as a couple of others that aren’t strictly needed)