Announcing OpenWeatherMap binding for Eclipse SmartHome / openHAB

weather
openweathermap
Tags: #<Tag:0x00007f51dba3caf8> #<Tag:0x00007f51dba3c9b8>

(Jürgen Baginski) #21

I am actually using OpenWeatherMap with the old OH1 binding. Using this one I get the condition icon.
Should the icon be self calculated with the OH2 binding, or did I miss something?


(Jürgen Baginski) #22

Looking into the log for the time I used the OH1 binding I see the same update-rate for WindSpeed as you posted. Most of the time only hourly updates, occasionally a 30 minute step. The temperature does come more frequently, which looks the same in OH2!


(Christoph Weitkamp) #23

@opus The icon is still on my to-do list.


(SiHui) #24

Thx, that corresponds to

,so we don’t have any issues with the binding.
Unfortunately for my location the weather reports are very inaccurate, I will stop using it.


(Jürgen Baginski) #25

That was the reason for posting that!

I have the slight feeling that that is the case for my location as well. However, I will continue to have a look into the OpenWeatherMap binding.


(Jürgen Baginski) #26

I’m using a weather widget (made by @kubawolanin) on habpanel, showing items like “Number:Temperature” results in a faulty display.
Faulty%20HAPPanel


(—M.Yoda) #27

Works like a charm right out of the box! :heart_eyes:
Tested with OH 2.3.0 / jre1.8.0_171, installed via drag&drop from the eclipse marketplace.

The binding is stable and I’m fine with the quality of the provided owm-data (Berlin, Germany).

Only one minor glitch found so far.
Channel Group ID Channel ID Item Type Description
current min-temperature Number:Temperature Minimum temperature of a day.
current max-temperature Number:Temperature Maximum temperature of a day.

I guess these channels refer to owm’s list.main.temp_min and list.main.temp_max so they don’t provide the min-max-temperatures of the day but the current min-max-temperatures within the given (weatherstation-) area. To quote owm:

Minimum/maximum temperature at the moment of calculation. This is deviation from ‘temp’ that is possible for large cities and megalopolises geographically expanded

So the channel description should read “Current minimum/maximum temperature” or something like that.

@cweitkamp
I’m looking forward to further development. Icons? Expand the 3h forecast (>24h)?
Thanks a lot for sharing this binding!


(Christoph Weitkamp) #28

@ordonot Thank you very much for your feedback.

Regarding to the channels min-/max-temperature: I will look into that. Thanks for the hint.

I am currently working on the icons. Will provide an update soon. Will keep you posted.


(David Martin) #29

I have just loaded this but it seems to suffer from the same issue as the openHab weather binding and when you enable to forecast things using a free API (which has access to 5 days of forecast data) then whole binding crashes all things go OFFLINE (that includes the Local and the Daily). The logs capture an invalid API message. If I untick the forecasts from the API the basic data does come back again alas there is no 5 day forecast data.

This appears to show 2 issues:

  1. if you enable a service and your key does not support it part of the services the other feed services go OFFLINE - which really should not be the case?
  2. access to the 5 days forecast is not correctly setup in the binding? (EDIT: Reading Github this now seems to make sense)

Looking at your post I am confused as you say “The binding supports current weather, 5 day / 3 hour forecast (currently for 24h) and 16 day / daily forecast (currently for 5 days / paid accounts).” but the last bit in brackets (currently for 5 days / paid accounts) is linked to the 16 days system and makes no sense.


(Benedikt Neuhold) #30

I have the exact same problem. Every time I update the bridge it works for 1 minute - it gets the right values - after that it crashes.

Even if I disable the DailyForecast per thing-File it still tries to get the data.

Bridge openweathermap:weather-api:api "OpenWeatherMap API" [apikey="xxxx", refreshInterval=30, language="de", hourlyForecast=false, dailyForecast=false] {
    Thing weather local "Local weather" [location="47.xxxxxxxxx,15.xxxxxxxxx"]
    Thing daily-forecast local "Local forecast" [location="47.xxxxxxxxx,15.xxxxxxxxx"]
}

This is showing in the logfile:

2018-07-19 08:32:50.629 [DEBUG] [r.OpenWeatherMapDailyForecastHandler] - Update daily forecast data of thing 'openweathermap:daily-forecast:api:local'.
2018-07-19 08:32:50.634 [TRACE] [.connection.OpenWeatherMapConnection] - OpenWeatherMap request = 'https://api.openweathermap.org/data/2.5/forecast/daily?appid=xxx&cnt=6&lon=15.xxxx&units=metric&lang=de&lat=47.xxxx'
2018-07-19 08:32:50.675 [DEBUG] [.connection.OpenWeatherMapConnection] - OpenWeatherMap server responded with status code 401: Invalid API key. Please see https://openweathermap.org/faq#error401 for more info.
2018-07-19 08:32:50.687 [TRACE] [.connection.OpenWeatherMapConnection] - OpenWeatherMap response = ''

(David Martin) #31

@benschi11 I found if you remove the thing for Daily Forecast thing from the PaperUI - Configuration - Things section - delete it using the trash can then edit the API thing and save it should come back online. The problem is actually that the thing is added not just flicking the switch in the API.


(Benedikt Neuhold) #32

Thanks! You are right! After I removed the entry from the .thing file the current temp values are coming in.

Bridge openweathermap:weather-api:api "OpenWeatherMap API" [apikey="xxx", refreshInterval=10, language="de", hourlyForecast=false, dailyForecast=false] {
    Thing weather local "Local weather" [location="47.xx,15.xx"]
    //Thing daily-forecast local "Local forecast" [location="47.xx,15.xx"]
}

(—M.Yoda) #33
  • OpenWeatherMap is offering a 3-hourly (free) forecast for the next 5 days but the binding is only providing data for the next 24 hours.
  • Openweathermap is offering a daily (paid) forecast for the next 16 days but the binding is only providing data for the next 5 days.

So if you have a free API key you can (should) only activate the 3-hourly forecast.
Then it works fine… :wink:


(Christoph Weitkamp) #34

@itbeyond @benschi11 Is everything clear right now? Does @ordonot s answer clarify your questions?

I have tweaked the ONLINE/OFFLINE behavior for the things a little bit. It will be better if only the service goes OFFLINE which is not available for the given API key and not everything.

@ordonot I have implemented a new channel for icons as well.

Unfortunately it is currently not possible to upload a new test version for you, because it depends on two fixes in the ESH framework. We have to wait for a new snapshot version based on the next ESH build.

Be in touch.


(Nanna Agesen) #35

Hi

I added a transformation map to get the wind direction output in plain text, if someone interested.

Item File

Number:Angle owmCurrentWindDirection "Current wind direction [SCALE(wind.scale):%s]" <wind> 	{ channel="openweathermap:weather:api:local:current#wind-direction" }

wind.scale

[0..22] = North
[23..45] = NorthNorthEast
[46..67] = NorthEast
[68..90] = EastNorthEast
[91..112] = East
[113..135] = EastSouthEast
[136..157] = SouthEast
[158..180] = SouthSouthEast
[181..202] = South
[203..225] = SouthSouthWest
[226..247] = SouthWest
[248..270] = WestSouthWest
[271..292] = West
[293..315] = WestNorthWest
[316..338] = NorthWest
[339..360] = NorthNorthWest

(David Martin) #36

@cweitkamp - thanks for your response yes I have the system working now and understand the 5day only showing 24hrs and 16 days paid subscription. My main issue you seem to indicate has been looked at which was the whole API and all services go offline of you make the daily subscription on a free account.


(Christoph Weitkamp) #37

Thank you very much @Nanna_Agesen. I have done something similar. But my scale transformation looks a little bit different (rotated by 11.25° counterclockwise). Why? In your case 181° - 202° will be transformed to South. But from my point of view South should be valid for 180° ± 11.25°.

windDirection.scale:

[0..11.25[ = N
[11.25..33.75[ = NNE
[33.75..56.25[ = NE
[56.25..78.75[ = ENE
[78.75..101.25[ = E
[101.25..123.75[ = ESE
[123.75..146.25[ = SE
[146.25..168.75[ = SSE
[168.75..191.25[ = S
[191.25..213.75[ = SSW
[213.75..236.25[ = SW
[236.25..258.75[ = WSW
[258.75..281.25[ = W
[281.25..303.75[ = WNW
[303.75..326.25[ = NW
[326.25..348.75[ = NNW
[348.75..360] = N

Sharing a rule to calculate compass directions from degrees
Item type issues in Netatmo? Wind rules not triggering
(Jürgen Baginski) #38

I can second that (I used to be a navigator on a maritime airplane!). I’ll never forget the "2 Strich achterlicher als querab":wink:


(Vincent Regaud) #39

I have made a node-red node that does the same like a windrose indicator. You can also adjust the accuracy so you can have it with the 4 cardinal points WENS or 8, N,NE,E…
or 16 like nana’s for 32 or even 64 and 128…
I’ll dig it up and adapt it for a JS transform. (On my list do do now…)


(Nanna Agesen) #40

You are absolute right, I had misread my windrose picture :slight_smile: