A custom Home Assistant integration that monitors NL-Alert messages for the Netherlands and determines whether they are near or affecting your configured zone (e.g. zone.home).
The integration fetches official NL-Alert data, calculates accurate distances to alert areas (using polygon-edge math), and exposes multiple sensors for automation and dashboards.
- 🇳🇱 Uses the official NL-Alert public API
- 📍 Configurable zone (default:
zone.home) - 📏 Configurable radius (km)
- 🗺️ Accurate distance calculation:
- Distance to polygon edges
0 kmif your zone is inside the alert area
- 🧠 Fully configurable via the Home Assistant UI (no YAML)
- 🔄 Automatic updates on a configurable interval
- 🧾 Exposes alert text, timing, and distance
- 🕘 Tracks the most recent inactive NL-Alert
- ⚙️ Option to track last inactive alert:
- Only within your zone/radius or
- Anywhere in the Netherlands
- 🌍 English and Dutch translations included
- 🧩 HACS compatible
State
- Number of active NL-Alerts within your configured radius
Attributes
alerts: list of matching alertsidmessagestart_atstop_atdistance_km
State
- Distance (km) to the closest active NL-Alert area
Meaning
0.0 km→ your zone is inside the alert area> 0 km→ alert nearbyunknown→ no active alerts within radius
Tracks the most recent NL-Alert that is no longer active from the current API response.
State
- Timestamp when the last inactive alert stopped (shown in relative time like "4 days ago")
Attributes
idmessagestart_atstop_atdistance_km
Note: This sensor shows the latest inactive alert from the API at the time of each update. It does not persist historical data across restarts.
All configuration is done via:
Settings → Devices & Services → Add Integration → NL-Alert (Nearby)
- Name (default: NL-Alert (Nearby))
- Zone (default:
zone.home) - Radius (km) (default: 25.0)
- Update interval (seconds) (default: 300)
- Last inactive alert scope
- Only within your zone/radius (default)
- Anywhere in the Netherlands
- To change zone: Use the Reconfigure option (three dots menu → Reconfigure)
- To change radius, interval, or scope: Use the Options menu (three dots menu → Configure)
Note: Each zone can only be configured once. To monitor multiple zones, add multiple instances of the integration.
- Open HACS
- Go to Integrations
- Click ⋮ → Custom repositories
- Add:
- Repository:
https://github.com/Diondk/nlalert_radius - Category: Integration
- Repository:
- Search for NL-Alert (Nearby)
- Install
- Restart Home Assistant
- Add the integration via Devices & Services
- Download or clone this repository
- Copy the folder:
to your Home Assistant
custom_components/nlalert_radiuscustom_componentsdirectory - Restart Home Assistant
- Add the integration via Settings → Devices & Services → Add Integration
This automation triggers when any NL-Alert appears within your configured radius and sends a notification with the alert message and distance.
Example: If there's a fire in Roermond and you're 40 km away with a 70 km radius configured, you'll receive a notification like: "Brand in Roermond - Distance: 40 km"
automation:
- alias: "NL-Alert Nearby Notification"
trigger:
- platform: state
entity_id: sensor.nl_alert_nearby
condition:
- condition: numeric_state
entity_id: sensor.nl_alert_nearby
above: 0
action:
- service: notify.mobile_app
data:
title: "🚨 NL-Alert Nearby"
message: >
{{ state_attr('sensor.nl_alert_nearby', 'alerts')[0].message }}
Distance: {{ state_attr('sensor.nl_alert_nearby', 'alerts')[0].distance_km }} kmThis automation triggers when your zone is directly inside an active alert area (distance = 0 km), meaning you are in the affected zone and should take immediate action.
Example: If an NL-Alert is issued for your city and your home location is within the alert polygon, you'll receive: "Your location is affected!" with distance showing 0.0 km.
automation:
- alias: "NL-Alert Zone Inside Alert Area"
trigger:
- platform: numeric_state
entity_id: sensor.nl_alert_nearby_closest_distance
below: 0.1
action:
- service: notify.mobile_app
data:
title: "⚠️ NL-Alert - Your location is affected!"
message: >
{{ state_attr('sensor.nl_alert_nearby', 'alerts')[0].message }}- Check that you've restarted Home Assistant after installation
- Check the Home Assistant logs for errors related to
nlalert_radius
- Verify your zone entity has valid coordinates
- Check if there are any active NL-Alerts at https://api.public-warning.app/api/v1/providers/nl-alert/alerts
- Verify your radius is large enough
- Check the integration logs for API errors
- Each zone can only be configured once
- To change settings for an existing zone, use the Options or Reconfigure menu
- To monitor a different zone, delete the existing integration first or use a different zone entity
This integration uses the Public Warning App API which provides official NL-Alert data for the Netherlands.
API Endpoint: https://api.public-warning.app/api/v1/providers/nl-alert/alerts
This project is licensed under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
If you find this integration useful, please consider giving it a star on GitHub!