Skip to content

apographon/grundwasser-ha-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grundwasser Poing D83 – Home Assistant Bundle

This code is generated by an AI.

Data feed, historical CSV import, and dashboard cards for Grundwasserstand Messstelle Poing D 83 (NID Bayern: gkd.bayern.de).

Local setup for Poing. This bundle is preconfigured for the measuring station Poing D 83 in Bavaria. If you need data for another city or region, take this code and adapt it: change the NID resource URL in integration/grundwasser.yaml to your station’s table page, adjust unique_id/entity names, update the import script’s ENTITY_ID and CSV source/path if needed, and adapt the dashboard card entities. The NID HTML structure may differ per station—adjust the regex in the templates if your table layout is different.

Contents

Path Description
integration/grundwasser.yaml REST sensors: level (m ü. NN), level (m u. Gelände), situation
scripts/import-grundwasser-csv-to-recorder.py Import historical CSV into the recorder
ui/apex-grundwasser-card.yaml ApexCharts card: year comparison (Jan–Dec, multiple years)
ui/tile-grundwasser-situation.yaml Tile card: situation with color (green/amber/red)
docs/csv-import.md Import instructions and troubleshooting
ui/Home-Assistant-Grundwasser-Visual.png Screenshot of the dashboard (sample)

Visualization (sample)

The chart and situation tile together give a year-over-year view and current status:

Grundwasser Poing D83 dashboard sample

Requirements

  • Home Assistant with REST and Recorder (SQLite)
  • Python 3.8+ for the import script (when running outside HA)

HACS add-ons (required for the dashboard cards)

Install these via HACS (Home Assistant Community Store):

Add-on Purpose
apexcharts-card Year comparison chart (ApexCharts)
card-mod Situation tile with state-based colors

After installing, add the frontend resources in Settings → Dashboards → Resources (or as prompted by HACS), then reload the dashboard.

Quick setup

1. Data feed (live sensors)

  • Copy integration/grundwasser.yaml into your HA config/integrations/ (or include it from configuration.yaml).
  • Restart Home Assistant and add the integration (or reload REST).
  • Entities: sensor.grundwasser_poing_d83_m_u_nn, sensor.grundwasser_poing_d83_m_u_gelande, sensor.grundwasser_poing_d83_situation (your instance may show e.g. sensor.grundwasser_poing_d83_situation_3 – use the ID from Developer Tools → States in the tile config).

2. Historical data (optional)

  • Get the CSV from NID Bayern (export/historical data) and save as grundwasser_poing_historie.csv. Format: Datum;Grundwasserstand [m ü. NN];Prüfstatus (header in first 8 lines, data from line 9).
  • Copy the CSV and scripts/import-grundwasser-csv-to-recorder.py to your HA host (e.g. CSV in config/www/, script in config/).
  • Full import procedure (stop HA, backup DB, dry-run, run import, start HA) is in docs/csv-import.md. Use --force if the entity already has data and you want to backfill.
  • To keep long history, set recorder.purge_keep_days to a large value (e.g. 13514) before importing.

3. Dashboard cards

  • Chart (year comparison): In Lovelace, add a card → Raw configuration → paste contents of ui/apex-grundwasser-card.yaml. Requires apexcharts-card.
  • Situation tile: Add a card → Raw configuration → paste contents of ui/tile-grundwasser-situation.yaml. Adjust the entity (and in card_mod the states('...') call) if your situation sensor has another ID (e.g. sensor.grundwasser_poing_d83_situation_3). Requires card-mod.

CSV format (for import)

  • Semicolon-separated; header/metadata in lines 1–8; data from line 9.
  • Data rows: YYYY-MM-DD;value;status (value with comma as decimal, e.g. 511,22).
  • Rows with empty value are skipped (measurement gaps).

License

MIT. Data source: Bayerisches Landesamt für Umwelt (LfU), gkd.bayern.de.

About

Home Assistant integration for the Niedrigwasser-Informationsdienst Bayern

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages