Observability Platform
Plant Caravan currently supports three telemetry patterns for the sensor platform:
- Plant Caravan hosted tenant ingestion backed by InfluxDB 3.x
- Self-hosted Plant Caravan backed by your own InfluxDB 3.x
- Prometheus pull-based metrics scraped directly from the device
They are not all at the same maturity level today. Prometheus pull already works on the current ESPHome firmware. The hosted and self-hosted InfluxDB paths have a working backend ingest API and device-key auth model, but the real ESP32 push firmware is still in flight.
Current status
| Area | Status | Notes |
|---|---|---|
| Device-local Prometheus endpoint | Available now | hardware/firmware/plant-monitor.yaml already enables web_server and prometheus |
| Tenant-scoped readings API | Implemented | POST /api/sensors/{id}/readings writes to InfluxDB 3.x with device-key auth |
| Device-key tooling | Implemented | web/scripts/mint-device-key.ts and web/scripts/fake-device.ts exist now |
| Real ESP32 HTTP push to Plant Caravan API | In flight | Tracked by issue #55 |
| Historical demo/seed data for cloud dashboards | In flight | Tracked by issue #57 |
Current ingest schema: the cloud ingest route currently accepts
temperature,humidity,soilMoisture, andlight. CO2 and pressure are not on the public ingest contract yet.
Choose a connection mode
| Mode | Sensor talks to | Time-series store | Best fit |
|---|---|---|---|
| Plant Caravan hosted tenant InfluxDB | Plant Caravan HTTPS API | Plant Caravan-managed InfluxDB 3.x | Managed cloud dashboards and tenant isolation |
| Self-hosted Plant Caravan + InfluxDB | Your Plant Caravan HTTPS API | Your InfluxDB 3.x instance | Same architecture with full control |
| Prometheus pull | Your Prometheus server scrapes the device | Prometheus TSDB | Local/self-hosted monitoring on the same network |
Plant Caravan hosted tenant InfluxDB
This is the SaaS path under active development. The important architecture detail is that the sensor does not talk to InfluxDB directly. It posts readings to the Plant Caravan API, and the API writes tenant-tagged points into InfluxDB server-side.
Flow
- Create a sensor record in the Plant Caravan tenant.
- Mint a per-sensor device key.
- Configure the sensor to
POSTreadings tohttps://<plant-caravan-host>/api/sensors/<sensor-id>/readings. - Plant Caravan authenticates the device key, resolves the tenant, and writes the readings to InfluxDB with
sensor_idandtenant_idtags.
Device auth
Mint a key once:
pnpm --dir web tsx scripts/mint-device-key.ts --sensor-id <sensor-id>Use that raw key as a Bearer token from the device:
POST /api/sensors/<sensor-id>/readings
Authorization: Bearer <device-key>
Content-Type: application/json{
"readings": [
{
"timestamp": "2026-04-30T18:30:00Z",
"temperature": 74.1,
"humidity": 48.2,
"soilMoisture": 43.0,
"light": 820.0
}
]
}What exists today
- The API route exists at
web/src/app/api/sensors/[id]/readings/route.ts - The InfluxDB 3.x write/query wrapper exists at
web/src/lib/influxdb.ts - A fake device can exercise the exact path today:
PLC_DEVICE_KEY=<raw-key> pnpm --dir web tsx scripts/fake-device.ts \
--sensor-id <sensor-id> \
--url https://<plant-caravan-host>What is still missing
- The committed ESPHome firmware does not yet push readings to this API.
- That work is tracked in issue
#55. - Devices behind NATs are the reason this push model exists; Prometheus scrape alone is not enough for hosted SaaS.
Self-hosted Plant Caravan + InfluxDB
This path uses the exact same device protocol as the hosted path. The only difference is that you run the Plant Caravan web app and point it at your own InfluxDB 3.x instance.
Architecture
- Sensor posts to your Plant Caravan API endpoint
- Plant Caravan writes to your InfluxDB 3.x database
- Dashboard reads flow back through Plant Caravan query helpers
Required environment
INFLUXDB_URL=http://127.0.0.1:8181
INFLUXDB_DATABASE=sensor-data
INFLUXDB_TOKEN=<optional-bearer-token>For local development, the repo already provisions this stack in web/process-compose.yaml.
Important boundary
Self-hosted InfluxDB does not currently mean “device writes directly to InfluxDB.” The implemented path is still:
sensor -> Plant Caravan API -> InfluxDB
That keeps tenant/device auth and dashboard reads consistent between hosted and self-hosted deployments.
Prometheus pull metrics
This is the path that works on the real ESPHome firmware right now.
The current firmware already exposes a metrics endpoint because hardware/firmware/plant-monitor.yaml enables:
web_server:
port: 80
prometheus:
include_internal: truePrometheus can scrape the sensor directly:
scrape_configs:
- job_name: plant_caravan_sensor
metrics_path: /metrics
static_configs:
- targets:
- 192.168.1.50:80Use this mode when
- The sensor and Prometheus server are on the same LAN, VPN, or routable network
- You want a fully local stack with Home Assistant, Prometheus, and Grafana
- You do not need Plant Caravan-hosted multi-tenant dashboards
Limitations
- Hosted Plant Caravan cannot scrape devices hidden behind home NATs
- Tenant-aware cloud features do not apply to direct Prometheus scrape
- This path is local-first rather than SaaS-first
Recommended guidance
- Use Prometheus pull today if you want the fastest working setup on the current ESPHome firmware.
- Use Plant Caravan hosted InfluxDB if you are building toward the managed cloud path and are comfortable with the device push firmware still being in progress.
- Use self-hosted Plant Caravan + InfluxDB if you want the same API architecture as the hosted product but under your own infrastructure.