Trafikinfo SE brings real-time Swedish road traffic information from Trafikverket into Home Assistant.
This repository now contains both:
- The Home Assistant integration (
trafikinfo_se) - The Lovelace alert card (
trafikinfo-se-alert-card.js)
Register at Trafikverkets API portal to get your API key.
You can also add the repository manually in HACS as type Integration.
- Download
trafikinfo_se.zipfrom the latest release. - Extract the archive and place the
trafikinfo_sefolder inconfig/custom_components/. - Restart Home Assistant.
The alert card is bundled with this integration.
When the integration starts, it automatically:
- syncs the bundled card to
config/www/trafikinfo-se-alert-card.js - creates or updates a Lovelace
moduleresource at/local/trafikinfo-se-alert-card.js?v=...for cache-busting
If you have just installed or updated, reload the browser once to ensure the latest card resource is loaded.
The card can be configured in the dashboard UI editor:
- Open your dashboard.
- Select Edit dashboard.
- Add a new card.
- Search for and select one of:
Trafikinfo SE – Händelser (Olycka/Hinder/Vägarbete/Restriktion)Trafikinfo SE – RestiderTrafikinfo SE – Viktig trafikinformation
You can also use the manual card types:
custom:trafikinfo-se-alert-cardcustom:trafikinfo-se-route-cardcustom:trafikinfo-se-viktig-trafikinformation-card
Normally no manual Lovelace resource setup is required.
If your dashboard does not load the card automatically, add this resource manually:
- URL:
/local/trafikinfo-se-alert-card.js - Type:
JavaScript Module
To add the integration, use this My button:
If needed, add it manually via Settings > Devices & Services > Add Integration.
- Olyckor
- Hinder
- Viktig trafikinformation
- Restriktioner
- Trafikmeddelande
- Vägarbete
The integration now supports Trafikverket's TravelTimeRoute data model as a separate route-focused setup flow within the same integration.
This mode is designed for commute-style monitoring, where the most important questions are how long a route takes right now, how much slower it is than normal, and whether traffic conditions are getting worse.
When you add a route entry, the integration creates route-specific sensors for:
- current travel time
- delay compared with free-flow traffic
- current traffic status
The route data also includes geometry in WGS84, which the route card can use to draw the monitored road segment directly on a map.
The route card is available as custom:trafikinfo-se-route-card.
It supports both:
- a single route sensor
- multiple route sensors in the same card
When you add multiple route sensors, the card lists them one after another and can show all selected road segments on the same map. Each route line is color-coded from the sensor state so it is easier to scan the traffic situation for a whole area such as Gothenburg.
The route card can show:
- current travel time
- signed delay versus free-flow time
- traffic status
- update time
- a shared map with route lines
The map is optional and intended for the detailed card view.
For sensors Hinder and Olycka, the integration emits one event per new or updated incident:
trafikinfo_se_hinder_incidenttrafikinfo_se_olycka_incident
Each event includes fields such as incident_key, change_type, message_type, incident, and received_at.
Each GitHub release in this repository publishes:
trafikinfo_se.zipfor integration installation
The bundled alert card is included inside trafikinfo_se.zip.
The project uses one shared version across integration and card.
Use Conventional Commits with component scopes for clear release notes, for example:
feat(integration): ...fix(card): ...chore(ci): ...
If you previously used homeassistant-trafikinfo-se-card, see MIGRATION.md.