OpenWeatherMap daily forecasts with free API using plain OpenHAB rules

It’s not your API key but the Thing ID of your OWM binding. You can see the Thing ID for any thing defined when opening the thing overview in Paper UI at http://[your OpenHAB server name or IP address goes here]:8080/paperui/index.html#/configuration/things - look for the Thing ID in the overview, search “openweathermap” to narrow the set of things. It’s the 8-character identifier you find in all 3 items (the binding, the weather items and the UV items).

I created my a openweathermap.things myself (I come from Openhab 1.x and was used to create alle files myself at that time). Things became visible in Paper UI like you described however without Thing ID.

Now removed my Thing-file, Things in Paper UI and the openweathermap binding. Restarted my system and installed the openweathermap binding from scratch. Created new things:

Openweathermap

The thing ID of both things is not the same. Is that correct?
I used the thing ID from the Weather And Forecast thing.

I do have Current Weather data in my openweathermap.sitemap (a temporary sitemap copied from your example). But no Forecast nor Graphs with data.

It’s weird that both Thing IDs are different. Are you sure that you didn’t use/define the OWM account elsewhere?

Please use the Thing ID ending in “d5” and report.

I already did and “d5” didn’t work at all.

I deleted and recreated the things for another time but they don’t work anymore. Today i don’t have that much time. First gonna try to create them again with the same Thing ID.

Is it possible to send a printscreen so I can compare the exact definition/description with yours? Of course with blanked ID.

Mayby I have tot remove items and sitemap too?
Could it be wise to clear logs too? How to do that? Just delete the log-files?

Did you find a solution in the meantime ?

My owm.things look like:

Bridge openweathermap:weather-api:api "OpenWeatherMap Account" [apikey="your api-key from OWM 32 char", refreshInterval=30, language="de"] {
     Thing weather-and-forecast local "Local Weather And Forecast" [location="xx.xxxxxx,y.yyyyyy,zzz", forecastHours=120, forecastDays=0]
     Thing uvindex local "Local UV Index" [location="xx.xxxxx,y.yyyyyyyy", forecastDays=7]
}

and an item with the corresponding Thing-Channel (weather-and-forecast) looks like:

Number:Temperature   localCurrentTemperature                 "Aktuelle Temperatur [%.1f %unit%]"                            <temperature> (gOWM)  { channel="openweathermap:weather-and-forecast:api:local:current#temperature" }
Number:Temperature   localHourlyForecast3Temperature         "Temperatur in 03 Stunden[%.1f %unit%]"                        <temperature> (gOWM)  { channel="openweathermap:weather-and-forecast:api:local:forecastHours03#temperature" }
Number:Temperature   localHourlyForecast6Temperature         "Temperatur in 06 Stunden [%.1f %unit%]"                       <temperature> (gOWM)  { channel="openweathermap:weather-and-forecast:api:local:forecastHours06#temperature" }


and for an item for uv-index it then looks like:

Number               localCurrentUVIndex                     "Aktueller UV Index [%d]"                                         <uv_index>     (gOWM)  { channel="openweathermap:uvindex:api:local:current#uvindex" }
Number               localTomorrowUVIndex                    "Morgen UV Index [%d]"                                            <uv_index>     (gOWM)  { channel="openweathermap:uvindex:api:local:forecastTomorrow#uvindex" }


Hope this can help you.
Cheers,
Peter

EDIT:


The red marked Part is what you can copy in your item-channel-information.

owm

API key for free API configured in “OpenWeatherMap Konto”.
Both OWM things seem to be ok (Online).
I downloaded both files, copied the sitemap and replaced the “77xxxx” in the item file.

No data / values show in the sitemap…


How can I troubleshoot this?

some success… I forgot to remove “local” from the channels in the item file, since my things weren’t created manually.

Now “Current weather” has data!

Still, NO data in “Forecast”… ???

Forecast data appeared after some time as well !!

Hey,
I have problem with this thing.
No forecast data is showing. Only Temperature Low.
But data is collected. I see it in LOG.
Actual weather is ok, graphs are laso OK.
But no forecast data??

@shutterfreak

How do I change from Celcius to Farenheit?

And my graphs are not displaying information. Is there something I should look at?

I can’t get forecast to run, i noticed today I have an error:
Rule ‘Group-based weather forecast processing’: Could not cast NULL to java.lang.Number; line 136, column 16, length 15

which is

    items.map[ state as Number ].reduce[ min, v |
1 Like

Got the same issue here:

Got no persistence configured though. is this a requirement ?
Openhab 2.5.3

Just feeling stupid right now.
After activation of debug-mode, the logs show, that the item causing trouble is Wx_OWM_Forecast_Temperature_99h.

This item can never gat any other value than null, because the configuration limits the requests to 96 hours. After changing this to 120hours71 day it worked perfectly

Yep that fixed mine as well. Feel dumb not seeing it too. Looks like I need to fix pressure, has like 20 digits past the decimal lol. Thank you!

I need your help. I’ve the same problem that the values above 24h are null.
Where can I change the limit?

Open Paper UI (or HABmin). Go to Configuration > Things and edit “ Local weather and forecast”. Scroll down and set “number of hours” to a higher value (free plan: max. 120 hours). Unless you want only the daily forecasts, then set the number of days. To my knowledge you must leave ond of the options to 0 (you can’t choose hourly and daily forecasts at the same time, at least not with the free plan)

Something may have changed, but my understanding is that the days must be 0.

Thank you for your answer. This is my Configuration and after create the files again and wait one Day I have values in the forecast.

Bridge openweathermap:weather-api:api "OpenWeatherMap Account" [ apikey="123456789876543223456789876543", refreshInterval=30, language="de" ] { Thing weather-and-forecast local "Weather/Forecast" [ location="xx.xx,yy.yy", forecastHours=120, forecastDays=0 ] Thing uvindex local "UV Index" [ location="xx.xx,yy.yy", forecastDays=7 ] }

Now I will try the persistence and HabPanel…

If you are just starting with OH, you will be better off using scripted automation for rules, rather than the old rules DSL.

Then you can use this…

I added daily forecasts to the binding now using the new One Call API. A beta is available for testing. Find details here:

4 Likes