Most digital twin problems that look like software bugs start with a single bad reading. A temperature sensor reports 85 degrees in a school classroom, or a water level sensor sends the same number for three days. If the twin accepts these values without question, dashboards mislead and alarms lose credibility. A good place to stop this is the gateway, the small device or service that collects readings from sensors before they travel to the platform.
The first rule is a range check. Every sensor type has physical limits: a room air sensor should not report minus 30, and a bus passenger counter should not report 400 people on a 12-metre vehicle. Limits come from the datasheet and from the place where the sensor is installed. A reading outside the range is not deleted. It is stored with a flag, so engineers can later see how often it happens and from which device.
The second rule is a rate-of-change check. Air temperature in a building cannot jump 20 degrees in one minute, while the temperature of a boiler outlet pipe may change quickly during start-up. So the allowed speed of change must be set per measurement and per asset, not as one global number. A sudden spike that fails this test often points to a loose cable, a power dip or an interference problem, not to a real event.
The third rule catches the opposite fault: a flatline. A sensor that returns exactly the same value for many hours, when similar sensors nearby are moving, has probably frozen. The time window depends on the signal. A door contact may stay unchanged all night, while a traffic counter on a main road should not. Comparing a sensor with its neighbours, such as two flow meters on the same pipe, adds a useful cross-check.
Flags should travel with the data, not replace it. The twin can then show a reading in grey, use the last good value for a short time, or ask an operator to inspect the device. Alerts built on flagged data should be held back or marked, so a crew is not sent to a pump because a cable came loose. Keep a short log of every rule that fires, and review it monthly. Rules that fire constantly are usually set too tight, and rules that never fire may be set too loose.
This work is not exciting, but it decides whether operators believe what they see on the 3D model. Platforms such as TwinUp's Clavus City depend on the same principle: a city twin is only as useful as the readings behind it, and checking them at the edge is cheaper than finding the problem after a wrong decision.
