Diese Home-Assistant-Custom-Integration liest aktuelle Gamma-Ortsdosisleistungswerte (ODL) aus der öffentlichen BfS-ODL-Info-API und lässt den Nutzer während der Einrichtung nahegelegene Messpunkte auswählen.
- HACS-kompatible Custom Integration
- Einrichtungsassistent mit Messpunkt-Auswahl auf Basis des Home-Assistant-Standorts oder manueller Koordinaten
- Benutzerdefinierbare Schwellen für den Sensor Messwertbewertung
- Standardschwellen
0,05 µSv/hund0,18 µSv/h - Hauptsensor für den aktuellen 1-Stunden-Gamma-ODL-Wert
- Zusätzliche Diagnose-Sensoren für kosmischen und terrestrischen Anteil, Entfernung, Höhe über NN, Prüfstatus, Messstellenstatus, Messnetzknoten, Messstations-ID, Stationscode sowie Messbeginn und Messende
- Deutsche und englische Sprachdateien enthalten
- Zeitstempel aus der API werden als UTC/Zulu behandelt; Home Assistant rechnet die Timestamp-Sensoren für die Anzeige in die Nutzerzeitzone um
- Dieses Projekt in ein öffentliches GitHub-Repository legen.
- In HACS als Benutzerdefiniertes Repository vom Typ Integration hinzufügen.
- Repository über HACS installieren.
- Home Assistant neu starten.
- BfS ODL über Einstellungen → Geräte & Dienste → Integration hinzufügen einrichten.
custom_components/bfs_odlin dein Home-Assistant-Konfigurationsverzeichnis kopieren.- Optional zusätzlich den gewünschten Blueprint-Unterordner kopieren:
blueprints/automation/bfs_odl/deblueprints/automation/bfs_odl/en
- Home Assistant neu starten.
- BfS ODL über Einstellungen → Geräte & Dienste → Integration hinzufügen einrichten.
Der Einrichtungsassistent hat vier Schritte:
- Standortquelle, Suchradius, Anzahl vorgeschlagener Messpunkte und Aktualisierungsintervall festlegen.
- Falls manuelle Position gewählt wurde: manuelle Koordinaten eingeben.
- Einen oder mehrere nahegelegene Messpunkte auswählen.
- Die untere und obere Schwelle für den Sensor Messwertbewertung festlegen.
- Untere Schwelle: 0,05 µSv/h
- Obere Schwelle: 0,18 µSv/h
Wenn diese Standardwerte verwendet werden, nutzt der Bewertungssensor die Formulierung natürlicher Bereich:
below_natural_range→ Unter natürlichem Bereichwithin_natural_range→ Im natürlichen Bereichabove_natural_range→ Über natürlichem Bereich
Wenn mindestens eine Schwelle geändert wird, nutzt der Bewertungssensor die Formulierung konfigurierter Bereich:
below_configured_range→ Unter konfiguriertem Bereichwithin_configured_range→ Im konfigurierten Bereichabove_configured_range→ Über konfiguriertem Bereich
Zusätzlicher Zustand:
no_data→ Keine Daten
- Gamma-ODL (1h)
- Messwertbewertung
Die Messwertbewertung ist eine Einordnungshilfe und kein rechtlicher Strahlenschutz-Grenzwertalarm.
Wenn die Standardschwellen verwendet werden:
- Unter natürlichem Bereich: Wert
< 0,05 µSv/h - Im natürlichen Bereich: Wert
0,05 µSv/hbis0,18 µSv/h - Über natürlichem Bereich: Wert
> 0,18 µSv/h
Wenn benutzerdefinierte Schwellen verwendet werden:
- Unter konfiguriertem Bereich: Wert
< untere Schwelle - Im konfigurierten Bereich:
untere Schwelle <= Wert <= obere Schwelle - Über konfiguriertem Bereich: Wert
> obere Schwelle
Wenn kein gültiger aktueller Wert vorhanden ist:
- Keine Daten
- Gamma-ODL kosmisch (1h)
- Gamma-ODL terrestrisch (1h)
- Entfernung
- Höhe über NN
- Messstations-ID
- Stationscode
- Prüfstatus
- Messstellenstatus
- Messnetzknoten
- Messbeginn
- Messende
Der Hauptsensor Gamma-ODL (1h) stellt eine bereinigte Attributliste ohne Dubletten bereit:
station_codestation_idfeature_idpostal_codestation_namecoordinatesdistance_kmmeasurement_startmeasurement_endmeasurement_start_utcmeasurement_end_utcapi_timestampapi_timestamp_utcdurationquantityvalidation_codevalidation_statussite_status_codesite_statusnetwork_node_idnetwork_nodeheight_above_sea_mcosmic_value_uSv_hterrestrial_value_uSv_hcosmic_share_percentterrestrial_share_percentassessment_stateassessment_threshold_low_uSv_hassessment_threshold_high_uSv_hassessment_uses_default_thresholdsassessment_modelapi_timezonelocal_timezone
Die API dokumentiert start_measure, end_measure und timeStamp als ISO-Datetimes mit Z. Diese Integration behandelt die Zeitangaben der API deshalb als UTC.
Die Integration:
- hält die Timestamp-Sensoren timezone-aware in UTC
- stellt
MessbeginnundMessendeals Timestamp-Sensoren bereit, die Home Assistant in der Oberfläche in die Nutzerzeitzone umrechnet - ergänzt am Hauptsensor sowohl lokale Zeit (
measurement_start,measurement_end,api_timestamp) als auch die ursprünglichen UTC-Zeitpunkte (*_utc)
Die Blueprints liegen in zwei getrennten Sprachversionen vor:
blueprints/automation/bfs_odl/de/reference_range_notification.yamlblueprints/automation/bfs_odl/de/sudden_change_notification.yamlblueprints/automation/bfs_odl/de/data_unavailable_notification.yaml
blueprints/automation/bfs_odl/en/reference_range_notification.yamlblueprints/automation/bfs_odl/en/sudden_change_notification.yamlblueprints/automation/bfs_odl/en/data_unavailable_notification.yaml
Die Blueprints werden von Home Assistant nicht automatisch beim Installieren der Integration importiert.
Für weniger versierte Nutzer ist das der einfachste Weg:
- In Home Assistant zu Einstellungen → Automatisierungen & Szenen → Blueprints gehen.
- Unten rechts auf Blueprint importieren klicken.
- Den passenden RAW-Link des gewünschten deutschen Blueprints in das Eingabefeld einfügen.
- Den Import bestätigen.
- Danach den Blueprint öffnen und daraus eine Automation erstellen.
Direkte RAW-Links der deutschen Blueprints:
-
Referenzbereich-Benachrichtigung:
https://raw.githubusercontent.com/Q14siX/bfs_odl/main/blueprints/automation/bfs_odl/de/reference_range_notification.yaml
-
Sprunghafte Änderung:
https://raw.githubusercontent.com/Q14siX/bfs_odl/main/blueprints/automation/bfs_odl/de/sudden_change_notification.yaml
-
Daten nicht verfügbar:
https://raw.githubusercontent.com/Q14siX/bfs_odl/main/blueprints/automation/bfs_odl/de/data_unavailable_notification.yaml
Alternativ können die deutschen YAML-Dateien direkt nach folgendem Ordner kopiert werden:
<config>/blueprints/automation/bfs_odl/de/
Danach Home Assistant neu laden oder neu starten.
Der deutsche Referenzbereich-Blueprint zeigt lesbare deutsche Auswahltexte an. Intern arbeitet er weiterhin mit den Rohzuständen des Bewertungssensors.
- Solange die Standardschwellen aktiv sind, werden intern die Zustände
*_natural_rangeverwendet. - Bei benutzerdefinierten Schwellen werden intern die Zustände
*_configured_rangeverwendet.
- Den Ordner
custom_components/bfs_odlersetzen. - Falls du auch die neuesten Blueprint-Versionen möchtest, zusätzlich
blueprints/automation/bfs_odl/deund/oderblueprints/automation/bfs_odl/enersetzen. - Home Assistant vollständig neu starten.
- Falls gewünscht, anschließend in den Integrationsoptionen die Schwellen anpassen.
- Falls Home Assistant noch eine verwaiste Alt-Entität aus einem früheren fehlerhaften Build anzeigt, diesen veralteten Eintrag einmalig löschen und die Integration neu laden.
API konnte nicht erreicht werden
- Prüfe, ob Home Assistant ausgehenden HTTPS-Zugriff hat.
- Starte Home Assistant nach dem Dateiaustausch neu.
- Öffne den Einrichtungsassistenten erneut, wenn du den Integrationsordner manuell ersetzt hast.
Unbekannter Fehler bei manuellen Koordinaten
- Verwende numerische Werte für Breiten- und Längengrad.
- Breitengrad muss zwischen
-90und90liegen. - Längengrad muss zwischen
-180und180liegen.
Bewertungssensor nicht sichtbar
- Starte Home Assistant nach dem Update neu.
- Suche nach der Entität
measurement_assessmentoderMesswertbewertung. - Lösche alte verwaiste Entitäten nur dann, wenn Home Assistant sie ausdrücklich als nicht mehr bereitgestellt kennzeichnet.
Zustände wirken nach Änderung der Schwellen falsch
- Öffne die Integrationsoptionen und prüfe die konfigurierte untere und obere Schwelle.
- Wenn die Schwellen exakt den Standardwerten entsprechen, verwendet der Sensor die Formulierungen zum natürlichen Bereich.
- Wenn die Schwellen von den Standardwerten abweichen, verwendet der Sensor die Formulierungen zum konfigurierten Bereich.
This Home Assistant custom integration reads current gamma ambient dose rate (ODL) values from the public BfS ODL-Info API and lets the user select nearby measurement points during setup.
- HACS-compatible custom integration
- Setup flow with station selection based on the Home Assistant location or manual coordinates
- User-configurable thresholds for the Measurement assessment sensor
- Default thresholds
0.05 µSv/hand0.18 µSv/h - Main sensor for the current 1-hour gamma ODL value
- Additional diagnostic sensors for cosmic and terrestrial share, distance, elevation, validation status, station status, network node, measurement station ID, station code, measurement start, and measurement end
- German and English translation files included
- API timestamps are treated as UTC/Zulu; Home Assistant renders timestamp sensors in the user timezone
- Put this project into a public GitHub repository.
- In HACS, add it as a Custom repository of type Integration.
- Install the repository via HACS.
- Restart Home Assistant.
- Add BfS ODL via Settings → Devices & services → Add integration.
- Copy
custom_components/bfs_odlinto your Home Assistant configuration directory. - Optionally also copy the blueprint language folder you want:
blueprints/automation/bfs_odl/deblueprints/automation/bfs_odl/en
- Restart Home Assistant.
- Add BfS ODL via Settings → Devices & services → Add integration.
The setup wizard has four steps:
- Choose the location source, search radius, number of suggested stations, and update interval.
- Enter manual coordinates if manual position was selected.
- Select one or more nearby measurement points.
- Set the lower and upper thresholds for the Measurement assessment sensor.
- Lower threshold: 0.05 µSv/h
- Upper threshold: 0.18 µSv/h
If these default values are used, the assessment sensor uses natural range wording:
below_natural_range→ Below natural rangewithin_natural_range→ Within natural rangeabove_natural_range→ Above natural range
If at least one threshold is changed, the assessment sensor uses configured range wording:
below_configured_range→ Below configured rangewithin_configured_range→ Within configured rangeabove_configured_range→ Above configured range
Additional state:
no_data→ No data
- Gamma ODL (1h)
- Measurement assessment
The measurement assessment is a classification helper and not a legal radiation alarm.
If the default thresholds are used:
- Below natural range: value
< 0.05 µSv/h - Within natural range: value
0.05 µSv/hto0.18 µSv/h - Above natural range: value
> 0.18 µSv/h
If custom thresholds are used:
- Below configured range: value
< lower threshold - Within configured range:
lower threshold <= value <= upper threshold - Above configured range: value
> upper threshold
If no valid current value is available:
- No data
- Gamma ODL cosmic (1h)
- Gamma ODL terrestrial (1h)
- Distance
- Height above sea level
- Measurement station ID
- Station code
- Validation status
- Measurement point status
- Network node
- Measurement start
- Measurement end
The main Gamma ODL (1h) sensor exposes a cleaned-up attribute set without duplicates:
station_codestation_idfeature_idpostal_codestation_namecoordinatesdistance_kmmeasurement_startmeasurement_endmeasurement_start_utcmeasurement_end_utcapi_timestampapi_timestamp_utcdurationquantityvalidation_codevalidation_statussite_status_codesite_statusnetwork_node_idnetwork_nodeheight_above_sea_mcosmic_value_uSv_hterrestrial_value_uSv_hcosmic_share_percentterrestrial_share_percentassessment_stateassessment_threshold_low_uSv_hassessment_threshold_high_uSv_hassessment_uses_default_thresholdsassessment_modelapi_timezonelocal_timezone
The API documents start_measure, end_measure, and timeStamp as ISO datetimes with Z. This integration therefore treats upstream timestamps as UTC.
The integration:
- keeps timestamp sensors timezone-aware in UTC
- exposes
Measurement startandMeasurement endas timestamp sensors that Home Assistant renders in the user timezone - adds both local time (
measurement_start,measurement_end,api_timestamp) and the original UTC instants (*_utc) to the main sensor
Blueprints are available in two separate language sets:
blueprints/automation/bfs_odl/de/reference_range_notification.yamlblueprints/automation/bfs_odl/de/sudden_change_notification.yamlblueprints/automation/bfs_odl/de/data_unavailable_notification.yaml
blueprints/automation/bfs_odl/en/reference_range_notification.yamlblueprints/automation/bfs_odl/en/sudden_change_notification.yamlblueprints/automation/bfs_odl/en/data_unavailable_notification.yaml
Blueprints are not imported automatically when the integration is installed.
For less technical users this is usually the easiest method:
- In Home Assistant open Settings → Automations & Scenes → Blueprints.
- Click Import Blueprint in the lower right corner.
- Paste the matching RAW link of the English blueprint you want to import.
- Confirm the import.
- Open the imported blueprint and create an automation from it.
Direct RAW links for the English blueprints:
-
Reference range notification:
https://raw.githubusercontent.com/Q14siX/bfs_odl/main/blueprints/automation/bfs_odl/en/reference_range_notification.yaml
-
Sudden change:
https://raw.githubusercontent.com/Q14siX/bfs_odl/main/blueprints/automation/bfs_odl/en/sudden_change_notification.yaml
-
Data unavailable:
https://raw.githubusercontent.com/Q14siX/bfs_odl/main/blueprints/automation/bfs_odl/en/data_unavailable_notification.yaml
Alternatively, copy the English YAML files directly into:
<config>/blueprints/automation/bfs_odl/en/
Then reload Home Assistant or restart it.
The English reference-range blueprint shows readable English labels in the selection field. Internally it still works with the raw states of the assessment sensor.
- While the default thresholds are active it internally uses the
*_natural_rangestates. - With custom thresholds it internally uses the
*_configured_rangestates.
- Replace the
custom_components/bfs_odlfolder. - If you also want the latest blueprint versions, also replace
blueprints/automation/bfs_odl/deand/orblueprints/automation/bfs_odl/en. - Restart Home Assistant completely.
- Open the integration options if you want to change thresholds later.
- If Home Assistant still shows an old orphaned entity from an earlier broken build, remove that stale entity once and reload the integration.
API could not be reached
- Verify outbound HTTPS access from Home Assistant.
- Restart Home Assistant after replacing files.
- Re-open the setup flow if you changed the integration folder manually.
Unknown error during manual coordinates
- Use numeric latitude/longitude values.
- Latitude must be between
-90and90. - Longitude must be between
-180and180.
Assessment sensor not visible
- Restart Home Assistant after updating the integration.
- Search for the entity by
measurement_assessmentor “Measurement assessment”. - Remove stale old entities only if they are explicitly shown as no longer provided.
States look wrong after changing thresholds
- Open the integration options and verify the configured lower and upper thresholds.
- If thresholds match the defaults exactly, the sensor uses the natural-range wording.
- If thresholds differ from the defaults, it uses the configured-range wording.