{
  "markdown": "# meter-reader\n\nTools for passively receiving and plotting Neptune R900 water-meter readings\ncaptured with an RTL-SDR dongle and the [rtlamr](https://github.com/bemasher/rtlamr)\ndecoder. See the [knowledge base](docs/knowledgebase/) for background on the\nNeptune MACH 10 R900i, the R900 protocol, and the hardware/software setup.\n\n## Requirements\n\n- Python ≥ 3.12.2\n- [uv](https://docs.astral.sh/uv/) for dependency management\n- An RTL-SDR dongle and `rtlamr` to capture readings (see\n  [R900 Passive Monitoring](docs/knowledgebase/concepts/r900-passive-monitoring.md))\n\n## Install\n\n```bash\nuv sync\n```\n\nThis installs `meter-reader` as a console script along with its dependencies\n(`click`, `seaborn`, `matplotlib`, `pandas`).\n\n## Capturing readings\n\nThe plotting utility consumes NDJSON output from `rtlamr`. To capture a file:\n\n```bash\n# Terminal A — expose the dongle over TCP\nrtl_tcp\n\n# Terminal B — decode Neptune R900 packets to NDJSON\nrtlamr -msgtype=r900 -format=json > readings.ndjson\n\n# If consumption values look wrong, your meter may use BCD encoding:\nrtlamr -msgtype=r900bcd -format=json > readings.ndjson\n\n# To lock onto a single meter once you know its MIU ID:\nrtlamr -msgtype=r900 -format=json -filterid=<MIU_ID> > readings.ndjson\n```\n\nEach line in the file is a JSON object with the meter data nested under\n`Message`:\n\n```json\n{\"Time\":\"2026-08-19T12:54:10.231823-07:00\",\"Offset\":0,\"Length\":65536,\"Type\":\"R900\",\"Message\":{\"ID\":1578876706,\"Unkn1\":163,\"NoUse\":34,\"BackFlow\":0,\"Consumption\":309200,\"Unkn3\":0,\"Leak\":1,\"LeakNow\":0}}\n```\n\nSee the knowledge base for how to [identify your meter's MIU ID](docs/knowledgebase/concepts/r900-passive-monitoring.md#identifying-your-meters-id).\n\n## Plotting readings\n\nThe `meter-reader` command reads an NDJSON file and produces a seaborn line\nplot of consumption over time, with one colored line per meter ID.\n\n### Usage\n\n```\nUsage: meter-reader [OPTIONS] PATH\n\n  Plot Consumption over Time for each meter ID in an rtlamr NDJSON file.\n\nOptions:\n  -o, --output FILE  Save the plot to this file instead of showing it.\n  --id INTEGER       Plot only this meter ID. Omit to plot every meter in the\n                     file.\n  --help             Show this message and exit.\n```\n\n### Examples\n\nPlot all meters and display the chart in a window:\n\n```bash\nuv run meter-reader readings.ndjson\n```\n\nSave the chart to a file instead of opening a window:\n\n```bash\nuv run meter-reader readings.ndjson -o readings.png\n```\n\nPlot a single meter by its MIU ID:\n\n```bash\nuv run meter-reader readings.ndjson --id 1578876706 -o my_meter.png\n```\n\n### Notes\n\n- Lines that are not valid JSON (e.g. stray shell output captured before the\n  first record) are silently skipped, so a raw redirect works without cleanup.\n- The output format is determined by the file extension (`.png`, `.svg`,\n  `.pdf`, etc.).\n- Consumption values are plotted as-is from the rtlamr output. The raw units\n  depend on the meter configuration (US gallons, cubic feet, cubic metres) and\n  may need scaling — see the\n  [knowledge base](docs/knowledgebase/concepts/r900-passive-monitoring.md#consumption-encoding-binary-vs-bcd)\n  for details.",
  "bytes": 3147,
  "sha": "ac61f592d338c76e24f500dff399d29b19b5304f01b628074608d085eb7add32",
  "repo_slug": "geoffjay/water-meter",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/okf_geoffjay_water_meter_docs_knowledgebase__680ced93/readme"
}