OpenWeatherMap Extension - Support for UV Index API

Hello Christoph,thx for reply.
I’m using the Version which comes up with OH2.4, didn’t install any .jar file.

In the meantime i made a workaround within the http.cfg to get the current UV-Index and this works quite fine.

Do you think that it will be part of the next Milestone?

Yes, of course it will.

1 Like

I have searched in my event.log and found no way to determine the image being retrieved.
In the openhab log I filter for the term ‘icon’,the local
sunrise 6:02 AM
sunset 8:54 PM

the change from d to n makes no sense see the log entries below:

It looks like the d icon was present until 04:00 AM and then it went to Night
two hours later at 6:0 AM it really is daylight and the icon is wrong again.

2019-01-14 03:58:29.431 [TRACE] [.connection.OpenWeatherMapConnection] - OpenWeatherMap response: status = 200, content = '{"cod":"200","message":0.0046,"cnt":8,"list":[{"dt":1547391600,"main":{"temp":16.74,"temp_min":16.74,"temp_max":17.06,"pressure":1012.18,"sea_level":1016.55,"grnd_level":1012.18,"humidity":95,"temp_kf":-0.32},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"clouds":{"all":32},"wind":{"speed":7.41,"deg":314.503},"rain":{"3h":0.07},"sys":{"pod":"n"},"dt_txt":"2019-01-13 15:00:00"},{"dt":1547402400,"main":{"temp":14.74,"temp_min":14.74,"temp_max":14.98,"pressure":1015.27,"sea_level":1019.36,"grnd_level":1015.27,"humidity":100,"temp_kf":-0.24},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":76},"wind":{"speed":7.91,"deg":188.503},"rain":{"3h":0.065},"sys":{"pod":"d"},"dt_txt":"2019-01-13 18:00:00"},{"dt":1547413200,"main":{"temp":14.97,"temp_min":14.97,"temp_max":15.13,"pressure":1016.35,"sea_level":10...
2019-01-14 03:58:29.449 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'icon' of group 'current' with new state 'raw type (image/png): 2565 bytes'.
2019-01-14 04:08:31.623 [TRACE] [.connection.OpenWeatherMapConnection] - OpenWeatherMap response: status = 200, content = '{"coord":{"lon":174.82,"lat":-41.23},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"base":"stations","main":{"temp":16,"pressure":1003,"humidity":87,"temp_min":16,"temp_max":16},"visibility":10000,"wind":{"speed":5.7,"deg":20},"clouds":{"all":32},"dt":1547389800,"sys":{"type":1,"id":7358,"message":0.0049,"country":"NZ","sunrise":1547312601,"sunset":1547366093},"id":2186131,"name":"Ngauranga","cod":200}'

any progress on the test jar?

Thanks

Paul

Hi Paul,

Unfortunately I will not have time to work on the OWM binding this week. Maybe on the weekend. I am preparing for an examination.

Keep you posted.

Best, Christoph

After upgrade to OH 2.5.0.M1, i extended my “owm.things” with the uvindex-thing.

Bridge openweathermap:weather-api:api "OpenWeatherMap Account" [apikey="my-Key-1-32", refreshInterval=30, language="de"] {
     Thing weather-and-forecast local "Local Weather And Forecast" [location="xx.xxxxxx,y.yyyyyyy,zz", forecastHours=120, forecastDays=0]
     Thing uvindex local "Local UV Index" [location="xx.xxxxxx,y.yyyyyyy", forecastDays=7]
}

and added this two Items

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

to my .items File.

After Restart i found this warning message

2019-01-25 17:41:42.512 [WARN ] [mon.registry.AbstractManagedProvider] - Could not update element with key openweathermap:uvindex:api:local in ManagedThingProvider, because it does not exists.

in my logger.

So i started the system again in Debugging_mode for the Binding, i found this messages too.

2019-01-25 17:41:42.362 [DEBUG] [handler.OpenWeatherMapUVIndexHandler] - Initialize OpenWeatherMapUVIndexHandler handler 'openweathermap:uvindex:api:local'.
2019-01-25 17:41:42.367 [DEBUG] [handler.OpenWeatherMapUVIndexHandler] - Rebuilding thing 'openweathermap:uvindex:api:local'.
2019-01-25 17:41:42.370 [DEBUG] [handler.OpenWeatherMapUVIndexHandler] - Rebuilding UV index channel groups.
2019-01-25 17:41:42.373 [DEBUG] [andler.AbstractOpenWeatherMapHandler] - Building channel group 'forecastDay6' for thing 'openweathermap:uvindex:api:local'.
2019-01-25 17:41:42.487 [DEBUG] [handler.OpenWeatherMapUVIndexHandler] - No UV Index data available to update channel 'uvindex' of group 'current'.
2019-01-25 17:41:42.512 [WARN ] [mon.registry.AbstractManagedProvider] - Could not update element with key openweathermap:uvindex:api:local in ManagedThingProvider, because it does not exists.
2019-01-25 17:41:57.361 [DEBUG] [handler.OpenWeatherMapUVIndexHandler] - Update UV Index data of thing 'openweathermap:uvindex:api:local'.
2019-01-25 17:41:57.588 [DEBUG] [handler.OpenWeatherMapUVIndexHandler] - Update channel 'uvindex' of group 'current' with new state '0.79'.
2019-01-25 17:41:57.613 [DEBUG] [handler.OpenWeatherMapUVIndexHandler] - Update UV Index data of thing 'openweathermap:uvindex:api:local'.
2019-01-25 17:41:57.639 [DEBUG] [handler.OpenWeatherMapUVIndexHandler] - Update channel 'uvindex' of group 'current' with new state '0.79'.

Don’t see the bug in the setup. Even i get back a value from the channels. Does anyone see ?

Hi Peter,

You can ignore the warning. The binding will deliver the data for uvindex reliably with or without it. It is completely harmless.

1 Like

Hi Christoph,

it’s ok thx.
I saw this warning in the past, i think it was the old weather-binding. But with the check of you and your ok it’s even better. :wink:
EDIT:
But just saw, that

Number:Speed         localCurrentGustSpeed                   "Current Gust Speed/Windböen[%.1f %unit%]"                    <wind>         (gOWM,gOWMOutlook)  { channel="openweathermap:weather-and-forecast:api:local:current#gust-speed" }

gives no value back.

I am afraid that is true in over 95% of the locations. It depends on the capabilities of the weather station reporting the data for your area. :frowning:

Hi Christoph,
no problem, i can live with. Just a last question.
When looking in the JSON-String

{

    "cod": "200",
    "message": 0.0037,
    "cnt": 40,
    "list": [
        {
            "dt": 1548622800,
            "main": {
                "temp": 2.14,
                "temp_min": 1.11,
                "temp_max": 2.14,
                "pressure": 941.25,
                "sea_level": 1006.28,
                "grnd_level": 941.25,
                "humidity": 95,
                "temp_kf": 1.04
            },
            "weather": [
                {
                    "id": 500,
                    "main": "Rain",
                    "description": "Leichter Regen",
                    "icon": "10n"
                }
            ],

i saw the Expression"“temp_kf”. Is this a Channel in the Thing. Or is this perhaps “Temperature felt” and could be a Channel in the future ?

Thx in advance for short reply

Cheers Peter

Good question. It is listed as

  • list.main.temp_kf Internal parameter

in their documentation. No further explanation.

so if it’s “internal parameter”, it’s not for us :wink:

Thanks for creating the extension. I installed it and got it working, including the new UV data. FYI, the uvindex example has a typo. Specifically, the time-stamp channel ID is shown as timestamp.

I’m a new OWM user. Some basic questions about the binding:

  1. I manually installed the 11.0 snapshot (Dec-26-2018) binding on Openhab2 using the linked file from this announcement post. But I’ve read that OpenWeatherMap can be found on the Eclipse IoT Market. But I cannot find it on the IoT market web repository site and it is also missing from my OpenHab-2.4 addons listing. Is there an alternate place to find the latest update?

  2. I see a persistent warning in my Openhab2 logs that I cannot solve, as follows:
    Could not update element with key openweathermap:uvindex:api:local in ManagedThingProvider, because it does not exists. Everything works fine, but I would appreciate any advice on how to solve that warning.

  • Thomas

Hi Thomas,

Thank you very much for your feedback.

Nice catch. I will fix it.

wrt 1. The binding was available on the Eclipse Marketplace before my initial contribution has been merged. I deleted it over there because I do not see any reason to maintain several version in different locations.

wrt 2. See my comment above.

BR

@cweitkamp, Thanks for the info. I will ignore OpenHab’s log warning message. Would be great if someone found a way to prevent it.

Do you have an official repository for future updates to the OpenWeatherMap extension? It would be nice to be able to visit a dedicated place and check for updates.

BTW, I just read that the eclipse smarthome community site has an uncertain future. I’m not sure what it means to developers like you that share code there. Hopefully there’s a happy ending.
https://www.eclipse.org/lists/smarthome-dev/msg00195.html

  • Thomas

No worries. openHAB will continue without restrictions. We decided to move the ESH code into openHAB Core and all ESH add-ons to openHAB 2 Add-ons.

If you like to follow what is going on I would suggest to subscribe to this topic.

The official repository for the binding is openHAB 2 Add-ons.

@cweitkamp, I appreciate the link. Subscribed.

Blockquote
The official repository for the binding is …

I had previously seen OWM’s source code at the OH github add-ons area. But the compiled jar is not found there, so that is why I asked about an official place to download the latest release (compiled). However, from reading the details in the link you provided it sounds like that will be taken care of when the ESH code is fully migrated over to the OH core.

Thank you again for creating the OWM binding!

  • Thomas

https://ci.openhab.org/job/openHAB2-Bundles/org.openhab.binding$org.openhab.binding.openweathermap/

Thanks. I little bit faster than me :wink: It is also possible to switch your OH 2 version to snapshot build.

1 Like

Nice. I bookmarked the Jenkins OWM url, so I’m good to go.

  • Thomas

Please, can you explain me why you create a item this way?
It seems it doesn’t really match with the reference in the sitemap counterpart definition (Text item=localCurrentTemperature) and and the value never shows in fact.
But removing :Number or referencing it instead of “localCurrentTemperature” for example make the expected result to come out

Searching for the Item reference documention I didn’t discovered anything about the semi colon assignement but the Group type only