Skip to content

Smhi Binding ​

This binding gets hourly and daily forecast from SMHI - the Swedish Meteorological and Hydrological Institute. It can get forecasts for the nordic countries (Sweden, Norway, Denmark and Finland).

Supported Things ​

The binding support only one thing-type: forecast. The Thing can be configured to get hourly forecasts for up to 24 hours, and daily forecasts for up to 10 days.

Discovery ​

This binding does not support automatic discovery.

Thing Configuration ​

The forecast Thing needs to be configured with the latitude and longitude for the location of the forecast. You can also choose for which hours and which days you would like to get forecasts.

ParameterDescriptionRequired
LatitudeLatitude of the forecastYes
LongitudeLongitude of the forecastYes
Hourly forecastsThe hourly forecasts to displayNo
Daily forecastsThe daily forecasts to displayNo

Channels ​

The Thing has one or more channel groups (depending on configuration). The first channel group (Complete Forecast) provides the full forecast and is meant to be used with the forecast persistence strategy. The other configurable channel groups represent a point in time (hour or day) and gets updated with the latest forecasted value for that time.

The channels are the same for all forecasts, but the daily forecast provides some additional aggregated values. For the other channels in the daily forecast, the values are for 12:00 UTC.

The complete channel identifier is the channel group id (timeseries, hour_<offset> or day_<offset>, where offset is 0 for the current hour/day or the number of hours/days from now) + the channel id, concatenated with a #.

If there is no data for the specified time, the binding will update the channel with the numeric value -1, for all channels except the temperature channels, for which the value 9999 will be used instead.

Examples:

  • Temperature for the current hour: hour_0#air_temperature
  • Total precipitation 3 days from now: day_3#precipitation_amount_total

Basic channels ​

channeltypechannel iddescription
TemperatureNumber:Temperatureair_temperatureTemperature in Celsius
Max TemperatureNumber:Temperaturetemperature_maxHighest temperature of the day (daily forecast only)
Min TemperatureNumber:Temperaturetemperature_minLowest temperature of the day (daily forecast only)
Wind directionNumber:Anglewind_from_directionWind direction in degrees
Wind SpeedNumber:Speedwind_speedWind speed in m/s
Max Wind SpeedNumber:Speedwind_speed_maxHighest wind speed of the day (daily forecast only)
Min Wind SpeedNumber:Speedwind_speed_minLowest wind speed of the day (daily forecast only)
Wind gust speedNumber:Speedwind_speed_of_gustWind gust speed in m/s
Minimum precipitationNumber:Speedprecipitation_amount_minMinimum precipitation intensity in mm/h
Maximum precipitationNumber:Speedprecipitation_amount_maxMaximum precipitation intensity in mm/h
Total precipitationNumber:Lengthprecipitation_amount_totalTotal amount of precipitation during the day, in mm (daily forecast only)
Precipitation ProbabilityNumber:Dimensionlessprobability_of_precipitationProbability of Precipitation
Precipitation categoryNumberpredominant_precipitation_type_at_surfaceType of precipitation (Descriptions)
Air pressureNumber:Pressureair_pressure_at_mean_sea_levelAir pressure in hPa
Relative humidityNumber:Dimensionlessrelative_humidityRelative humidity in percent
Total cloud coverNumber:Dimensionlesscloud_area_fractionMean value of total cloud cover in percent
Weather conditionNumbersymbol_codeShort description of the weather conditions (Descriptions)

Advanced channels ​

channeltypechannel iddescription
VisibilityNumber:Lengthvisibility_in_airHorizontal visibility in km
Thunder probabilityNumber:Dimensionlessthunderstorm_probabilityProbability of thunder in percent
Frozen precipitationNumber:Dimensionlessprecipitation_frozen_partPercent of precipitation in frozen form
Probability of frozen precipitationNumber:Dimensionlessprobability_of_frozen_precipitationProbability that the precipitation is in frozen form
Low level cloud coverNumber:Dimensionlesslow_type_cloud_area_fractionMean value of low level cloud cover (0-2500 m) in percent
Medium level cloud coverNumber:Dimensionlessmedium_type_cloud_area_fractionMean value of medium level cloud cover (2500-6000 m) in percent
High level cloud coverNumber:Dimensionlesshigh_type_cloud_area_fractionMean value of high level cloud cover (> 6000 m) in percent
Cloud base altitudeNumber:Lengthcloud_base_altitudeAltitude of the cloud cover base
Cloud top altitudeNumber:Lengthcloud_top_altitudeAltitude of the cloud cover top
Mean precipitationNumber:Speedprecipitation_amount_meanMean precipitation intensity in mm/h
Median precipitationNumber:Speedprecipitation_amount_medianMedian precipitation intensity in mm/h

Precipitation category ​

The precipitation category can have a value from 0-6, representing different types of precipitation:

ValueMeaning
0No precipitation
1Rain
2Thunderstorm
3Freezing rain
4Mixed/ice
5Snow
6Wet snow
7Mixture of rain and snow
8Ice pellets
9Graupel
10Hail
11Drizzle
12Freezing drizzle

Weather conditions ​

The weather condition channel can take values from 1-27, each corresponding to a different weather condition:

ValueCondition
1Clear sky
2Nearly clear sky
3Variable cloudiness
4Half clear sky
5Cloudy sky
6Overcast
7Fog
8Light rain showers
9Moderate rain showers
10Heavy rain showers
11Thunderstorm
12Light sleet showers
13Moderate sleet showers
14Heavy sleet showers
15Light snow showers
16Moderate snow showers
17Heavy snow showers
18Light rain
19Moderate rain
20Heavy rain
21Thunder
22Light sleet
23Moderate sleet
24Heavy sleet
25Light snowfall
26Moderate snowfall
27Heavy snowfall

Full Example ​

demo.things Example ​

dsl
Thing smhi:forecast:demoforecast "Demo forecast" [ latitude=57.997072, longitude=15.990068, hourlyForecasts=0,1,2, dailyForecasts=0,1 ]

demo.items ​

dsl
Group Smhi_Forecasts
Number:Temperature Smhi_Temperature_Forecast (Smhi_Forecasts) "Forecasted temperature [%.1f °C]" {channel="smhi:forecast:demoforecast:timeseries#air_temperature"}
Number:Speed Smhi_Min_Precipitation_Forecast (Smhi_Forecasts) "Forecasted precipitation (min) [%.1f mm/h]" {channel="smhi:forecast:demoforecast:timeseries#precipitation_amount_min"}

Number:Temperature Smhi_Temperature_Now "Current temperature [%.1f °C]" {channel="smhi:forecast:demoforecast:hour_0#air_temperature"}
Number:Speed Smhi_Min_Precipitation_Now "Current precipitation (min) [%.1f mm/h]" {channel="smhi:forecast:demoforecast:hour_0#precipitation_amount_min"}

Number:Temperature Smhi_Temperature_1hour "Temperature next hour [%.1f °C]" {channel="smhi:forecast:demoforecast:hour_1#air_temperature"}
Number:Speed Smhi_Min_Precipitation_1hour "Precipitaion next hour (min) [%.1f mm/h]" {channel="smhi:forecast:demoforecast:hour_1#precipitation_amount_min"}

Number:Temperature Smhi_Temperature_Tomorrow "Temperature tomorrow [%.1f °C]" {channel="smhi:forecast:demoforecast:day_1#air_temperature"}
Number:Speed Smhi_Min_Precipitation_Tomorrow "Precipitaion tomorrow (min) [%.1f mm/h]" {channel="smhi:forecast:demoforecast:hour_1#precipitation_amount_min"}

demo.sitemap Example ​

dsl
sitemap demo label="Smhi" {
    Frame label="Current weather" {
        Text item=Smhi_Temperature_Now
        Text item=Smhi_Min_Precipitation_Now
    }
    Frame label="Weather next hour" {
        Text item=Smhi_Temperature_1hour
        Text item=Smhi_Min_Precipitation_1hour
    }
    Frame label="Weather tomorrow" {
        Text item=Smhi_Temperature_Tomorrow
        Text item=Smhi_Min_Precipitation_Tomorrow
    }
}

inmemory.persist Example ​

java
Items {
    Smhi_Forecasts* : strategy = forecast
}