Announcing OpenWeatherMap binding for Eclipse SmartHome / openHAB

weather
openweathermap
Tags: #<Tag:0x00007f51d936bd48> #<Tag:0x00007f51d936bc08>

(Nanna Agesen) #82

Thanks all, I simply had to delete the 3 Hour Forcast thing from PaperUi and after adding it again it worked :slight_smile:


(Christoph Weitkamp) #83

Cool, I am glad you got it working. You are welcome. Thanks for using the binding.


(Nanna Agesen) #84

Is there a way to scale the Wind Speed so I have it in m/s insted om km/t

Currently i’m using JS transformation and a Proxy Item, but would be nice if there was a more “Direct” way doing it?


(Christoph Weitkamp) #85

Hi @Nanna_Agesen,

Yes. The OWM binding uses the Units Of Measurement feature for defining its channels. You can easily convert the values for wind speed to a specific target unit (m/s, km/h, mph, kn) by adding the unit to the label of the item. Only for Beaufort a scale transformation is needed - I will add an example for it later this day.

demo.items

Number:Speed testNumberSpeed

demo.sitemap

sitemap demo label="My home automation" {
    Frame label="Speed" {
        Text item=testNumberSpeed label="Windgeschwindigkeit [%.1f %unit%]" icon="wind"
        Text item=testNumberSpeed label="Windgeschwindigkeit [%.1f m/s]" icon="wind"
        Text item=testNumberSpeed label="Windgeschwindigkeit [%.1f km/h]" icon="wind"
        Text item=testNumberSpeed label="Windgeschwindigkeit [%.1f mph]" icon="wind"
        Text item=testNumberSpeed label="Windgeschwindigkeit [%.1f kn]" icon="wind"
    }
}


Percent in items not converting
(Nanna Agesen) #86

Hi :slight_smile:

Thanks that was a easy change - Great :slight_smile:


(Christoph Weitkamp) #87

Dear all,

Thank you very much for your support. I have added some more features to the OWM binding.

You can download a new Testversion here (requires ESH build 281 or higher and / or OH2 build 1316 or higher). I have updates the marketplace version too.

New changes:

  • Changed pattern for DateTime channels
  • Added example for station items
  • Added channel gust-speed
  • Changed handling for thing status and invalid API key
  • Minor improvements in code an documentation

Best,

Christoph


(Holger Eisold) #88

Thanks @cweitkamp for the updates :slight_smile:

I saw in the code changes that you also added gust speed to the hourly forecast… but i dont see it in the json if i call the api directly… did i missed it? or is it not in there?

In the normal weather json it is there…


(Christoph Weitkamp) #89

Counter questions: Do you find it somewhere in the API docs? It is neither listed in the current weather nor in the forecast sections. But it is available in the response …


(Holger Eisold) #90

nope… i was just wondering after i have seen it in the api call… so “weather” has it “forecast” not…

the only thing i found it documented was in the stations api https://openweathermap.org/stations

maybe the API doc is not up to date for the weather call… so if we can grab it… fine… we take it… I just wanted to point, that the hourly forecast dont have it… and since the daily forecast is in the paid plan (which i dont have) i’m not sure about if its there…


(JT) #91

Was there a reason why the Current temperature and current humidity channels were removed?

Nevermind I see it’s because I Don’t have the latest snapshot of OH2. Installed. Would it be possible to post the jar of the file before the breaking change was made?


(Christoph Weitkamp) #92

Have a look here: https://openweathermap.org/weather-data. According to this page it should be available for all three services. But it disappears once and a while in my local current weather too. And it is not available in my daily forecast data. Who knows …


(Christoph Weitkamp) #93

@Nanna_Agesen I owe you an example. Here is what I use in my setup:

beaufort.scale

[..1.85[=0 Bft
[1.85..7.41[=1 Bft
[7.41..12.96[=2 Bft
[12.96..20.37[=3 Bft
[20.37..29.63[=4 Bft
[29.63..40.74[=5 Bft
[40.74..51.86[=6 Bft
[51.86..62.97[=7 Bft
[62.97..75.93[=8 Bft
[75.93..88.90[=9 BFt
[88.90..103.71[=10 Bft
[103.71..118.53[=11 Bft
[118.53..]=12 Bft

demo.sitemap

sitemap demo label="My home automation" {
    Frame label="Speed" {
        Text item=testNumberSpeed label="Windgeschwindigkeit [SCALE(beaufort.scale):%s]" icon="wind"
    }
}

The only thing which is missing to make it perfect is a nice valuecolor depending on the Beaufort value. Does anybody like to volunteer for adding it (Beaufort scale)? That would be very much appreciated.


(Christoph Weitkamp) #94

Hi @tebore,

Yes, I will take care of that tomorrow.


(JT) #95

Thanks!


(Christoph Weitkamp) #96

Have a look here. I have uploaded an old version.


(JT) #97

I just gave it a shot and everything is back up and running.

Thanks for posting it. I had to clear my cache a yesterday and the marketplace binding was “too new”


(Christoph Weitkamp) #98

Cool, I am glad it is working again for you.


(Holger Eisold) #99

@cweitkamp did you already noticed that the wind gust is gone form the “weather” API call?

I installed your new test binding yesterday… and today i was wondering why the gust is still not updated… so i took a quit look on a raw api call… and… gust is gone from it…

Dont know why…

{"coord":{"lon":13.82,"lat":51.15},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"base":"stations","main":{"temp":288.15,"pressure":1020,"humidity":54,"temp_min":288.15,"temp_max":288.15},"visibility":10000,"wind":{"speed":1.5,"deg":160},"clouds":{"all":0},"dt":1535491200,"sys":{"type":1,"id":4879,"message":0.0059,"country":"DE","sunrise":1535429566,"sunset":1535479054},"id":2880067,"name":"Lausa","cod":200}

(Eric Zenz-Matzl) #100

Hi,

Today i tried to install this binding.
I configured the Binding via PaperUI.

But in the openhab.log i see the following:

2018-09-24 14:58:16.256 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: system:location
2018-09-24 14:58:16.263 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: system:outdoor-temperature
2018-09-24 14:58:16.270 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: system:outdoor-temperature
2018-09-24 14:58:16.278 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: system:outdoor-temperature
2018-09-24 14:58:16.284 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: system:outdoor-temperature
2018-09-24 14:58:16.290 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: system:outdoor-temperature
2018-09-24 14:58:16.296 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: system:outdoor-temperature
2018-09-24 14:58:16.302 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: system:outdoor-temperature
2018-09-24 14:58:16.310 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: system:outdoor-temperature
2018-09-24 14:58:17.737 [WARN ] [re.thing.internal.ThingFactoryHelper] - Could not create channel ‘location’ for thing type ‘openweathermap:hourly-forecast:api:local’, because channel type ‘system:location’ could not be found.
2018-09-24 14:58:17.757 [WARN ] [re.thing.internal.ThingFactoryHelper] - Could not create channel ‘temperature’ for thing type ‘openweathermap:hourly-forecast:api:local’, because channel type ‘system:outdoor-temperature’ could not be found.
2018-09-24 14:58:17.765 [WARN ] [re.thing.internal.ThingFactoryHelper] - Could not create channel ‘pressure’ for thing type ‘openweathermap:hourly-forecast:api:local’, because channel type ‘system:barometric-pressure’ could not be found.
2018-09-24 14:58:17.773 [WARN ] [re.thing.internal.ThingFactoryHelper] - Could not create channel ‘humidity’ for thing type ‘openweathermap:hourly-forecast:api:local’, because channel type ‘system:atmospheric-humidity’ could not be found.
2018-09-24 14:58:17.779 [WARN ] [re.thing.internal.ThingFactoryHelper] - Could not create channel ‘wind-speed’ for thing type ‘openweathermap:hourly-forecast:api:local’, because channel type ‘system:wind-speed’ could not be found.

Does anybody hast the same problem?
Or does somebody know how to fix it?


(Christoph Weitkamp) #101

Hi Eric,

I have the slight feeling that your system does not fulfill the requirements for the latest version. Have a look here for two versions based on different requirements.