ESPHome · Maker

ESPHome Smart Water Meter: Camera and Pulse Counting

Your water meter already knows exactly how much water the house uses; it just reports that knowledge to the utility and to anyone willing to walk outside and read the dials. Two local approaches bring the number into Home Assistant instead. A small camera running an on-device recognition project can read an analogue meter’s dials directly, and meters with a pulse output can be counted by a simple sensor wired to an ESP board. Both keep the data on your network, and both come with one rule that is not optional: the meter belongs to the utility, so everything here is read-only.

Published Nov 21, 2026

The rule before the hardware: read-only, always

The meter on the side of your house is the utility’s property and its legal instrument for billing you. That shapes this whole project. Reading it — pointing a camera at the dials, or counting pulses the meter itself emits — is observation, and it is the same observation you make when you read the dial to check a bill. Interfering with it is a different category entirely: nothing in this guide opens the meter, breaks a seal, slows it down, or touches the plumbing on the utility’s side of the line. The camera route changes nothing about the meter at all. The pulse route attaches only where a meter provides an output intended for reading, or senses the meter’s own moving parts from outside. If a build you find elsewhere crosses that line, it is not this build. With that settled, the two routes divide by what your meter offers.

Route one: a camera that reads the dials

Most residential water meters are analogue: a row of digit wheels and often a small dial, behind a glass or plastic window. The camera route points an ESP32 camera board at that face and lets software read it. The established project for this is AI-on-the-edge-device (the jomjol project on GitHub): firmware for the ESP32-CAM that photographs the meter at intervals, runs the digit recognition on the device itself — the “on the edge” part — and publishes the resulting number over MQTT or its built-in interfaces, from where Home Assistant picks it up as a sensor. There is no cloud in this path at all; the image is processed on a board that costs very little and the only thing that leaves it is the number.

The work in this route is physical and photographic rather than electronic. The camera needs a rigid mount that holds its aim permanently, because recognition tuned for one framing fails when the camera sags by two millimetres. It needs light: meters live in dark boxes and pits, and the firmware can drive an LED, but reflections off the meter’s window are the classic failure — an angled mount or a simple shade usually fixes what more brightness makes worse. Setup involves teaching the software where the digits sit in the frame and checking its readings against your own eyes for the first days. Expect an afternoon of aiming and validating rather than wiring, and expect the occasional misread digit during tuning, which is why the project includes plausibility checks that reject readings that jump impossibly. Once dialed in, it reports consumption continuously, which is what makes leak detection possible: a house that uses water at 3 a.m. when nothing should be running is telling you something, and the local leak detection guide on this site covers what to do with that signal.

Route two: counting pulses

Some meters help you directly. Many have a pulse output — a reed switch or electronic contact that closes once per a fixed volume, commonly per liter or per gallon — provided precisely so that building systems can count consumption. Where that output exists, the build is the simplest in the ESPHome catalogue: the pulse wire lands on a GPIO pin, ESPHome’s pulse counter sensor tallies the closures, and a template converts counts into cubic meters, liters or gallons using the per-pulse volume printed on the meter or in its documentation. No camera, no aiming, no recognition errors — a dumb meter becomes an exact one.

Where there is no wired output, a close cousin of the same idea applies: many meters have a rotating element — a dial needle, a small magnet in the mechanism, a reflective spot — whose motion an external sensor can detect. A reed switch or Hall-effect sensor mounted on the outside of the meter case can pick up a magnet’s passing, and an inductive or optical sensor can watch a dial. The counting logic in ESPHome is identical; only the sensing is improvised, and the mount must be entirely external and removable. Two practicalities apply to every pulse build. Debounce and sanity filtering belong in the configuration, because a reed switch that chatters invents water you never used. And the count lives in the ESP’s memory unless you design for restarts, so store the running total in Home Assistant’s statistics or restore it on boot — a meter that resets to zero at every power cut is a graph, not a meter.

Which route fits your meter

Look at the meter first. If it has a documented pulse output or an accessible pulse wire, take route two: it is cheaper, exact, and nearly maintenance-free. If it is a sealed analogue meter with readable dials — the common case — the camera route reads what is there without needing the meter’s cooperation. Battery-powered smart meters installed by utilities are the awkward third case: their faces are often just an LCD and a button, and the practical local options narrow to watching for a pulse-emitting accessory the utility offers or reading your usage from the utility’s own portal where one exists. In all cases, the destination is the same: a consumption sensor in Home Assistant feeding the energy dashboard’s water tracking, utility-meter helpers for daily and monthly totals, and automations that notice the patterns a monthly bill never shows — the slow toilet leak, the irrigation fault, the hose left running. The meter was always measuring. These builds simply let the house listen.

Official documentation and references

Frequently asked questions

Is it legal to read my own water meter this way?

Reading the meter is what the dials are for, and both routes in this guide only observe: a camera photographs the face, and a pulse sensor counts an output the meter provides or motion visible from outside its case. The meter remains the utility’s property, so do not open it, break seals, or interfere with its mechanism — observation is fine, tampering is not, and nothing here requires it.

How accurate is the camera route?

After proper setup and a validation period, readings match the dial because they are the dial, digitised. During setup, expect occasional misreads while the regions and lighting are tuned; the software includes plausibility checks that reject impossible jumps, and comparing against manual reads for the first days is part of the process rather than a sign of failure.

My meter has no pulse output and a dark pit. Can I still do this?

Yes — that is the normal case the camera route was built for. The firmware drives illumination for the photograph, and the practical work is a rigid mount and managing reflections off the meter window. Power is the other pit problem: these builds want USB power or a battery-and-solar arrangement, since meter pits rarely have an outlet.

Will the pulse counter lose my total when it reboots?

It will if you let it, which is why the total should not live only in the ESP’s memory. Keep the authoritative running total in Home Assistant — through its statistics and utility-meter helpers — and treat the device count as a feed. A restart then costs a few pulses at most, not your history.

Can this detect leaks?

It detects the signature leaks leave: continuous low flow when the house should be using nothing. A consumption sensor that never reaches zero overnight points at a running toilet, a weeping valve or an irrigation fault long before a quarterly bill does. Pair it with the shutoff options in this site’s leak guides and the alert becomes an action.

Related guides