[SOLVED] Openweathermap: forecastDays is to 5 but value in Things is 0

Platform information: openhabian latest

Hardware: Desktop PC
OS: gentoo linux 64 bit
Java Runtime Environment: zulu latest
openHAB version: 2.5.0-1

Although I have forecastDays=5 in Configuration/Things/Edit/Local Weather And Forecastopenweathermap.things value of Number of Days is always 0. From where comes this value?

In /var/lib/openhab2/jsondb/org.eclipse.smarthome.core.thing.link.ItemChannelLink.json there is no openweathermap entry.

Things

Bridge openweathermap:weather-api:api "OpenWeatherMap Account" [apikey="xxxxxxxxxxxxxxx", refreshInterval=60, language="en"] {
    Thing weather-and-forecast local "Local Weather And Forecast" [location="42.93762028780671,24.405533179369982", forecastHours=3, forecastDays=5]
    Thing uvindex local "Local UV Index" [location="42.93762028780671,24.405533179369982", forecastDays=5]
}

sitemap

 Frame label="Local Weather Station" {
        Text item=localStationId
        Text item=localStationName
        Mapview item=localStationLocation
    }
 Frame label="Current local weather" {
        Text item=localLastMeasurement
        Text item=localCurrentCondition
        Image item=localCurrentConditionIcon
        Text item=localCurrentTemperature
        Text item=localCurrentPressure
        Text item=localCurrentHumidity
        Text item=localCurrentWindSpeed
        Text item=localCurrentWindDirection
        Text item=localCurrentCloudiness
        Text item=localCurrentRainVolume
        Text item=localCurrentSnowVolume
        Text item=localCurrentVisibility
    }
    Frame label="Local forecast for today" {
        Text item=localDailyForecastTodayTimestamp
        Text item=localDailyForecastTodayCondition
        Image item=localDailyForecastTodayConditionIcon
        Text item=localDailyForecastTodayMinTemperature
        Text item=localDailyForecastTodayMaxTemperature
        Text item=localDailyForecastTodayPressure
        Text item=localDailyForecastTodayHumidity
        Text item=localDailyForecastTodayWindSpeed
        Text item=localDailyForecastTodayWindDirection
        Text item=localDailyForecastTodayCloudiness
        Text item=localDailyForecastTodayRainVolume
        Text item=localDailyForecastTodaySnowVolume
    }
    Frame label="Local forecast for tomorrow" {
        Text item=localDailyForecastTomorrowTimestamp
        Text item=localDailyForecastTomorrowCondition
        Image item=localDailyForecastTomorrowConditionIcon
        Text item=localDailyForecastTomorrowMinTemperature
        Text item=localDailyForecastTomorrowMaxTemperature
    }
    Frame label="Local forecast in 2 days" {
        Text item=localDailyForecastDay2Timestamp
        Text item=localDailyForecastDay2Condition
        Image item=localDailyForecastDay2ConditionIcon
        Text item=localDailyForecastDay2MinTemperature
        Text item=localDailyForecastDay2MaxTemperature
    }

Items

String localStationId "ID [%s]" { channel="openweathermap:weather-and-forecast:api:local:station#id" }
String localStationName "Name [%s]" { channel="openweathermap:weather-and-forecast:api:local:station#name" }
Location localStationLocation "Location [%2$s°N %3$s°E]" <location> { channel="openweathermap:weather-and-forecast:api:local:station#location" }

DateTime localLastMeasurement "Timestamp of last measurement [%1$tY-%1$tm-%1$tdT%1$tH:%1$tM:%1$tS]" <time> { channel="openweathermap:weather-and-forecast:api:local:current#time-stamp" }
String localCurrentCondition "Current condition [%s]" <sun_clouds> { channel="openweathermap:weather-and-forecast:api:local:current#condition" }
Image localCurrentConditionIcon "Icon" { channel="openweathermap:weather-and-forecast:api:local:current#icon" }
Number:Temperature localCurrentTemperature "Current temperature [%.1f %unit%]" <temperature> { channel="openweathermap:weather-and-forecast:api:local:current#temperature" }
Number:Pressure localCurrentPressure "Current barometric pressure [%.1f %unit%]" <pressure> { channel="openweathermap:weather-and-forecast:api:local:current#pressure" }
Number:Dimensionless localCurrentHumidity "Current atmospheric humidity [%d %unit%]" <humidity> { channel="openweathermap:weather-and-forecast:api:local:current#humidity" }
Number:Speed localCurrentWindSpeed "Current wind speed [%.1f km/h]" <wind> { channel="openweathermap:weather-and-forecast:api:local:current#wind-speed" }
Number:Angle localCurrentWindDirection "Current wind direction [%d %unit%]" <wind> { channel="openweathermap:weather-and-forecast:api:local:current#wind-direction" }
Number:Dimensionless localCurrentCloudiness "Current cloudiness [%d %unit%]" <clouds> { channel="openweathermap:weather-and-forecast:api:local:current#cloudiness" }
Number:Length localCurrentRainVolume "Current rain volume [%.1f %unit%]" <rain> { channel="openweathermap:weather-and-forecast:api:local:current#rain" }
Number:Length localCurrentSnowVolume "Current snow volume [%.1f %unit%]" <snow> { channel="openweathermap:weather-and-forecast:api:local:current#snow" }
Number:Length localCurrentVisibility "Current visibility [%.1f km]" <visibility> { channel="openweathermap:weather-and-forecast:api:local:current#visibility" }

DateTime localDailyForecastTodayTimestamp "Timestamp of forecast [%1$tY-%1$tm-%1$td]" <time> { channel="openweathermap:weather-and-forecast:api:local:forecastToday#time-stamp" }
String localDailyForecastTodayCondition "Condition for today [%s]" <sun_clouds> { channel="openweathermap:weather-and-forecast:api:local:forecastToday#condition" }
Image localDailyForecastTodayConditionIcon "Icon" { channel="openweathermap:weather-and-forecast:api:local:forecastToday#icon" }
Number:Temperature localDailyForecastTodayMinTemperature "Minimum temperature for today [%.1f %unit%]" <temperature> { channel="openweathermap:weather-and-forecast:api:local:forecastToday#min-temperature" }
Number:Temperature localDailyForecastTodayMaxTemperature "Maximum temperature for today [%.1f %unit%]" <temperature> { channel="openweathermap:weather-and-forecast:api:local:forecastToday#max-temperature" }
Number:Pressure localDailyForecastTodayPressure "Barometric pressure for today [%.1f %unit%]" <pressure> { channel="openweathermap:weather-and-forecast:api:local:forecastToday#pressure" }
Number:Dimensionless localDailyForecastTodayHumidity "Atmospheric humidity for today [%d %unit%]" <humidity> { channel="openweathermap:weather-and-forecast:api:local:forecastToday#humidity" }
Number:Speed localDailyForecastTodayWindSpeed "Wind speed for today [%.1f km/h]" <wind> { channel="openweathermap:weather-and-forecast:api:local:forecastToday#wind-speed" }
Number:Angle localDailyForecastTodayWindDirection "Wind direction for today [%d %unit%]" <wind> { channel="openweathermap:weather-and-forecast:api:local:forecastToday#wind-direction" }
Number:Dimensionless localDailyForecastTodayCloudiness "Cloudiness for today [%d %unit%]" <clouds> { channel="openweathermap:weather-and-forecast:api:local:forecastToday#cloudiness" }
Number:Length localDailyForecastTodayRainVolume "Rain volume for today [%.1f %unit%]" <rain> { channel="openweathermap:weather-and-forecast:api:local:forecastToday#rain" }
Number:Length localDailyForecastTodaySnowVolume "Snow volume for today [%.1f %unit%]" <snow> { channel="openweathermap:weather-and-forecast:api:local:forecastToday#snow" }

DateTime localDailyForecastTomorrowTimestamp "Timestamp of forecast [%1$tY-%1$tm-%1$td]" <time> { channel="openweathermap:weather-and-forecast:api:local:forecastTomorrow#time-stamp" }
String localDailyForecastTomorrowCondition "Condition for tomorrow [%s]" <sun_clouds> { channel="openweathermap:weather-and-forecast:api:local:forecastTomorrow#condition" }
Image localDailyForecastTomorrowConditionIcon "Icon" { channel="openweathermap:weather-and-forecast:api:local:forecastTomorrow#icon" }
Number:Temperature localDailyForecastTomorrowMinTemperature "Minimum temperature for tomorrow [%.1f %unit%]" <temperature> { channel="openweathermap:weather-and-forecast:api:local:forecastTomorrow#min-temperat$
Number:Temperature localDailyForecastTomorrowMaxTemperature "Maximum temperature for tomorrow [%.1f %unit%]" <temperature> { channel="openweathermap:weather-and-forecast:api:local:forecastTomorrow#max-temperat$


DateTime localDailyForecastDay2Timestamp "Timestamp of forecast [%1$tY-%1$tm-%1$td]" <time> { channel="openweathermap:weather-and-forecast:api:local:forecastDay2#time-stamp" }
String localDailyForecastDay2Condition "Condition in 2 days [%s]" <sun_clouds> { channel="openweathermap:weather-and-forecast:api:local:forecastDay2#condition" }
Image localDailyForecastDay2ConditionIcon "Icon" { channel="openweathermap:weather-and-forecast:api:local:forecastDay2#icon" }
Number:Temperature localDailyForecastDay2MinTemperature "Minimum temperature in 2 days [%.1f %unit%]" <temperature> { channel="openweathermap:weather-and-forecast:api:local:forecastDay2#min-temperature" }
Number:Temperature localDailyForecastDay2MaxTemperature "Maximum temperature in 2 days [%.1f %unit%]" <temperature> { channel="openweathermap:weather-and-forecast:api:local:forecastDay2#max-temperature" }


String kavalaCurrentCondition "Current condition in Kavala [%s]" <sun_clouds> { channel="openweathermap:weather-and-forecast:api:kavala:current#condition" }
Image kavalaCurrentConditionIcon "Icon" { channel="openweathermap:weather-and-forecast:api:kavala:current#icon" }
Number:Temperature kavalaCurrentTemperature "Current temperature in Kavala [%.1f %unit%]" <temperature> { channel="openweathermap:weather-and-forecast:api:kavala:current#temperature" }


String kavalaHourlyForecast03Condition "Condition in Kavala for the next three hours [%s]" <sun_clouds> { channel="openweathermap:weather-and-forecast:api:kavala:forecastHours03#condition" }
Image kavalaHourlyForecast03ConditionIcon "Icon" { channel="openweathermap:weather-and-forecast:api:kavala:forecastHours03#icon" }
Number:Temperature kavalaHourlyForecast03Temperature "Temperature in Kavala for the next three hours [%.1f %unit%]" <temperature> { channel="openweathermap:weather-and-forecast:api:kavala:forecastHours03#tempe$

String kavalaHourlyForecast06Condition "Condition in Kavala for hours 3 to 6 [%s]" <sun_clouds> { channel="openweathermap:weather-and-forecast:api:kavala:forecastHours06#condition" }
Image kavalaHourlyForecast06ConditionIcon "Icon" { channel="openweathermap:weather-and-forecast:api:kavala:forecastHours06#icon" }
Number:Temperature kavalaHourlyForecast06Temperature "Temperature in Kavala for hours 3 to 6 [%.1f %unit%]" <temperature> { channel="openweathermap:weather-and-forecast:api:kavala:forecastHours06#temperature" }


DateTime localCurrentUVIndexTimestamp "Timestamp of last measurement [%1$tY-%1$tm-%1$td]" <time> { channel="openweathermap:uvindex:api:local:current#time-stamp" }
Number localCurrentUVIndex "Current UV Index [%d]" { channel="openweathermap:uvindex:api:local:current#uvindex" }

DateTime localForecastTomorrowUVIndexTimestamp "Timestamp of forecast [%1$tY-%1$tm-%1$td]" <time> { channel="openweathermap:uvindex:api:local:forecastTomorrow#time-stamp" }
Number localForecastTomorrowUVIndex "UV Index for tomorrow [%d]" { channel="openweathermap:uvindex:api:local:forecastTomorrow#uvindex" }

Maybe because you created the Thing in things file?

Dose the forecast work as you defined it in your things file?

Daily forecasts are not available to Free API users.
Hourly forecasts are … up to a couple of days ahead.

1 Like

If you need or want daily forecast take a look at Darksky.

Works good but you may wan to filter the logs unless you don’t mind the constant updates shown. BTW you only need to use “local” as a filter for all items if using the docs item examples.

EDIT:
@hariskar here is the tutorial to filter the logging (took a minuet to find) if you decide to use it.

You will not have to type in each item as I mentioned above just use the local. If you need help or want to see my setup just let me know. BTW you can filter the logs for any item. :wink:

1 Like

@hariskar there is also Weather Binding without API Key if you use metric system. I’m in US and did not see units in standard so DarkSky was my choice and so far it’s been good.

1 Like

Thank you for all replies!
Yes I have a free account, so that is why I can not even set days to number bigger than 0? It becomes 0 from openweathermap website?
It works without problems for current day. I started adding hours and till now I am at 12 hours. So I have to edit openweathermap.items to add all those hours? It will need much time.

I do not use this binding so not sure.

Give DarkSky a try and see if that works for you. You can set it up in just a few minuets by copying the examples in the docs and change only the secret key and location.

1 Like

You don’t have to add them all, only what you are interested in. 24hrs for example.

1 Like

I installed Dark sky, it receives data from the same station with openweathermap but I prefer it because it has daily weather and alerts.

Only I get some errors:

2020-01-10 18:37:18.820 [WARN ] [mon.registry.AbstractManagedProvider] - Could not update element with key darksky:weather-and-forecast:api:local in ManagedThingProvider, because it does not exists.

2020-01-10 18:38:12.524 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 18:38:12.526 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localStationId' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 18:38:12.528 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localStationId' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 18:38:12.530 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localStationId' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 18:38:12.532 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 18:38:12.534 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localStationName' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 18:38:12.536 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localStationName' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 18:38:12.537 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localStationName' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 18:38:12.540 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.sitemap.Mapview

2020-01-10 18:38:12.542 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localStationLocation' for widget org.eclipse.smarthome.model.sitemap.sitemap.Mapview

2020-01-10 18:38:12.544 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localStationLocation' for widget org.eclipse.smarthome.model.sitemap.sitemap.Mapview

2020-01-10 18:38:12.545 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localStationLocation' for widget org.eclipse.smarthome.model.sitemap.sitemap.Mapview

2020-01-10 18:38:12.547 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localStationLocation' for widget org.eclipse.smarthome.model.sitemap.sitemap.Mapview

2020-01-10 18:38:12.593 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 18:38:12.595 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localDailyForecastTodayMinApprentTemperature' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 18:38:12.597 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localDailyForecastTodayMinApprentTemperature' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 18:38:12.598 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localDailyForecastTodayMinApprentTemperature' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 18:38:12.599 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 18:38:12.601 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localDailyForecastTodayMaxApprentTemperature' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 18:38:12.602 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localDailyForecastTodayMaxApprentTemperature' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 18:38:12.604 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localDailyForecastTodayMaxApprentTemperature' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

Yep I see those when I open the sitemap to view the weather. I haven’t took the time to fix it and just ignore them for now. If/when I get it working without those msg I’ll let you know.

My errors:

2020-01-10 10:47:23.130 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 10:47:23.133 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localDailyForecastTodayMinApprentTemperature' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 10:47:23.136 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localDailyForecastTodayMinApprentTemperature' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 10:47:23.139 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localDailyForecastTodayMinApprentTemperature' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 10:47:23.143 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 10:47:23.147 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localDailyForecastTodayMaxApprentTemperature' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 10:47:23.150 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localDailyForecastTodayMaxApprentTemperature' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

2020-01-10 10:47:23.154 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'localDailyForecastTodayMaxApprentTemperature' for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

Glad you like the binding. :+1:

BTW, I placed the weather in a seperate sitemap so this only shows when I look at the weather.

It works, except:

**Local Weather Station**

localStationId

localStationName

localStationLocation

and some other values that look like undefined in basicui/app

I just removed that part as I really didn’t want or need the info.

OK,
localDailyForecastTodayMinApprentTemperature
and
localDailyForecastTodayMaxApprentTemperature

look also undefined, should I remove them too?

Those are undefined for me as well but I haven’t removed them yet. Was waiting to see if anything would change but looks like I may go ahead and delete them.

1 Like

OK, at least I did not mess things up if you have this too!
Thank you!

Your welcome. :smiley:

If this solves your weather issue please click the square box on post that provided the solution to mark topic solved.

Thanks

This line

Number localCurrentUVIndex "Current precipitation probability [%d]" <none> { channel="darksky:weather-and-forecast:api:local:current#uvindex" }

has to be changed to

Number localCurrentUVIndex "Current UV index [%d]" <none> { channel="darksky:weather-and-forecast:api:local:current#uvindex" }
1 Like

and in sitemap:

        Text item=localDailyForecastTodayMinApprentTemperature
        Text item=localDailyForecastTodayMaxApprentTemperature

to

        Text item=localDailyForecastTodayMinApparentTemperature
        Text item=localDailyForecastTodayMaxApparentTemperature

Should I edit the page https://www.openhab.org/addons/bindings/darksky/ to correct these?

So only

        Text item=localStationId
        Text item=localStationName
        Mapview item=localStationLocation

are undefined. Any idea how we could fix that?

1 Like

Nice catch on the spelling. :+1:

Yes, it’s allway’s good to have the correct info in docs. :wink:

@hariskar: Here’s a link you may like if you want to customize your sitemap. https://darksky.net/widgets

Haven’t tried it yet but looks nice.

1 Like