add support for barometric pressure

This commit is contained in:
2026-01-29 14:04:18 +11:00
parent 7a0081b2ed
commit 5d07c5d54b
9 changed files with 401 additions and 51 deletions

View File

@@ -10,7 +10,7 @@ Starter weather-station data pipeline:
`docker compose up -d`
2) Configure:
edit `config.yaml` (or `test.yaml`) with your MQTT broker, topic, and site coordinates.
edit `config.yaml` (or `test.yaml`) with your MQTT broker, topics, and site coordinates.
3) Run the ingest service locally:
`go run ./cmd/ingestd -config config.yaml`
@@ -27,8 +27,14 @@ mqtt:
client_id: "go-weatherstation-ingestd" # Client ID
username: "" # Optional username
password: "" # Optional password
topic: "ecowitt/ws90" # Topic to subscribe to
qos: 1 # MQTT QoS (0, 1, or 2)
qos: 1 # Default MQTT QoS (0, 1, or 2)
topics:
- name: "ws90"
topic: "ecowitt/ws90" # WS90 payload topic
type: "ws90"
- name: "baro"
topic: "sensors/barometer" # Barometric pressure topic
type: "baro"
db:
conn_string: "postgres://postgres:postgres@timescaledb:5432/micrometeo?sslmode=disable"
@@ -59,11 +65,13 @@ wunderground:
### Notes
- The Open-Meteo ECMWF endpoint is queried by the poller only. The UI reads forecasts from TimescaleDB.
- Web UI supports Local/UTC toggle and date-aligned ranges (6h, 24h, 72h, 7d).
- `mqtt.topic` is still supported for single-topic configs, but `mqtt.topics` is preferred.
## Schema & tables
TimescaleDB schema is initialized from `db/init/001_schema.sql` and includes:
- `observations_ws90` (hypertable): raw WS90 observations with payload metadata, plus the full JSON payload (`payload_json`).
- `observations_baro` (hypertable): barometric pressure observations from other MQTT topics.
- `forecast_openmeteo_hourly` (hypertable): hourly forecast points keyed by `(site, model, retrieved_at, ts)`.
- Continuous aggregates:
- `cagg_ws90_1m`: 1minute rollups (avg/min/max for temp, humidity, wind, uvi, light, rain).
@@ -71,6 +79,7 @@ TimescaleDB schema is initialized from `db/init/001_schema.sql` and includes:
Retention/compression:
- `observations_ws90` has a 90day retention policy and compression after 7 days.
- `observations_baro` has a 90day retention policy and compression after 7 days.
## Publish a test WS90 payload
```sh