This is a custom integration for Home Assistant that provides alerts from the official Luxembourg government's LU-Alert system.
It fetches data from the public data portal (data.public.lu) and presents alerts in a powerful and flexible way, allowing you to build robust automations and dashboard views based on official government warnings.
This integration is currently in a partially broken state. The core functionality of fetching alerts based on a minimum severity level is working, but several advanced features are disabled due to persistent errors.
We would be incredibly grateful for any help from the community to fix the following:
- Advanced Filtering: The logic for filtering alerts by location, watchlist keywords, and allergens is currently commented out as it was causing the integration to fail.
- Dashboard Card: The custom Lovelace card is not working. It fails to load resources and does not display alerts.
- Integration Thumbnail: The logo for the integration does not display correctly in Home Assistant.
If you have experience with Home Assistant custom integration development, please consider taking a look at the code to help resolve these issues. Your contributions would be much appreciated!
- Main Summary Sensor: A primary sensor (
sensor.lu_alert) that provides a count of active alerts and contains all alert details in its attributes. - Indexed Sensors for Dashboards: Simple sensors (
sensor.lu_alert_1,sensor.lu_alert_2, etc.) where the state is the alert's headline, for easy display on dashboards. - Critical Alert Binary Sensors: Dedicated binary sensors (e.g.,
binary_sensor.lu_alert_critical_alert_active) that turnonfor "Severe" or "Extreme" alerts, perfect for critical automations. - Custom Lovelace Card: A simple card to display the alerts on your dashboard.
- Single Device: All entities are grouped under a single "LU-Alert" device to keep your entity list clean.
- Configurable Severity Filtering: A dropdown menu in the configuration allows you to select the minimum severity of alerts you want the integration to process.
- UI-Based Configuration: No YAML required. Add and configure the integration directly from the Home Assistant UI.
- Efficient Polling: Uses a
DataUpdateCoordinatorto fetch data from the source API efficiently.
This integration is best installed via the Home Assistant Community Store (HACS).
- Ensure you have HACS installed.
- Go to HACS > Integrations > and click the three dots in the top right.
- Select "Custom repositories", add
https://github.com/koosoli/Lux-Alert-HACS-integrationas the repository URL, and select "Integration" as the category. - The "LU-Alert" integration will now be available in HACS. Click "Install".
- Restart Home Assistant.
- In Home Assistant, go to Settings > Devices & Services.
- Click the + ADD INTEGRATION button in the bottom right.
- Search for "LU-Alert" and click on it.
- You will be prompted to select a minimum severity level. Alerts below this level will be ignored by the entire integration. Select your desired level and click Submit.
- To change the severity level later, go to the integration's card on the Devices & Services page and click "Configure".
In the integration's options, you can also configure the following advanced features:
- Enable Location Filter: When enabled, only alerts that are relevant to your Home Assistant's location will be shown. You can configure your Home Assistant's location in the General Configuration settings.
- Latitude and Longitude: If you want to use a different location than your Home Assistant's default, you can specify a custom latitude and longitude.
- Watchlist Keywords: You can specify a comma-separated list of keywords. Only alerts that contain one or more of these keywords in their headline or description will be shown.
- Allergens: You can select a list of allergens. Only alerts that are related to one or more of these allergens will be shown.
This integration includes a custom Lovelace card (lu-alert-card) to display the alerts in a clean and organized way.
If you installed this integration via HACS, the card should be automatically registered with Home Assistant. You should be able to find the "Custom: LU-Alert Card" when you add a new card to your dashboard.
If the card is not available automatically, you can register it manually:
- Go to Settings > Dashboards.
- Click the three dots (⋮) in the top-right corner and select Resources.
- Click the + ADD RESOURCE button.
- Set the URL to
/hacsfiles/Lux-Alert-HACS-integration/lu-alert-card.js. - Set the Resource Type to
JavaScript Module. - Click CREATE.
The integration provides a set of powerful entities to work with:
sensor.lu_alert: The main sensor. Its state is the total number of active alerts that match your filter. The attributes contain a full list of all alert data.sensor.lu_alert_highest_severity: Shows the severity of the most critical active alert (e.g., "Minor", "Severe", or "None").
For easy display on dashboards, the integration creates sensors for the top alerts:
sensor.lu_alert_1,sensor.lu_alert_2, etc.- State: The headline of the alert.
- Attributes: All other data for that alert (description, severity, sent time, etc.).
- If no alert exists for that index, the state will be "No Alert".
These are perfect for triggering automations for critical events:
binary_sensor.lu_alert_critical_alert_active: Turnsonif there is any Severe OR Extreme alert.binary_sensor.lu_alert_severe_alert_active: Turnsononly for Severe alerts.binary_sensor.lu_alert_extreme_alert_active: Turnsononly for Extreme alerts.
This is a powerful and recommended way to configure your dashboard. It will be completely hidden until a "Severe" or "Extreme" alert occurs, at which point it will appear with the alert details.
Set the integration's "Minimum Severity" to "Information" to ensure it is aware of all alerts, then add this card to your dashboard:
type: conditional
conditions:
- entity: binary_sensor.lu_alert_critical_alert_active
state: 'on'
card:
type: entities
title: 🚨 CRITICAL ALERT 🚨
entities:
- sensor.lu_alert_1
- sensor.lu_alert_2
- sensor.lu_alert_3