Showing weather information for air and road temperature provided by Trafikverket in Sweden. This Python file should be used as a custom component in Home Assistant.
To enable this sensor, add the following lines to your configuration.yaml
.
sensor:
- platform: trafikverket_weatherstations
name: Trafikverket Road WeatherStation Kungälv
api: eXXcbXXXacXXXXc39XX3aXXX4aXX46XX
station: Kungälv
type: road
Configuration variables:
- name (Required): Unique name of the device in the frontend.
- api (Required): API key from Trafikverket
- station (Required): Name of the weather station
- type (Required): Defines which temperature you want (
air
orroad
)
https://api.trafikinfo.trafikverket.se/
sensor:
- platform: trafikverket_weatherstations
name: Trafikverket Road WeatherStation Kungälv
api: eXXcbXXXacXXXXc39XX3aXXX4aXX46XX
station: Kungälv
type: road
- platform: trafikverket_weatherstations
name: Trafikverket Air WeatherStation Lanna
api: eXXcbXXXacXXXXc39XX3aXXX4aXX46XX
station: Lanna
type: air