I’d like to share a new project I’ve been working on: Trafikinfo SE, a Home Assistant integration for Swedish traffic information from Trafikverket.
The integration lets you monitor real-time traffic events such as accidents, roadworks, restrictions, and important traffic messages directly in Home Assistant. Perfect if you want to get notified when something affects your daily commute, plan automations based on incidents, or simply keep an eye on the traffic situation in your area.
Home Assistant – Trafikinfo SE
Trafikinfo SE connects to Trafikverket’s open APIs and provides sensors for:
Accidents
Obstacles
Roadworks
Restrictions
Important traffic information
General traffic messages
You can use these sensors for notifications, automations, or dashboard visualization.
The integration can be installed via HACS as a custom repository.
Alongside the integration, I’ve also created a custom Lovelace card designed specifically to visualize traffic events in a clear and compact way on your Home Assistant dashboard.
Tried it yesterday and didnt get it to work. Did the same today and woked fine. Thanks. Currently I am using map radius on web to determine what is included in radius. A feature that would be nice is to see the radius of the chosen distance visually when setting up the area to be monitored.
Also, setting up an area I can set it to a specific road. Thats great. So lets say I am interested in accidents on a specific highway i set that area to that highway name and as I understand it it will filter on that only. Then I set up an area for a city but that highway runs through that city, then I dont want to get notifications from the city notification and the highway notification when the areas overlap. Can I in a similar fashion exluded roads when setting up an area? Am i making sense?
Home Assistant do not support displaying a radius in that way. The only place it seems possible is in the zone configuration. I looked into it, but I couldn’t find a good solution that didn’t require creating a zone first and then referencing that zone in the configuration, and that doesn’t feel optimal unfortunately.
You can specify more than one road within an area, so if you have a zone with, say, a 25 km radius around you, you can choose exactly which roads you want to include. Just separate them with commas in the configuration.
I haven’t added any support for exclusions, but there are ways to handle it. The simplest approach is probably to add a condition in your notification automation that checks the road attribute and makes sure it is not one of the specific roads you want to exclude.
The only time you need to create additional entries is when you want a different zone, for example around your cabin, your workplace, or similar, and it’s not covered by your current zone.
For example, I live in Gothenburg and have a 30 km radius, but only for the major roads around the city, and only when the accident has a high or very high impact.