Modbus device : too many bytes

Hi,

I am trying to integrate a boiler (De Dietrich Diematic) via Modbus.

I have now discovered that the device sends 10 bytes back, but HA only reads 7 bytes. This way, the data gets chopped up.

I’ve tried receiving data with a 3rd party application, and here I see the ‘full receive frame’ 10 bytes.
(Just receiving plain TCP-socket bytes)

  • Example from my 3r party debug application :
    RECV: 0xa 0x3 0x2 0x0 0xb1 0xdd 0xf1 0x0 0x0 0x0
  • Error example from HA log :
    RECV : 0x0 0x0 0x0 0xa 0x3 0x2 0x0
  • But sometimes HA is lucky and received this (good decode) :
    RECV: 0xa 0x3 0x2 0x0 0xb1 0xdd 0xf1

Is there a way to tackle this?

(My yaml config : see below)
(Using the many error correction options, I sometimes get a value)

I am using a RS485 to ethernet adapter (rtuovertcp). Serial settings such as baud rate, start bits,… are correct.

modbus:
  - name: Waveshare
    type: rtuovertcp
    host: 192.168.2.245
    port: 20108
    #close_comm_on_error: true
    retry_on_empty: true
    retries: 10
    timeout: 15
    delay: 2
    message_wait_milliseconds: 2000
    sensors:
    - name: Temperatuur_badkamer 
      slave: 10
      address: 18
      count: 1
      input_type: holding
      data_type: int16 
      lazy_error_count: 5
      scale: 0.1
      precision: 1
      unit_of_measurement: '°C'
      device_class: "temperature"
      scan_interval: 20

Try with type: tcp

Just tried that. No incoming data anymore whatsoever.
I guess that’s normal, as the boiler is a Mdobus RTU device and not ModbusTCP.
So I am just tunneling RTU over TCP.

Update your “bridge device”

The hardware (bridge device or the cabling) is not the issue : as you see in my example, the modbus-communication works correctly from a 3rd party application. It’s not working correctly from HA.

Apparently the Modbus implementation of my boiler is a custom implementation (too many response bytes).
I want to solve it by treating it as a TCP sensor and not a Modbus sensor.
I just don’t know how to configure the template, so that it uses the 3rd and 4th byte as an INT, which is the requested temperature (x10).
The command to query the modbus register is fixed.

So I have :

- platform: tcp
    name: Test temperatuur boven
    host: 192.168.2.245
    port: 20108
    timeout: 5
    payload: "\x0a\x03\x00\x12\x00\x01\x25\x74"
    value_template: ?????
  • Can I enter the payload like this (in hex bytes)?
  • How do I enter the value_template to evaluate bytes 3 and 4?

Did you every manage to solve this … i have similar issue