2021-05-31 06:06:23 +02:00
.. _modbus:
Modbus Component
================
.. seo ::
:description: Instructions for setting up Modbus in ESPHome.
:keywords: Modbus
2023-10-27 07:02:07 +02:00
The ModBUS protocol is used by many consumer and industrial devices for communication.
2021-05-31 06:06:23 +02:00
This component allows components in ESPHome to communicate to those devices.
2023-10-27 07:02:07 +02:00
ModBUS requires a :ref: `UART Bus <uart>` to communicate.
2021-05-31 06:06:23 +02:00
.. code-block :: yaml
# Example configuration entry
uart:
...
modbus:
Configuration variables:
------------------------
- **flow_control_pin** (*Optional* , :ref: `config-pin` ): The pin used to switch flow control.
2022-04-03 09:30:25 +02:00
This is useful for RS485 transceivers that do not have automatic flow control switching,
like the common MAX485.
2021-09-26 22:27:26 +02:00
2023-10-27 07:02:07 +02:00
- **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.
2022-04-03 09:30:25 +02:00
This value defines the maximum queuing time for a command before it is send anyways.
2022-12-22 08:14:15 +01:00
- **disable_crc** (*Optional* , boolean): Ignores a bad CRC if set to `` true `` . Defaults to `` false ``
2021-09-26 22:27:26 +02:00
2021-05-31 06:06:23 +02:00
See Also
--------
2021-11-29 10:03:46 +01:00
- :doc: `/components/modbus_controller`
- :doc: `/components/sensor/modbus_controller`
- :doc: `/components/binary_sensor/modbus_controller`
- :doc: `/components/text_sensor/modbus_controller`
- :doc: `/components/switch/modbus_controller`
- :doc: `/components/number/modbus_controller`
- :doc: `/components/output/modbus_controller`
- `Modbus RTU Protocol Description <https://www.modbustools.com/modbus.html> `__
2021-05-31 06:06:23 +02:00
- :ref: `uart`
- :apiref: `modbus/modbus.h`
- :ghedit: `Edit`