How it works
This Coreflux LoT template polls NOAA CO-OPS (Tides & Currents) every 6 minutes for the water level at The Battery, New York. It validates the JSON reply, publishes station fields, compares the new level with the previous sample, and emits a collapsed report document for external consumers.
Key features
- REST_API route: Fetches latest water level data from NOAA CO-OPS over HTTPS.
- 6-minute heartbeat: Self-starting polling loop gated by
demo/tides/feed/enabled. - Payload gate: Rejects bad replies before parsing by checking
data[0].v. - Trend detection: Compares the current level with the last stored level to publish
rising,falling, orsteady. - Report model: Publishes a collapsed
TideReportJSON document todemo/tides/reports/current. - Metric and imperial values: Publishes water level in meters and feet.
Prerequisites
- Internet egress from the broker
- Coreflux REST_API route support
- No NOAA API key required
