← Back to the chapter · Next detail →
Technical detail · Smart Home and Environmental Kits
Ambiguous state breaks automation
25.4 Ambiguous State Breaks Automation
A rule may act on old or unconfirmed state while the dashboard still looks normal. Show uncertainty before the system controls a device or sends an alert. For example, a retained MQTT message can look current after a device goes offline. A device shadow may hold a desired value, the last report, or a pending change. Matter, Zigbee, Z-Wave, and Home Assistant state can also lag the device. A bridge restart, route change, or manual override may cause that gap.
Sensor data can hide the same problem. A reading has a sample time, quality, and often a filtered value as well as raw data. If the screen shows the last good value without its age, a rule may heat or water at the wrong time. Test how the kit marks fresh, stale, missing, and low-confidence data. Also show when it needs service or has been overridden.
An over-the-air (OTA) update delivers software through a network. Credential rotation means replacing the secrets a device uses to authenticate, then checking that access still works. Keep enough detail to repeat the test: firmware and board versions, gateway image, rule version, topic or endpoint, sample rate, calibration, placement, and the fault used. Record safe defaults as well. A valve should fail closed or require local confirmation when water evidence is stale; a door or lock prototype should preserve manual operation. Heating, ventilation, and air conditioning (HVAC) systems control indoor air and temperature. Fan and HVAC rules should avoid unexplained occupancy guesses. An alert should mark stale data instead of silently clearing it. Choose the safe state for the actual hazard; for example, frost protection may require a valve to stay open.