Hi all, and thanks @bastiaan_van_h for this widget! It is my first attempt at personalization of the HABPanel and so I followed your GitHub instructions to the letter.
So that’s what happened to me: I registered to OWM, got my API key, and registered the binding. It took a while before the binding went online. I then set up the two items properly and the full 4 icons appeared. Yey!
I had the service up and running for the last days and now the forecast in the panel does not update properly. I see in Paper Ui that the info is pulled up properly and regularly, but the panel is stuck with the “1st forecast”.
Here below I paste the screenshots of the Panel and the UI results.
My bad… For some reason the edits on the ID were not retained in the .items file. This explained why I had some values to start with and they went “expiring”.
Now I fixed the ID but in my panel I still see two “tomorrow” forecasts and this is due to the widget code, showing 3h and 24 hours from latest update. I am going to think about how to select appropriate timestamps for daily forecasts.
Thanks again for the fantastic job, this is helping my learning curve around several aspects of OpenHAB.
Thanks Sebastian, this is the first weather example that I managed to get to work. Really clear explanation in your blog and GitHub readme. Well done …i had it working within a couple of hours from scratch. Previously failed ForecastIo, Dark Sky and the normal weather map binding. You took all the hard work away!
Thanks for the hard work to make this widget happen but I do have issues with the days. Not only 2 times the same day but also the other days are not correct. I have downloaded the newest version of the owm.controller.js but that is not solving my problem.
Its working like charm on my ios 9.5 device. One thing… I have been writing with OWM, and they say that there is a Danish translation ready, is it possible to add this translation to this binding?
Hello,
I am very new in using openhab. I hope somebody can help me with my problem.
My weather widget looks like this in the moment:
So I have the problem that I can’t get the Icons for current, 3h and 24h.
I think my owm-widget.items file is okay, but I do not have channels for the
weatherconditionID in paperUI for current, 3h and 24h weather…!?
So I can’t link it…!?
I’m playing with habpanel and found your widget and looks great, but seen issue also reported here - currently (it’s 20:20 at my place) I see two entries for Thursday - so Thursday | Thursday | Friday | Saturday
I did a quick spike and it seems as code does not take the optimal forecast - in my case, as said above it’s 20:20 and my 3h forecast (Weather_OWM_DateTime_h3) is at 01.01.2020 22:00 - which I would expect the widget would take to display.
But
today = new Date();
nextDay = new Date();
nextDay.setDate(today.getDate() + day);
nextDay.setHours(12);
var diffHours = Math.ceil(Math.abs(today.getTime() - nextDay.getTime()) / (1000 * 3600));
will calculate my current diff for today to 8 hours => abs(12:00 - 20:00) = ~8h.
And func getClosest will return 9h as the closest - resulting in taking 9h forecast - which is at 02.01.2020 04:00 - therefore I see two Thursday(s) I guess since the forecast is already for tomorrow.
Does above makes sense?
EDIT: not sure if this is the correct place to discuss this? maybe another thread or github?
Hello,
This widget looks really great and I really want to install it and make it work for me. Unfortunately, I’m not able to configure it for two days now :(. I did two installs of OH2 (2.4 and 2.5), did the exact steps in the Readme from the central repo, but the result is one and the same:
hello, has anyone managed to clear this issue with the next day that it is shown two times?
i have the same problem, today its ok, tomorrow and the day after tomorrow have the same name even the temp is different and the names of the next two days are ok.
looking in paper ui right now i see that the OpenWeatherMap Account thing is shown with grey color offline and the Local weather and forecast thing same, grey color but marked as unknown
although the habpannel displays some values
restarted oh several times …
any help please?
thanks
Could you please tell us if know your weather is displayed ok? I would also like to display today and the next three days instead of 4. What did you modify in the configuration and how many hours have you set? 72/1?
Thanks!
I had the same problem.
It’s most likely because you downloaded weather-icons-master.zip to your pc and unzipped it there and then copied the folder over to your openhab installation. Instead copy the .zip file into the folder /html/openweathermap/ then use your openhab computer to unzip the folder (not your pc).
Cheers
I took a different approach, avoiding messing with Date objects, since we only care about the number hours to the next day at noon. This fixes the duplicate day issue for me.
function loadOwmForecast() {
console.log("Processing OWM widget forecast");
try {
var today = new Date();
var hoursToNoon = (24 - today.getHours()) + 12;
for (var day = 0; day < 4; day++) {
setForecastItems(day, getClosest(hoursToNoon + (day * 24)));
}
} catch (err) {
console.log("Error during OWM widget: " + err)
}
}