DEV Community

Xingliao Smart Home
Xingliao Smart Home

Posted on

The Delay Between a Press and the Light Is a Routing Decision

Why a wall switch should never feel like an app

You tap a phone app and accept a beat of lag, because the app lives in a pocket. A wall switch sits next to the door at finger height. Nothing about that position prepares a person for waiting. When a switch takes half a second to answer, the natural human reaction is to press again, and a second press on some firmware stacks lands as a second command that arrives after the first one finishes. The light blinks, the scene fires twice, or the state ends up opposite of what the room shows. Most of the time the hardware was never slow. The command simply traveled a longer road than it needed to, and the road was chosen by architecture, not by accident.

The three routes a press can take

The fastest route is entirely inside the wall: the capacitive sensor, the relay coil, and the power path share one board, so a press closes a relay in tens of milliseconds no matter what the network is doing. The second route adds the radio: the press is reported to a gateway or a cloud server, an event comes back, and only then does the relay move. The third route makes the cloud mandatory: every action, even standing in front of the panel, waits for a round trip to a data center. The same product family can ship with any of these behaviors depending on the platform behind it. That is why smart switch hardware from the same factory can feel instant in one home and sluggish in the next.

What the delay numbers mean in practice

A local relay path answers in under 100 milliseconds, which reads as instant. A LAN round trip lands near 150 to 300 milliseconds, still acceptable. A cloud round trip on a good day is 300 to 800 milliseconds, and on a congested evening in a house with dozens of devices it can pass one second. The human threshold for "this feels broken" sits somewhere around half a second, and it is lower when the expected result is light rather than a screen change. Multiply that by family members pressing twice and by automations triggered on state change, and the same architecture difference explains a surprising share of support tickets.

Why firmware updates will not fix an architecture

Once the routing is set, updates tune it. A better poll interval shaves milliseconds. Edge caching helps in narrow cases. What no update changes is a product whose relay physically waits for a cloud acknowledgment before it moves. That decision was made in the bill of materials and the firmware design before the first unit shipped, usually to keep the bill cheap or to lock the device to one platform. When you evaluate switch boards for OEM projects, ask which layer owns the action. The answer should be a sentence about the relay, not a sentence about the cloud.

Questions that separate local from cloud

Ask four things in order. Does the physical button work when the internet is down, and does it work at full speed? Is there a local hub or LAN path, and does the app use it when both devices are at home? Which events trigger through the cloud, and which stay inside the house? Where do schedules execute, on the device or on a server? The engineering contact page is the right place for these, because the answers live with the firmware team, not the sales sheet. A switch supplier that can answer in one line per question has already done the architecture work.

What to test on a working unit

Demo units in a bright showroom on fast fiber hide latency beautifully. Test instead in conditions that exist in real houses. Turn off the broadband modem and press the button, timing the answer. Reconnect and let the device rejoin, then press again. Add a dozen other devices to the same network before testing, because the queue effect is part of the product. Watch whether a double press produces a double action. None of this requires instruments; a stopwatch and a stranger's patience are enough. The result tells you what the first week of ownership will feel like, and that feeling outlasts every feature on the box.

Top comments (0)