[Custom Integration] Dutch emergency service alerts sensors

Small disclaimer: this custom integration has potentially limited use to others; I built it for my own pleasure.

For background, I’ve been working on a hobby project where I collect public emergency service alerts in the Netherlands (P2000) and plot them on a map after enriching and contextualizing them: zwaailicht.nu.

I wanted my Sonoff NSPanel to alert me whenever there’s an emergency service call nearby. So I vibe-coded this custom integration, which closed a nice loop: I receive the raw P2000 pager messages via an RTL-SDR dongle plugged into the same Raspberry Pi that runs my Home Assistant.

These raw received messages are cryptic pager codes like P1 BNH-03 BR WONING WESTZIJDE ZAANDAM 118032. They go out to a VPS where I run an enrichment pipeline (geocoding, incident type classification, AI summaries, clustering nearby calls into incidents, matching to news articles), and return to that same Pi via this HACS integration as something more comprehensible — like “Large fire at Westzijde in Zaandam, 5 units dispatched” — including lat/long coordinates.

What the integration provides:

  • Two sensors: one for meldingen (individual dispatches), one for pieken (notable multi-unit incidents)
  • State shows the most recent alert within a configurable radius from home
  • Attributes include dienst, priority, distance, AI summary, street name, coordinates, and timestamp
  • Custom events (zwaailicht_new_alert, zwaailicht_new_piek) that fire once per new alert

My automation: the NSPanel receives a notification on any urgent call within 2 km, and when bursts of activity are detected nearby. Useful? Questionable. Fun to build? Quite :-).

Links:

Curious if there are other RTL-SDR / P2000 hobbyists here, and what automations you’d build with this.

Well, when my elderly mother was still alive I had setup a 500m radius around the house where she lived and an automation that triggered at specific P2000 messages at that location. Since she lived about 100km away I was happy to get notified as soon as possible.

1 Like

Thank you for this integration. It works very nice :+1:

1 Like

looking very good, and the zwaailicht site is amazing also. thanks for creating this.

if I may:
the attributes are a bit much. Also, it seems there is a bit of an issue, as my ‘Roosendaal’ location attribute recent_pieken also shows a myriad of other locations in the attribute :wink:
making that even larger…

[
  {
    "id": "https://zwaailicht.nu/pieken/roosendaal/2026-04-20/b7223e",
    "title": "Woningbrand Gezellelaan Roosendaal, twee gewonden",
    "timestamp": "2026-04-20T15:48:58Z",
    "link": "https://zwaailicht.nu/pieken/roosendaal/2026-04-20/b7223e",
    "dienst": "piek",
    "stad": "roosendaal",
    "latitude": 51.5226,
    "longitude": 4.4623,
    "distance_km": 1.3,
    "summary": "Rond 17:33 uur brak een woningbrand uit aan de Gezellelaan in Roosendaal. De brandweer rukte met spoed uit met meerdere eenheden. De brand bleek al snel uit te groeien tot een grote woningbrand in een tussenwoning met zonnepanelen, waarbij het dak betrokken raakte. Een ambulance werd ingezet voor medische assistentie. Volgens diverse nieuwsbronnen raakten twee mensen gewond bij de brand. De traumahelikopter werd ingezet voor vervoer van de slachtoffers. De brand vereiste een grootschalige inzet van brandweerkrachten om onder controle te worden gebracht."
  },
  {
    "id": "https://zwaailicht.nu/pieken/zaltbommel/2026-04-20/58ef8f",
    "title": "Groot incident Havendijk Zaltbommel",
    "timestamp": "2026-04-20T15:03:33Z",
    "link": "https://zwaailicht.nu/pieken/zaltbommel/2026-04-20/58ef8f",
    "dienst": "piek",
    "stad": "zaltbommel",
    "summary": "Groot incident rond 16:48 uur aan de Havendijk in Zaltbommel met inzet van zes ambulances (A1-prioriteit) en brandweer. Het incident betreffen scheepvaart/pleziervaart op het water. Binnen twaalf minuten waren meerdere eenheden ter plaatse."
  },
  {
    "id": "https://zwaailicht.nu/pieken/den-haag/2026-04-20/a35d63",
    "title": "Verkeersongeval Guntersteinweg, 's-Gravenhage",
    "timestamp": "2026-04-20T14:27:02Z",
    "link": "https://zwaailicht.nu/pieken/den-haag/2026-04-20/a35d63",
    "dienst": "piek",
    "stad": "den-haag",
    "summary": "Ernstig verkeersongeval met letsel aan de Guntersteinweg/Rijnauwenstraat in 's-Gravenhage rond 16:21 uur, met inzet van politie en ambulance (A2-prio). Parallel liepen vier aanvullende ambulancemeldingen voor medische incidenten elders in de stad (B2 en A2-prioriteiten)."
  },
  {
    "id": "https://zwaailicht.nu/pieken/roosendaal/2026-04-20/bc0bbf",
    "title": "Grote woningbrand Gezellelaan Roosendaal",
    "timestamp": "2026-04-20T14:27:34Z",
    "link": "https://zwaailicht.nu/pieken/roosendaal/2026-04-20/bc0bbf",
    "dienst": "piek",
    "stad": "roosendaal",
    "latitude": 51.5239,
    "longitude": 4.4615,
    "distance_km": 1.4,
    "summary": "Rond 16:02 uur brak een brand uit in een woning aan de Gezellelaan in Roosendaal. De brandweer rukten met spoed uit en klasseerden het incident eerst als een middelbrand, maar escaleerden dit al snel tot een grote brand. Het pand betrof een tussenwoning met zonnepanelen, waarbij het vuur ook in het dak uitbrak. Meerdere brandweervoertuigen en ambulances werden ingezet. Volgens de lokale media werd de brand geblust door de brandweer. Er zijn gewonden gemeld die door ambulances werden behandeld. De operatie duurde tot minimaal 16:16 uur."
  },
  {
    "id": "https://zwaailicht.nu/pieken/ede/2026-04-20/b1b3df",
    "title": "Eenzijdig verkeersongeval Galvanistraat Ede",
    "timestamp": "2026-04-20T14:04:17Z",
    "link": "https://zwaailicht.nu/pieken/ede/2026-04-20/b1b3df",
    "dienst": "piek",
    "stad": "ede",
    "summary": "Rond 15:49 uur gebeurde een eenzijdig verkeersongeval met letsel op de Galvanistraat in Ede. De brandweer, ambulances en politie rukten met spoed uit naar het incident. Volgens 112 Vallei sloeg een auto over de kop na een botsing met varkensruggen op de weg. EdeStad.nl meldt dat de Galvanistraat voor verkeer werd afgesloten in verband met het ongeval. Meerdere ambulances werden ingezet voor de hulpverlening aan de gewonde(n). De exacte ernst van de verwondingen is nog niet bekendgemaakt."
  },
  {
    "id": "https://zwaailicht.nu/pieken/zwolle/2026-04-20/ca2e4b",
    "title": "Zware aanrijding lijnbus-auto op Reggelaan Zwolle",
    "timestamp": "2026-04-20T14:00:25Z",
    "link": "https://zwaailicht.nu/pieken/zwolle/2026-04-20/ca2e4b",
    "dienst": "piek",
    "stad": "zwolle",
    "summary": "Rond 15:42 uur gebeurde een ernstige aanrijding op de Reggelaan in Zwolle tussen een personenauto en een lijnbus. Ambulances en brandweer rukten direct uit met spoed (P1) naar de plaats van het ongeval. Volgens 112 in Beeld raakte een vrouw zwaargewond bij de botsing. De auto was zwaar beschadigd. Kort na aankomst van de hulpdiensten werd reanimatie ingesteld, wat suggereert dat er mogelijk levensgevaarlijke verwondingen waren. De eerste meldingen kwamen binnen tussen 15:42 en 15:46 uur, met meerdere ambulances en brandweervoertuigen gealarmeerd vanwege het letselongeval."
  },
  {
    "id": "https://zwaailicht.nu/pieken/eindhoven/2026-04-20/48699f",
    "title": "Woningbrand Boschdijk Eindhoven",
    "timestamp": "2026-04-20T13:05:31Z",
    "link": "https://zwaailicht.nu/pieken/eindhoven/2026-04-20/48699f",
    "dienst": "piek",
    "stad": "eindhoven",
    "summary": "Rond 14:47 uur brak een woningbrand uit aan de Boschdijk in Eindhoven. De brandweer rukte met spoed uit (P1) en was met meerdere eenheden ter plaatse voor inzet op grote hoogte. Ook ambulances werden gealarmeerd en voerden meerdere ritten uit. Volgens AD.nl en Eindhovels Dagblad ontstond de brand in een woning aan de Boschdijk. De omstandigheden van het incident zijn nog onduidelijk uit de beschikbare informatie."
  },
  {
    "id": "https://zwaailicht.nu/pieken/amsterdam/2026-04-20/cdfeab",
    "title": "Meerdere verkeersongevallen Amsterdam",
    "timestamp": "2026-04-20T13:02:48Z",
    "link": "https://zwaailicht.nu/pieken/amsterdam/2026-04-20/cdfeab",
    "dienst": "piek",
    "stad": "amsterdam",
    "summary": "Tussen 14:38 en 14:54 uur ontving het ambulancevervoer in Amsterdam twaalf meldingen, hoofdzakelijk van hoge urgentie. De meldingen betroffen onder meer een verkeersongeval op de A2 ter hoogte van knooppunt Holendrecht en meerdere incidenten op verschillende locaties in de stad, waaronder de Cornelis Roobolstraat waar herhaalde meldingen binnenkwamen. Volgens AD.nl gebeurden verkeersongevallen met gewonden op de Gustav Mahlerlaan, Burgemeester De Vlugtlaan en Dr. H. Colijnstraat. De exacte omstandigheden en het aantal gewonden per incident zijn niet volledig uit de beschikbare informatie op te maken, maar alle meldingen wijzen op een piek in verkeersongevallen in en rond Amsterdam op deze dag."
  },
  {
    "id": "https://zwaailicht.nu/pieken/eindhoven/2026-04-20/8b2049",
    "title": "Verkeersongeval Ekkersrijt, Eindhoven",
    "timestamp": "2026-04-20T12:37:46Z",
    "link": "https://zwaailicht.nu/pieken/eindhoven/2026-04-20/8b2049",
    "dienst": "piek",
    "stad": "eindhoven",
    "summary": "Verkeersongeval met letsel aan de Ekkersrijt op het Industrieterrein in Eindhoven rond 14:28 uur met politie-, ambulance- en spoedresponse. Vijf ambulances werden ingezet, waarvan drie met A1-prioriteit, wat wijst op meerdere slachtoffers. Het ongeval veroorzaakte een piek in hulpverleningsactiviteit in tien minuten."
  },
  {
    "id": "https://zwaailicht.nu/pieken/den-haag/2026-04-20/1383d1",
    "title": "Voertuig te water en verkeersongeval Den Haag",
    "timestamp": "2026-04-20T11:02:09Z",
    "link": "https://zwaailicht.nu/pieken/den-haag/2026-04-20/1383d1",
    "dienst": "piek",
    "stad": "den-haag",
    "summary": "Rond 12:40 uur een voertuig te water aan Munirpad in Den Haag met inzet van politie en ambulance. Vrijwel gelijktijdig een verkeersongeval met letsel aan Nieuwe Parklaan ook met politie ter plaatse. Daarnaast waren er drie losse ambulancemeldingen op andere locaties in de stad."
  }
]
1 Like

Thank you! And good catch on the recent_pieken, but that one is actually intentional; pieken are different from regular meldingen, as they are curated summaries of notable incidents that span multiple alerts, sometimes across different locations. They are lower volume and in principle should represent bigger events with national relevance. At least, that’s the thought.

The coordinates you see on some of the pieken are computed centroids of multiple alerts, not a precise incident location like with individual meldingen. I don’t use them for filtering now as I do not have geo for all pieken and because of the above reasoning (same on the website), but perhaps I could/should (or fall back to place-level filtering when there’s no lat/long).

1 Like

Yeah, please consider using dedicated entities for that (like HA advocates opposed to 1 entity with many attributes)

Especially for this one as one could simply disable it if of no interest to the user .

I’d like to see local alerts only on my local instance.

National emergencies should really get singled out as they have major relevance and shouldn’t be buried in an attribute ….

All of the others well, make it up to the users to use them or not, and, keep the state machine tidy :wink:

1 Like

Thank you for the feedback and pointing me in the right direction. I’ve now changed to splitting them into custom sensor entities per type (regular alerts, filterable by radius and “bursts” sensor). Hope this fits better in the HA ecosystem!

1 Like

great, that for that!

will update when available.

let me ask: is there such a thing as national alerts?
I mean that is not the same as the Bursts, which in my case (Roosendaal) still show many calls from Amsterdam, that are not local ob viouslym but not ‘national’ either at all.

I feel it would be very useful if we could get those national alerts, and pure local ones, but leave out the bursts if not belonging to either of these categories.

Maybe we can already do that with current settings, if so, please point me to that.
if not, maybe consider a FR?

Hello David,

Well done, looks good. I also use RTL-SDR to turn on the home lighting when I get a notification. It works fine, but sometimes I get the feeling that it misses notifications or doesn't post them to HA.

Do you have any challenges with this as well?

example:
2026-06-03 09:40:40 - (DataThread) - p2000.py - DEBUG - FLEX|2026-06-03 07:40:40|1600/2/K/A|10.031|002029583|ALN|P 1 BMD-04 BR wegvervoer Waterlinieweg Utrecht 094831 094631

ignored because 002029583 is a multi capcode or something

I tried to setup. But it wont let me:

Failed setup, will retry: Feed returned HTTP 503 for https://zwaailicht.nu/feed/meldingen.xml

should be back up by now!