Input lag for wall switches/buttons (direct v. bus)?

Добрый день!


I am looking for information regarding the input lag for switches or buttons connected to Wiren Board 6, i.e. the amount of time between pressing the button and the respective action such as turning on the light, in order to decide whether to opt for simple direct dry contact switches/buttons or use switches/buttons connected to a bus. Reducing this lag as much as possible is of utmost importance to me, since it has a major effect on the overall user experience.

Research so far

I’ve done extensive searching with the help of an online translator and found this thread and the article linked within:

If my understanding is correct, Mr Dubrovin (the author of the article) used the same kind of Modbus RTU switches that I would be interested in, however the input lag was as long as 3–4 seconds, which is far too long for my preference.

In the thread above, Mr @poglazov made a rough estimation of how long a single polling cycle would take given 100 buttons at 115,200 bps, which resulted in a very acceptable 56 ms, however it is also my understanding that further significant lag (tens of milliseconds) is introduced by each device (wall panel with buttons), so the overall input lag may increase considerably with just a few devices on the bus.

Mr @Vyac then added further considerations regarding the maximum baud rate of those specific devices at only 19,200 bps and an additional 5–8 ms lag from switching between panels, however he also noted that it should be possible to transfer the state of all buttons per panel at once, estimating the overall polling cycle length at 170 ms.


Since the above information is about three years old, does anyone please have some new experience with these touch switches from Alibaba or any wall-mounted switches/buttons via Modbus RTU connected to Wiren Board?

I prefer using bus topology mainly to reduce the cable length and because the backlit touch buttons are very aesthetically pleasing and convenient. Ideally, I would prefer an event-based protocol, i.e. without master-slave polling, but I’m not sure what works well in practice, so if you have any alternative protocol recommendations, I would appreciate them (preferably using RS-485 as the physical layer due to its robustness).

Finally, in case of using dry contact switches connected to inputs of let’s say WB-MR6C v.2, could you please tell me the input lag? I’ve done extensive searching on YouTube and it looks like about half a second, but perhaps you have exact numbers.

Thank you!

Dear Sir,

Sorry for delay.

Unfortunately, I cannot answer all the questions right now. So I will answer what I can, and later be back with the rest of the answers.

I don’t use switches from Alibaba, and cannot remember any client mentioned them last time.
But most of our smart home clients now use standard well-looking Schneider and Legrand switches, and connect them to our Modbus RTU modules with inputs - I will mention them later.

As mentioned in the theme you cited, it’s possible to use event-driven KNX or ZigBee, and you can use them with our Wiren Board 6 PLC with corresponding internal modules WBE2-I-KNX and WBE2R-R-ZIGBEE. But both of them have known limitations.

First of all, typically our clients use relay modules with inputs in a “direct control” mode. It means that relay module (i.e. WB-MR6C v.2) has switch connected to Input 1 and corresponding load connected to Output 1, and when you press switch, load goes on. It works without (!) Modbus, so you can for example power off the PLC, and this logic keeps working. But if your PLC works, you also can control relay from PLC and further from laptop or smartphone.
Since such option gives you almost instant reaction, problem can exist only if you have separate device for input and another for outputs.
If you use our equipment, the first option is to use for inputs not Modbus module but extension module WBIO-DI-WD-14 which connects directly to Wiren Board 6 PLC (should be attached to it from right). It translates signal from input to PLC immediately. Later even if you use Modbus device to control the load, command which switches the output goes through Modbus immediately (you shouldn’t wait whole polling cycle). So resulting delay should be very small.
The case when you have separate devices for inputs and outputs and both of them are polled using Modbus RTU is slightly worse, but also not so bad. Recently our developers improved Wiren Board 6 Modbus RTU Master driver (wb-mqtt-serial), so now it can poll devices as fast as possible. But I see that you want to get some value for the delay in ms, so I’ll ask an engineer to measure it and write here.

While waiting for the result from my colleague, could you please tell me which option is more suitable for you?

No problem, please take your time. Thank you for the support!

Thank you. I’m not a fan of wireless but I’ll look into KNX once again. I originally rejected this option due to the higher price and unimpressive design of the available third-party buttons/switches.

This is excellent! I’ve been wondering about how to ensure redundancy in case the PLC fails but I didn’t realise that those direct inputs on the modules work even without the controller. I like this design!

Is it also possible to configure these inputs so that a double-click or triple-click would invoke a different function? For example, pressing the button once would activate the relay but pressing it twice a in quick succession would send a command via the PLC to activate another relay controlling the curtains.

Is it possible to configure the inputs on a dimmer so that pressing and holding the connected button would change the intensity?

This is also excellent, I didn’t realise that the extension modules which are plugged directly into the controller from the side use a different communication protocol.

If it’s not too much trouble for you, I would appreciate the numbers, just to get at least a realistic idea of what to expect. :slight_smile:

Just to sum this up and make sure I understand you correctly (please, let me know if I’m wrong), there are essentially four options:

  1. Direct input-output within the extension module – ordinary button/switch connected to an extension module such as WB-MR6C v.2 that controls one of the relays. Nearly instant response, does not even need the PLC.
  2. Input via an extension module plugged into the PLC from the side, e.g. WBIO-DI-WD-14 – ordinary button/switch connects to the extension module, that sends the signal to the PLC, which in turn activates one of the outputs via Modbus RTU. Also nearly instant response (no waiting for the polling cycle), needs the PLC.
  3. Input via an extension module connected to the PLC via Modbus RTU – ordinary button/switch connects to the extension module which must be polled by the PLC, which then receives the signal and processes it just like in option 2. Slightly slower response, needs the PLC.
  4. Input via one of the RS-485 interfaces – Modbus RTU button/switch like those from Alibaba must be polled by the PLC. Slower response based on the number of nodes on the bus, needs the PLC.

If my understanding is indeed correct, I’m still interested in option 4, but I will probably end up using a combination of options 1 and 2. The independence from the PLC is important especially for lights.

Unfortunately, not yet, but the feature is in our developers’ plan.

It’s a default mode for dimmer: Google Translate
Also you can configure one button to increase and other to decrease the level.

That’s correct. The only point is that we call such devices as WB-MR6C v.2 “Modbus devices”, so they won’t be mixed with “extension modules” for the devices plugged into the PLC.


That’s correct. I should note, that these points are very similar: you should poll Modbus RTU device and then send the command “Turn on”. The only difference is that Chinese devices with Modbus RTU may work slower than ours.

Completely agree.

Thank you for your answers, sir. Based on your replies, I think that I’m going to go with a combination of options 1 and 4, i.e. directly via your Modbus devices (thank you for the correction, I now understand the proper terminology) where the operation should be extra robust (independent from the PLC) and fast, such as to control the main light in each room, and using some third-party Modbus buttons on a dedicated RS-485 line with as few devices as possible where even a potential delay of up to one second doesn’t matter that much, such as scene controls, just to avoid too many switches on the walls.

Once this feature is ready, will it require a hardware or merely a firmware update, please? And is it possible to configure double-clicks when using e.g. WBIO-DI-WD-14 (via the rules engine) or does the same restriction apply?

I’ve recently discovered this nice video along with the associated article which show exactly what I was interested in. I’m putting these resources here in case someone seeks the same information in the future. :slight_smile: