The Modbus protocol is used by many consumer and industrial devices for communication.
This component allows components in ESPHome to communicate to those devices via RTU protocol. You can access the coils, inputs, holding, read registers from your devices as sensors, switches, selects, numbers or various other ESPHome components and present them to your favorite Home Automation system. You can even write them as binary or float ouptputs from ESPHome.
The various sub-components implement some of the Modbus functions below (depending on their required functionality):
+---------------+----------------------------+
| Function Code | Description |
+===============+============================+
| 1 | Read Coil Status |
+---------------+----------------------------+
| 2 | Read Discrete input Status |
+---------------+----------------------------+
| 3 | Read Holding Registers |
+---------------+----------------------------+
| 4 | Read Input Registers |
+---------------+----------------------------+
| 5 | Write Single Coil |
+---------------+----------------------------+
| 6 | Write Single Register |
+---------------+----------------------------+
| 15 | Write Multiple Coils |
+---------------+----------------------------+
| 16 | Write Multiple Registers |
+---------------+----------------------------+
Modbus RTU requires a :ref:`UART Bus <uart>` to communicate.
-**send_wait_time** (*Optional*, :ref:`config-time`): Time in milliseconds before the next ModBUS command is sent if an answer from a previous command is pending. Defaults to 250 ms.
If multiple ModBUS devices are attached to the same bus increasing this value can help avoiding to to overlapping reads.
When two devices are sending a command at the same time the response read from UART can't be assigned to the proper design.