Modbus Sensor

The modbus sensor allows you to gather data from Modbus registers.

To use your Modbus sensors in your installation, add the following to your configuration.yaml file:

# Example configuration.yml entry
  platform: modbus
    - name: Sensor1
      unit_of_measurement: °C
      slave: 1
      register: 100
    - name: Sensor2
      unit_of_measurement: mg
      slave: 1
      register: 110
      count: 2
    - name: Sensor3
      unit_of_measurement: °C
      slave: 1
      register: 120
      register_type: input
      data_type: float
      scale: 0.01
      offset: -273.16
      precision: 2

Configuration variables:

  • registers array (Required): The array contains a list of relevant registers to read from.
    • name (Required): Name of the sensor.
    • slave (Required): The number of the slave (Optional for tcp and upd Modbus).
    • register (Required): Register number.
    • register_type (Optional): Modbus register type (holding, input), default holding
    • unit_of_measurement (Optional): Unit to attach to value.
    • count (Optional): Number of registers to read.
    • scale (Optional): Scale factor (output = scale * value + offset), default 1
    • offset (Optional): Final offset (output = scale * value + offset), default 0
    • precision (Optional): Number of valid decimals, default 0
    • data_type (Optional): Response representation (int, float). If float selected, value will be converted to IEEE 754 floating point format. default int