Brings the official PolyAlert / BABS public warnings from alert.swiss into Home Assistant — storms, hail, floods, fires, droughts, civil-protection events and more. Fetched server-side every 2 minutes — no API key, no CORS hassle.
Switzerland's federal civil-protection system (BABS) publishes official public warnings — severe weather, floods, fires, drinking-water issues, chemical/industrial incidents, drought measures and more — on alert.swiss.
This integration pulls those warnings into Home Assistant so you can see them on your dashboard and act on them automatically (notify everyone, close the windows, switch on the air purifier, flash the lights…). It’s the same data the official site shows — just where your smart home already lives.
Why? The website refreshes every few seconds but you have to look at it. Home Assistant can react — and tell you before you ever open a browser.
flowchart LR
A["alert.swiss<br/>PolyAlert feed (JSON)"] -->|poll every 2 min, server-side| B[AlertSwiss Coordinator]
B -->|drop test / technical / all-clear<br/>optional canton filter| C["sensor.alertswiss_meldungen<br/>(count + details)"]
B --> D["binary_sensor.alertswiss_warnung_aktiv<br/>(safety)"]
C --> E[Dashboards & Automations]
D --> E
- Server-side fetch — Home Assistant’s backend calls the official feed directly (so there’s no browser CORS limitation and no third-party proxy).
- Coordinator — one shared poller (every 2 minutes) keeps all entities in sync and resilient to outages.
- Filtering — test/technical alerts and "all-clear" messages are removed; an optional canton/area filter keeps only what’s relevant to you.
- Entities — a numeric
sensor(with full details in attributes) and abinary_sensor(safety) you can trigger automations on.
- 🛡️ Official source — Swiss Federal Office for Civil Protection (BABS) PolyAlert feed
- ⚡ Live — polled every 2 minutes, server-side
- 🎯 Region filter — show all of Switzerland or just your canton (e.g.
Zürich) - 🧹 Clean — test alerts, technical tests and "all-clear" messages are filtered out
- 🔔 Automation-ready — fire push notifications, flash lights, close covers on severe events
- 🔑 Zero config — works out of the box, no token required
- HACS → ⋮ → Custom repositories
- Add
https://github.com/forseti1982/HA-AlertSwiss— category Integration - Install AlertSwiss and restart Home Assistant
- Settings → Devices & Services → Add Integration → AlertSwiss
- (optional) enter a canton/area filter such as
Zürich
Copy custom_components/alertswiss into your HA config/custom_components/ folder and restart.
| Entity | Description |
|---|---|
sensor.alertswiss_meldungen |
Number of active alerts. Attributes: alerts[] (title, event, severity, publisher, description, instructions, link), titles, max_severity |
binary_sensor.alertswiss_warnung_aktiv |
on while any alert is active · device_class: safety |
alias: AlertSwiss – Push on new warning
triggers:
- trigger: state
entity_id: binary_sensor.alertswiss_warnung_aktiv
to: "on"
actions:
- action: notify.notify
data:
title: "⚠️ AlertSwiss"
message: >
{{ state_attr('sensor.alertswiss_meldungen', 'titles') | join(', ') }}type: markdown
content: |
{% set alerts = state_attr('sensor.alertswiss_meldungen','alerts') or [] %}
{% if alerts %}
## ⚠️ {{ alerts | count }} active alert(s)
{% for a in alerts %}
**{{ a.title }}** — _{{ a.severity }}_ · {{ a.publisher }}
{% endfor %}
{% else %}
✅ No active warnings.
{% endif %}| Option | Default | Description |
|---|---|---|
| Cantons | (none) | Multi-select of the 26 Swiss cantons. Only alerts for the selected cantons count (so a hazard in e.g. Zürich actively triggers your sensor/automation). No selection = whole country |
| Always include nationwide | true |
Keep country-wide alerts even when specific cantons are selected |
Unofficial community integration. Not affiliated with or endorsed by BABS / alert.swiss. Alert data © BABS / alert.swiss. Always follow official channels in an emergency.
Made with 🧡 in Switzerland · powered by Home Assistant