:description:Instructions for setting up a modbus_controller device sensor.
The ``modbus_controller`` platform creates a output from a modbus_controller.
Configuration variables:
------------------------
-**id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
-**name** (**Required**, string): The name of the sensor.
-**address**: (**Required**, int): start address of the first register in a range
-**value_type**: (**Required**): datatype of the mod_bus register data. The default data type for modbus is a 16 bit integer in big endian format (MSB first)
Lambda is evaluated before the modbus write command is created. The value is passed in as ``float x`` and an empty vector is passed in as ``std::vector<uint16_t>&payload``
You can directly define the payload by adding data to payload then the return value is ignored and the content of payload is used.
-**multiply** (*Optional*, float): multiply the new value with this factor before sending the requests. Ignored if lambda is defined.
-**offset**: (*Optional*, int): only required for uncommon response encodings
offset from start address in bytes. If more than one register is read a modbus read registers command this value is used to find the start of this datapoint relative to start address. The component calculates the size of the range based on offset and size of the value type
-**use_write_multiple**: (*Optional*, boolean): By default the modbus command ``Preset Single Registers`` (function code 6) is used for setting the holding register if only 1 register is set. If your device only supports ``Preset Multiple Registers`` (function code 16) set this option to true.
note: because the response contains data for all registers in the same range you have to use ``data[item->offset]`` to get the first response byte for your sensor.