Trafikverket Weather Station
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.
Prerequisites
Please click here and register to obtain the API key.
Configuration
To add the Trafikverket Weather Station service to your Home Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select Trafikverket Weather Station.
-
Follow the instructions on screen to complete the setup.
The API key you created on the Trafikverket open data portal.
The name of the weather station, exactly as shown on the Trafikverket traffic information map. For example, Arlanda. See Weather stations for how to find it.
If no station has the name you entered, or more than one station matches it, the form tells you so. Check the name on the map and try again.
To follow more than one weather station, add the integration again for each station.
Reconfiguration
You can change the API key or switch to another weather station without removing the integration.
- Go to Settings > Devices & services and select the Trafikverket Weather Station integration.
- Next to the station entry, select the three dots
menu, then select Reconfigure. - Enter the new API key or Station, and select Submit.
Entities provided by the integration
- Air temperature.
- Road temperature.
- Dew point
- Precipitation type.
- Precipitation amount
- Wind direction in degrees.
- Wind speed
Entities provided but not enabled by default
- Relative humidity
- Maximum wind speed measured during the last 30 minutes
- Measurement time
- Visible distance
- Road ice depth
- Road snow depth
- Road water depth
- Road water equivalent depth
- Wind measurement height
- Data modified time
Weather stations
To get a map of valid weather stations, open the trafikverket website. Once you have found a station, copy its name as shown in the picture below and paste it in the Station field.
Data updates
The integration pollsData polling is the process of querying a device or service at regular intervals to check for updates or retrieve data. By defining a custom polling interval, you can control how frequently your system checks for new data, which can help optimize performance and reduce unnecessary network traffic. [Learn more] the Trafikverket API every 10 minutes.
Removing the integration
This integration follows standard integration removal. No extra steps are required.
To remove an integration instance from Home Assistant
- Go to Settings > Devices & services and select the integration card.
- Next to the entry you want to remove, select the three dots
menu. Then, select Delete. - Depending on the integration, the entries are listed under one of the following headings:
- Devices
- Hubs
- Services
- Integration entries
- Depending on the integration, the entries are listed under one of the following headings:
- To confirm, select Delete.
- Home Assistant also deletes the devices and entities of the entry.
- If Home Assistant asks you to restart, restart Home Assistant.
- If Home Assistant asks whether to also delete the application credentials, select Remove or Keep.
- If you keep them, Home Assistant uses them automatically when you add the integration again.
- To delete them later, refer to Deleting application credentials.
If you no longer use the API key for anything else, you can also remove it from the Trafikverket open data portal.