Integrating kamstrup multical 403 via modbus rtu

Hello,

I’m working on an integration of the Kamstrup Multical 403 with modbus rtu module in home assistant. I’m using a usb modbus adapter with c340 chipset which should be detected. I can see the adapter in my hardware configuration. It is mounted. However it is not detected in home assistant. I defined a modbus configuration in the configuration file with the correct parameters, however the sensor i defined shows no values. In my log file it’s mentioned that attempts to read the modbus, failed. Can anyone help me with this issue since I’ve spent a lot of time on this already.

Here is my modbus configuration

modbus:
  - name: modbus_hub
    type: serial
    port: /dev/ttyUSB0
    baudrate: 115200
    bytesize: 8
    method: rtu
    parity: E
    stopbits: 1
    sensors:
      - name: "t1 actual"
        slave: 100
        address: 7
        input_type: input
        unit_of_measurement: °C
        device_class: temperature
        state_class: measurement
        scale: 1
        offset: 0
        precision: 2
        data_type: float32

I managed to read the meter via modbus rtu. I used an usb rs485 adapter with ch340 chipset. However connection A, B, GND gave rise to confusion. Manufacturers use the naming arbitrarily so I had to connect A-(kamstrup) to B (usb-serial adapter) and vice versa. The Kamstrup has to be configured with the correct settings (baudrate, parity, adress,…)

I added following code in the configuration file


# Example yaml: full rtu connection
modbus:
  - name: modbus_hub
    type: serial
    port: /dev/ttyUSB0
    baudrate: 9600
    bytesize: 8
    method: rtu
    parity: E
    stopbits: 1
    sensors:
      - name: "t1 actual"
        slave: 100
        address: 6
        input_type: input
        unit_of_measurement: °C
        device_class: temperature
        state_class: measurement
        scale: 1
        offset: 0
        precision: 2
        data_type: float32
      - name: "t2 actual"
        slave: 100
        address: 8
        input_type: input
        unit_of_measurement: °C
        device_class: temperature
        state_class: measurement
        scale: 1
        offset: 0
        precision: 2
        data_type: float32
      - name: "t1-t2 diff. temperature"
        slave: 100
        address: 14
        input_type: input
        unit_of_measurement: °C
        device_class: temperature
        state_class: measurement
        scale: 1
        offset: 0
        precision: 2
        data_type: float32
      - name: "actual power"
        slave: 100
        address: 4
        input_type: input
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scale: 1
        offset: 0
        precision: 2
        data_type: float32
      - name: "energy"
        slave: 100
        address: 20
        input_type: input
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 1
        offset: 0
        precision: 2
        data_type: float32