Dashticz / dashticz_v2

Alternative dashboard for Domoticz
107 stars 60 forks source link

OpenWeatherMap in Dashticz #406

Closed turboproc closed 5 years ago

turboproc commented 5 years ago

After reading the message that WU is not providing new API keys anymore, I decided to walk the OWM path and started to modify weather.js until it works with OWM. Not perfect jet but the basic are there. Was just wondering weather I'm working on something that has been done already or whether I should contribute the result.

lokonli commented 5 years ago

OWM has been implemented already in the beta release. See: https://www.domoticz.com/forum/viewtopic.php?f=67&t=24073#p185427

jakenl commented 5 years ago

OWM has been implemented already in the beta release. See: https://www.domoticz.com/forum/viewtopic.php?f=67&t=24073#p185427

However, the OWM 'weather bock' is only showing 4x 3h forecasts instead of the 4 day forecast. I found the presentation of the WU block much more informative. Is it possible to reverse this for OWM?

The OWM weather block is messing my setup of the dashboard: when there is a rain forecast that displays 2 digits (like: 0.18mm rain), it will put the 'mm' on the next line. This increases the height of the block and pushes the blocks below that down.

In weather_owm.js I changed the code for '(Math.round(rain100)/100)' into '(Math.round(rain10)/10)' . In my opinion a 1 digit is more than plenty to see how much rain will fall.In my case, 0 and 1 digit numbers will keep the ' mm' on the same line, meaning that the weather block has the same height in all cases.

Might be worthwhile to make the digits into an option for config.js

aalwash commented 5 years ago

If add this in the configuration, you will see days config['owm_days'] = 4;

And use weather_owm as a block, you should see 4 days