A lightweight data pipeline for collecting, processing, and storing events generated by the Water System (bonsai irrigation system).
The WaterSystem Data Pipeline is responsible for:
- Consuming events from NATS (JetStream)
- Fetching external weather forecast data from Open-Meteo
- Processing different data sources:
terrace_weatherexecution_logsforecast(daily weather prediction)
- Persisting structured data into InfluxDB
- Acting as the bridge between real-time event streaming and time-series storage
This enables monitoring, analytics, and visualization (e.g., Grafana, Home Assistant).
[Raspberry / Sensors]
↓
NATS
↓
WaterSystem Data Pipeline
↓
InfluxDB
↓
Grafana / HA
(+ external forecast ingestion)
[Open-Meteo API]
↓
WaterSystem Data Pipeline
↓
InfluxDB
- Temperature
- Rain status
- Timestamp
- Irrigation duration (seconds)
- Zone name
- Execution timestamp
The pipeline performs a daily request to Open-Meteo and stores hourly predictions for the next day.
temperature_2mrelative_humidity_2mprecipitationcloudcovershortwave_radiation
- 1 request per day
- 24 data points (hourly)
- Timestamp corresponds to forecasted time, not ingestion time
forecast
location=terrace- (optional)
forecast_generated_at
The application is fully configured via environment variables:
| Variable | Description | Example |
|---|---|---|
SERVER_HOST |
HTTP server host and port | :8080 |
NATS_SERVER_URL |
NATS server connection URL | nats://192.168.1.100:31222 |
INFLUXDB_URL |
InfluxDB HTTP API endpoint | http://influxdb:80 |
INFLUXDB_TOKEN |
InfluxDB authentication token | your-token |
INFLUXDB_ORG |
InfluxDB organization name | home |
INFLUXDB_BUCKET |
Target bucket for time-series data | bonsai-data |
SERVER_HOST=:8080
NATS_SERVER_URL=nats://@192.168.1.100:31222
INFLUXDB_URL=http://influxdb:80
INFLUXDB_TOKEN=my-super-token
INFLUXDB_ORG=home
INFLUXDB_BUCKET=bonsai-data