Skip to content

Repository files navigation

WaterSystem Data Pipeline

A lightweight data pipeline for collecting, processing, and storing events generated by the Water System (bonsai irrigation system).

Overview

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_weather
    • execution_logs
    • forecast (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).


Architecture

[Raspberry / Sensors]
↓
NATS
↓
WaterSystem Data Pipeline
↓
InfluxDB
↓
Grafana / HA

(+ external forecast ingestion)

[Open-Meteo API]
↓
WaterSystem Data Pipeline
↓
InfluxDB


Data Sources

📡 Event-based (via NATS)

🌦 Terrace Weather

  • Temperature
  • Rain status
  • Timestamp

⏱ Execution Logs

  • Irrigation duration (seconds)
  • Zone name
  • Execution timestamp

🌍 Forecast (Open-Meteo)

The pipeline performs a daily request to Open-Meteo and stores hourly predictions for the next day.

Stored fields (per hour):

  • temperature_2m
  • relative_humidity_2m
  • precipitation
  • cloudcover
  • shortwave_radiation

Characteristics:

  • 1 request per day
  • 24 data points (hourly)
  • Timestamp corresponds to forecasted time, not ingestion time

Measurement:

  • forecast

Tags:

  • location=terrace
  • (optional) forecast_generated_at

Environment Variables

The application is fully configured via environment variables:

Required

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

Example .env

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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages