Reading a gauge with a camera: from a number to a curve
Old tanks and boilers have a gauge and no network port. How the Measure agent turns a camera pointed at a dial into a value, an alert below a threshold and a curve through the day.
Every plant has them: a tank with a sight glass, a boiler with a needle on a dial, a silo with a painted scale. The instrument works. It has worked for twenty years. It has no output, so the only way to know what it says is to walk to it and look.
Replacing it with a connected sensor is a project: a new instrument, a shutdown to fit it, a cable or a radio link, a gateway. For a tank whose level matters once a day, that project never reaches the top of the list.
A camera pointed at the gauge is a smaller project. It reads the instrument the way a person does, by looking, and touches nothing.1
Asking for a number
The Measure agent type returns a value rather than a yes or no:
{
"type": "measure",
"question": "How full is the tank, according to the sight gauge?",
"measure": { "variable": "level", "unit": "%" }
}
The answer:
{
"flagged": false,
"confidence": 0.91,
"description": "The gauge shows the liquid at about 64 %. Measured level: 64 %",
"regions": [ { "label": "gauge", "point": [0.48, 0.35] } ],
"measurement": { "variable": "level", "value": 64.0, "unit": "%" }
}
measurement.value is the number. regions says where the model looked, which is worth drawing on the picture the first few times: a reading taken from the wrong dial is easy to spot that way and hard to spot otherwise.
From a number to an alert
Add a condition and the same check also answers a yes or no question:
"measure": { "variable": "level", "unit": "%",
"condition": { "op": "lt", "value": 20 } }
Now flagged and condition_met are true when the level is under 20 %. Put that agent on a monitor and the confirm rule does the rest: two readings in a row under the threshold open an incident, and your back end receives a webhook. One odd reading, when someone stood in front of the gauge, opens nothing.
From a number to a curve
An alert tells you when a threshold was crossed. A curve tells you why: the tank that empties faster on Tuesdays, the pressure that sags every afternoon. The monitor already made the readings; read them back.
curl "https://api.camly.ai/v1/runs?monitor=mon_123&from=2027-01-27T00:00:00Z&limit=200" \
-H "Authorization: Bearer $CAMLY_API_KEY"
Each line carries result.measurement.value and created. Page with ?before=run_... while has_more is true, and you have the day’s series. Checks are kept 90 days; copy them to your own store if you want a longer history.1
Two things to respect when plotting.
Drop failed checks, do not plot them as zero. A check with status failed has no result and was not charged. It says nothing about the tank.
Filter on confidence. A reading with a low confidence was taken in poor conditions: steam, a reflection on the glass, a person in the way. Keep it out of the curve, or draw it differently.
Making the gauge readable
Most of the accuracy is decided before the first API call, with a ladder and a screwdriver.
- Fill the frame. The API looks at the picture at 1280 pixels on its longest side. A dial that occupies a twentieth of the picture has too few pixels left for its graduations. Move the camera closer or zoom until the gauge is a good part of the frame.
- Face it. A needle read from the side is misread by a person too. Put the camera as square to the dial as the room allows.
- Light it steadily. A plant room at night is dark; a lamp on the gauge beats any setting. Avoid a light that reflects on the glass.
- Draw a zone. If two gauges are in the picture, a zone around the right one settles which is read.
- Name the scale in the question. “The pressure in bar on the outer scale of the dial” beats “the pressure” on a dial with two scales.
How precise is it
Less than the instrument, and it is better to say so. A camera reading a dial is a person reading a dial from a few metres: good for “about two thirds full” or “the needle is in the red”, not for a custody transfer or a regulatory record. Two pictures of the same level can give slightly different readings.
That sets the right use. A threshold with margin (“under 20 %” when the real limit is 10 %) is robust. A threshold placed exactly at the limit will trigger on reading noise. And a value that looks wrong should go to a person along with the picture, which is the general rule we described in saying “I can’t tell”.
A calibrated measure exists for scenes without a printed scale: you send a reference picture with a known value, and the reading is made against it. It counts as two checks and runs as a direct call, not on a monitor.1
How often, and what it costs
A level that moves over hours does not need a reading every minute.
| Reading every | Checks a day | Monitor checks, per day |
|---|---|---|
| Hour | 24 | €0.14 |
| 15 minutes | 96 | €0.58 |
| 5 minutes | 288 | €1.73 |
A check made by a monitor costs €0.006, and a live camera with an active monitor costs €2 a month.1 For one tank read every fifteen minutes, that is about €19 a month, with no shutdown and no new instrument.
What a camera adds that a sensor does not
A sensor gives a number. A camera gives a number and a picture. When the level drops at three in the morning, the incident’s evidence picture shows the gauge at that moment, and sometimes what was around it: an open valve, a puddle under the flange. The reading says that something happened; the picture often says what.
Sources
- Camly API, all guides as plain text: Agent types (measure), Monitoring (past checks), Pictures, Limits and prices. platform.camly.ai
- Camly API contract (OpenAPI). api.camly.ai