I enjoy the OpenWeatherMap binding long time. But now my wife asked me, why there is a sun visible during the night in the HABpanel widget for the current weather. Here is an example:
Wouldn’t it be appropriate to see a moon instead of a sun at midnight? Not sure if it is a bug. Do you have feedback for my wife?
weather data and icon is taken from the openweathermap service. You can check the data and icon openweathermap provides for your location at https://openweathermap.org. If the Icon you see in openHAB is the same as the one shown on the openweathermap website, then it’s not a bug. If the website shows a moon icon while openHAB shows a sun icon, then there could be a bug in the binding.
Be aware that the binding fetches new data only once every hour, so the data shown on the website and the data in openHAB might differ slightly.
The original openweathermap icon was o.k. (a moon) last night. But the openweathermap widget doesn’t show the original openweathermap icons, instead nice icons from here are used.
You can see in the screenshot above that the IconId was “01n”. According to my understanding it indicates the night, so I believe the problem is related to the widget (maybe IconId not considered), not to the binding.
If anyone is still interested in the fix, I think I found one. Both ConditionId and ConditionIconId must be considered to work properly. Current code consider only ConditionId and that’s why the night icons does not work. Fix the widget code only, no change to “owm.controller.js”