Trafikverket WeatherStation


Showing weather information provided by Trafikverket weather stations in Sweden.

Potential use cases:

  • Get weather data in general.
  • You live near a weather station and want to know the current weather conditions at home.
  • Setup automations for your car heating system. If the road is frozen along the way to work, you might want the car heating system to start earlier.
Configuration

To enable this sensor, add the following lines to your configuration.yaml.

sensor:
  - platform: trafikverket_weatherstation
    name: Trafikverket Kungälv
    api_key: YOUR_API_KEY
    station: Kungälv
    monitored_conditions:
        - air_temp
        - road_temp
        - humidity
        - precipitation
        - wind_direction
        - wind_direction_text
        - wind_speed

Configuration Variables

name

(string)(Required)Your unique name of the device in the frontend.

api_key

(string)(Required)Your personal API key from Trafikverket.

station

(string)(Required)Name of the weather station from Trafikverket.

monitored_conditions

(map)(Required)Specify what measurement data to retrieve from the weather station.

air_temp

Air temperature.

road_temp

The temperature in the road.

humidity

Relative humidity.

precipitation

Type of precipitation (Swedish text).

wind_direction

Wind direction in degrees.

wind_direction_text

Rough wind direction in twelve variants (Swedish text).

wind_speed

Average wind speed during the last 10 minutes.

Obtaining API key

Please click here and register to obtain the API key.

Weather stations

Click here to get a map of valid weather stations. Once a station is found, copy the name according to the below picture and paste it in your configuration.yaml file as the station variable.

Examples
sensor:
  - platform: trafikverket_weatherstation
    name: Trafikverket Kungälv
    api_key: YOUR_API_KEY
    station: Kungälv
    monitored_conditions:
        - air_temp
        - road_temp
        - humidity
        - precipitation
        - wind_direction
        - wind_direction_text
        - wind_speed
  - platform: trafikverket_weatherstation
    name: Trafikverket Lanna
    api_key: YOUR_API_KEY
    station: Lanna
    monitored_conditions:
        - air_temp
        - road_temp
        - humidity
  - platform: trafikverket_weatherstation
    name: Trafikverket Nöbbele
    api_key: YOUR_API_KEY
    station: Nöbbele
    monitored_conditions:
        - air_temp
        - road_temp
        - humidity
        - precipitation