Trafikverket WeatherStation


Showing weather information for air and road temperature provided by Trafikverket in Sweden.

Potential use cases:

  • Get weather data in general
  • You live near a weather station and want to know the current temperature 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 Road WeatherStation Kungälv
    api_key: eXXcbXXXacXXXXc39XX3aXXX4aXX46XX
    station: Kungälv
    type: road

Configuration Variables

name

(string)(Required)Unique name of the device in the frontend.

api_key

(string)(Required)API key from Trafikverket.

station

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

type

(string)(Required)Defines which temperature you want (air or road).

scan_interval

(int)(Optional)How frequently to query for new data (in seconds).

Default value: 300

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 Road WeatherStation Kungälv
    api_key: eXXcbXXXacXXXXc39XX3aXXX4aXX46XX
    station: Kungälv
    type: road
  - platform: trafikverket_weatherstation
    name: Trafikverket Air WeatherStation Lanna
    api_key: eXXcbXXXacXXXXc39XX3aXXX4aXX46XX
    station: Lanna
    type: air
    scan_interval: 600