SMHI Weather Binding

I have created a binding for smhi weather (Swedish Meteorological and Hydrological Institute).

I need testers before i have it going into 2.5 release.

You can find the documentation at https://github.com/tnemrap/openhab2-addons/tree/smhi/addons/binding/org.openhab.binding.smhi

You can download the jar from here

I have tested it with both 2.4 and 2.5-snapshot.

Update: Updated jar with latest fixes.

Update: Updated with better location check.

/Mike

9 Likes

This is great news!
Only tested temperature, wind and time. It works!
I will use this for my sunshade?(markis).
Good work and thank you!

1 Like

Works for me as well! Running 2.5.0M1.

The only thing I can think of is that maybe the new units-of-measurement stuff should be used, like Number:Temperature instead of only Number etc.

//Martin

I havet the latest snapshot of 2.5 and it is still working good!
How often does SMHI update their stations?

Every hour.

1 Like

hi
I installed the binging on 2.4 but I get an error:OFFLINE - COMMUNICATION_ERROR

in the instructions: Latitude must be between 52.50 and 70.75, but my latitude is between 44 and 45
is this the problem?

if I use the site smhi.se I can see the data of my area and the 10days forecasts
https://www.smhi.se/q/San%20Lazzaro/3168175
https://www.smhi.se/vadret/vadret-i-sverige/ortsprognoser/q/San%20Lazzaro/3168175#tab=0,chart=1

Ale

I will check this for you.

/Mike

I get point out of bounds when using http://opendata-download-metfcst.smhi.se/api/category/pmp3g/version/2/geotype/point/lon/11.80189/lat/44.44611/data.json

/Mike

Cool stuff! Nice to see more Swedish institute covered up, I’ve worked on similar binding against Finnish Meteorological Institute (FMI) https://github.com/openhab/openhab2-addons/pull/5226

One small note: I expect you to encounter issues with mm/h unit in case you go for UoM (which I highly recommend) – at least that was the issue for me in Finnish Meteorology of Institute (FMI) binding, underlying issue https://github.com/openhab/openhab-core/issues/644.

thanks anyway!!
:slightly_smiling_face:

1 Like

Have now updated the jar in the first post with the latest fixes.

/Mike

1 Like

I have closed the pull request and will keep the source in my own repository.

It is to much work to get a binding approved.

I will keep the jar updated in this thread when i do changes.

/Mike

1 Like

So while upgrading from 2.4 to 2.5m3, I decided to also add this binding (thanks for your work @tnemrap !).
However, there seems to be some issue with the configuration;
bild

My things file looks like this; (replaced the last digits with 123456)

Thing smhi:weather-and-forecast:stockholm [ weatherlocation="59.123456,17.123456", refresh=60 ]

In the log, the only thing information I get, is;

14:42:32.578 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'smhi:weather-and-forecast:stockholm' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_CONFIGURATION_PENDING)

If I look instead, in paperui, it does not show any weather location. Not sure if it should, since I am using things file instead.

Am I missing something obvious?

Sorry for late answer. I will look into this in this weekend.

/mike

1 Like

Did you find a fix for this. I have the exact same problem.

I can not reproduce the problem. Can you try to run it in debug mode.

/mike

Hej @tnemrap! I just tried your binding and get
'smhi:weather-and-forecast:stockholm' changed from UNINITIALIZED (HANDLER_CONFIGURATION_PENDING) to UNINITIALIZED (HANDLER_MISSING_ERROR)

I placed the provided jar file of your first post in /usr/share/openhab2/addons

Any idea?

Was it possible to add a thing in paperui?

/Mike

I was not aware of that option, but yeah that works.

my textual configuration is:
Thing smhi:weather-and-forecast:stockholm [ weatherlocation="59.123456,17.123456", refresh=60 ]

must have a miss in documentation :slight_smile:
This is my configuration

Thing smhi:weather-and-forecast:gavle [ location="60.654321,17.123456", refresh=60 ]