Brottsplatskartan smart home integration, free and open source

Swedish police events near your home, from Brottsplatskartan: counters, triggers and a widget.
Brottsplatskartan brings the events published by the Swedish police into Gladys: around your house, in a county (län) or in the places you name. For each followed zone, Gladys gets a device with the number of events of the last 24 hours by category (burglary, theft, violence, fire, road accident, other) and the latest event. A scene trigger fires on every new event, a scene action reads the recent events as one sentence, and a dashboard widget lists them.
The data comes from polisen.se, geocoded by Brottsplatskartan. Not affiliated with Brottsplatskartan nor with the Swedish police.
Requirements
- Gladys Assistant 5.1.0 or later.
- Internet access from Gladys: the integration reads
brottsplatskartan.seover HTTPS. No account and no key. - For the radius zone: a location for your house in Gladys (Settings → Houses), or coordinates typed in the configuration.
- Sweden only: the police of other countries is not covered.
Configuration
Install the integration (Integrations → Install from GitHub, address
https://github.com/guim31/gladys-brottsplatskartan), open its Configuration tab and fill in:
| Field | What it does |
|---|---|
| Centre latitude / longitude | Leave both empty to use the location of your house. Decimal point or comma. |
| Radius around the centre | 2, 5, 10, 20 or 50 km, or Off. The police often locates an event at the centre of a town or district only: 10 km or more is safer. Default: 10 km. |
| County (län) | Optional: follow every event of one of the 21 counties. |
| Places | Optional: municipalities, towns or districts, separated by commas, as the police names them (e.g. Solna, Sundbyberg). Accents are optional (Malmo finds Malmö). |
| Reading interval | 10, 15 or 30 minutes. Default: 15. |
| Language of the texts | Names of the features (at their creation) and texts sent to the scenes. Default: French. |
Save, then open the Discover tab and create the devices. Show the latest events checks the service at once and answers with the two newest events.
Devices
There is one device per zone:
- Police events near home: the events within the radius of the centre.
- Police events in my area: the events of the chosen county, plus those of the named places. It exists only when a county or places are filled in.
Each device has these features:
| Feature | Type | Meaning |
|---|---|---|
| Events (24 h) | counter | All the events of the zone in the last 24 hours. |
| Burglaries (24 h) | counter | Burglaries (Inbrott, Stöld/inbrott), attempts included. |
| Thefts (24 h) | counter | Thefts (Stöld, vehicle theft…). |
| Violence (24 h) | counter | Assaults, robberies, shootings, threats, murders, sexual offences. |
| Fires (24 h) | counter | Fires, arson, fire alarms. |
| Road accidents (24 h) | counter | Road accidents of every kind. |
| Other events (24 h) | counter | Everything else (drink driving, fraud, missing persons, checks…). |
| Latest event | text | Type (translated, with the Swedish label), place, date and distance. |
| Latest event distance | km | Radius zone only: how far the latest event is from the centre. |
The counters slide: an event leaves them 24 hours after its publication. The summaries of a night or a day that the police publishes for a whole county ("Sammanfattning natt") are left out: they repeat events already listed.
Widget
Police events lists the events of all your zones of the last 24 hours, newest first (8 rows at most): the type, the place, the time and the distance, with a coloured badge for the category. Tap a row to read the police headline and summary (in Swedish, as published) and to open the event on Brottsplatskartan.
Scene trigger
Brottsplatskartan: new police event fires as soon as a new event of one of your zones is read, if it was published less than two hours before. You can filter it by zone (near home, my area) and by category. An event in both zones fires once per zone: filter on the zone to avoid doubles. The events already listed at the first start, after a restart or after a change of settings fire nothing.
Variables: zone, category, zone_name, category_name, type (Swedish), type_name
(translated), place, location, distance_km (empty without a centre or for an event located by
its county only), headline (Swedish), summary, time (ISO 8601) and url.
Scene action
Brottsplatskartan: read the recent events returns text (the events of the last 24 hours as
one sentence, five at most, newest first) and count. It reads the service again if the last
reading is older than one interval.
Scene examples
- A burglary near home: trigger new police event, zone Near home, category Burglary → send a message with the summary and url variables.
- Morning briefing: every day at 7:30 → read the recent events → say or send its text output.
- Fire in the neighbourhood: trigger new police event, category Fire, then a condition on
distance_kmbelow 3 → turn on a light and send a notification.
Troubleshooting
- No radius device, or "No centre for the radius": give your house a location in Gladys, or type both coordinates.
- Few events near home: the police locates many events at the centre of a town or a district only, or at the county level (those never count in the radius zone). Widen the radius, or follow the county or the municipality.
- A place finds nothing: write it as the police does (the municipality, e.g.
Solna, or a district listed on Brottsplatskartan). - "Brottsplatskartan does not answer": the service is down or unreachable; the integration tries again at every interval and says once in the logs when it is back.
- Logs:
LOG_LEVEL=debugshows every reading. The location of your house is never logged.
Limits
- This is not an alarm: the police publishes its events minutes to hours after the facts, and only the ones it chooses to make public.
- A place matches the municipality, but also the districts and streets the police names: a common
name (a district called
Centrum) can catch events elsewhere in Sweden. Prefer a municipality. - Alarms (
Larm inbrott,Larm överfall) count as other events, not as burglaries. - Positions are approximate (a town, a district, a street) and come from Brottsplatskartan's geocoding.
- Headlines and summaries stay in Swedish; event types are translated from a list of the police types, an unknown type stays in Swedish.
- The integration keeps three days of events: the latest event of a zone quiet for longer reads "No recent event".
- Terms of the API (brottsplatskartan.se/sida/api): free
for non-commercial use, every call carries the
appparameter, 500 calls a minute at most. The integration reads only the new events, once per interval (about 100 calls a day).
Credits
Data: the Swedish police (polisen.se), through Brottsplatskartan. The idea comes
from the Home Assistant brottsplatskartan integration. Not affiliated with Brottsplatskartan nor
with the Swedish police.
Configuration settings
These are the settings Brottsplatskartan asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| Your zones | section | No | The events the Swedish police publishes, around your house (or coordinates) and/or in a county or named places. Each zone is a device. Save, then create the devices in the Discover tab. |
| Sources and limits | section | No | Events of the Swedish police (polisen.se), geocoded by Brottsplatskartan, read without an account. Published minutes to hours after the facts, often located at a town or district only. Not an alarm. Not affiliated with Brottsplatskartan nor the police. |
| Centre latitude | string | No | Leave both coordinates empty to use the location of your house in Gladys. |
| Centre longitude | string | No | Decimal degrees, east positive. |
| Radius around the centre | select | No | The police often locates an event at a town or district only: 10 km or more is safer. Off: no radius zone. |
| County (län) | select | No | Optional: also follow every event of a county, in a second device. |
| Places | string | No | Optional, in the same device as the county: municipalities, towns or districts, separated by commas, as the police names them (e.g. Solna, Sundbyberg). |
| Reading interval | select | No | Brottsplatskartan caches its answers a few minutes; reading more often brings nothing. |
| Language of the texts | select | No | Names of the features (at their creation) and texts sent to the scenes. |
How to install Brottsplatskartan in Gladys
- In Gladys, open Integrations: Brottsplatskartan appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/guim31/gladys-brottsplatskartan:1.0.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration). - Open the Configuration screen of the integration, fill in the settings, and save.
- You can also install it directly from its repository URL: https://github.com/guim31/gladys-brottsplatskartan.
Brottsplatskartan requires Gladys >=5.1.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.
Not running Gladys yet? It is free and open source: follow the installation guide to get started.
About external integrations
Brottsplatskartan is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by guim31, not by the Gladys core team.
- Browse all integrations, native and community
- Build and publish your own external integration
- Source code on GitHub — source of this documentation