Modbus not setting/reading value with error "Very short frame (NO MBAP)"

Hello together,

I’m setting up a fully Modbus controlled HVAC system in Germany (getting a little hot in here). Using oModbusMaster I can set and read holding registers over my setup successfully.

Here it is:

  • 5x Futjitsu UTY-VMSX
  • 1x WaveShare DIN-Rail RS485 to ETH gateway

I have configured the gateway to conduct the RTU to Modbus-TCP conversion and happily am using it from my Mac Modbus client that way (checked for framing issues).

Sadly with my homeassistant config it does not work
I am looking for hints to further debug it!

Here is my minimal config to check I can control one register first:

- name: "waveshare"
  type: tcp
  host: 172.16.1.59
  port: 502
  delay: 10
  switches:
    - name: "wozi_power"
      unique_id: "modbus_wozi_power"
      slave: 1
      address: 3
      command_on: 2
      command_off: 1
      verify:
    - name: "schlafz_power"
      unique_id: "modbus_schlafz_power"
      slave: 2
      address: 3
      command_on: 2
      command_off: 1
      verify:

This means my HVAC is set to on with a value of 2 and off with a value of 1.

Here is what I get from debug logging when flipping the Switch under entities in the GUI:

2024-11-10 08:15:21.047 DEBUG (MainThread) [pymodbus.logging] Adding transaction 111
2024-11-10 08:15:21.047 DEBUG (MainThread) [pymodbus.logging] Resetting frame - Current Frame in buffer -
2024-11-10 08:15:21.047 DEBUG (MainThread) [pymodbus.logging] send: 0x0 0x6f 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x3 0x0 0x2
2024-11-10 08:15:21.084 DEBUG (MainThread) [pymodbus.logging] recv: 0x0 0x6f 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x3 0x0 0x2 old_data:  addr=None
2024-11-10 08:15:21.085 DEBUG (MainThread) [pymodbus.logging] Processing: 0x0 0x6f 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x3 0x0 0x2
2024-11-10 08:15:21.085 DEBUG (MainThread) [pymodbus.logging] Factory Response[WriteSingleRegisterResponse': 6]
2024-11-10 08:15:21.085 DEBUG (MainThread) [pymodbus.logging] Getting transaction 111
2024-11-10 08:15:21.085 DEBUG (MainThread) [pymodbus.logging] Very short frame (NO MBAP):  wait for more data
2024-11-10 08:15:21.085 DEBUG (MainThread) [pymodbus.logging] Adding transaction 112
2024-11-10 08:15:21.085 DEBUG (MainThread) [pymodbus.logging] Resetting frame - Current Frame in buffer -
2024-11-10 08:15:21.086 DEBUG (MainThread) [pymodbus.logging] send: 0x0 0x70 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0x3 0x0 0x1
2024-11-10 08:15:21.087 DEBUG (MainThread) [pymodbus.logging] recv: 0x0 0x70 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2 old_data:  addr=None
2024-11-10 08:15:21.087 DEBUG (MainThread) [pymodbus.logging] Processing: 0x0 0x70 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
2024-11-10 08:15:21.087 DEBUG (MainThread) [pymodbus.logging] Factory Response[ReadHoldingRegistersResponse': 3]
2024-11-10 08:15:21.087 DEBUG (MainThread) [pymodbus.logging] Getting transaction 112
**2024-11-10 08:15:21.087 DEBUG (MainThread) [pymodbus.logging] Very short frame (NO MBAP):  wait for more data**

I seem to read from this log that HA is sending the required 2 to the gateway and receives confirmation. However, the HVAC with slave 1 is not turned on and does not switch the holding register 40003 to 2.

Is there any debugging you can recommend to me?

Best

So this is really related to the strict implementation of Modbus specifications in Homeassistant.

For the UTY-VMSX you must subtract 1 (one) from each given register address to reach the right register.

To make this pretty clear for myself and the worlds in ten years:

Reading from holding register named 40003 in the documentation (Betriebs-EIN/AUS-Einstellung), the address 2 must be used. Reading/writing holding registers is the default.

Reading from input register 30054 in the documentation (Betriebs-EIN/AUS-Status), the address 53 and the input_type: input must be used.

Here is a working minimal config to build upon:

- type: tcp
  host: 172.16.1.59
  port: 502
  switches:
    - name: "wozi_power"
      unique_id: "modbus_wozi_power"
      slave: 1
      address: 2
      command_on: 2
      command_off: 1
      verify:
  sensors:
    - name: "wozi_status_mode"
      unique_id: "modbus_wozi_status_mode"
      slave: 1
      address: 53
      input_type: input
    - name: "wozi_status_power"
      unique_id: "modbus_wozu_status_power"
      slave: 1
      address: 54
      input_type: input
    - name: "wozi_target_temperature"
      unique_id: "modbus_wozi_target_temperature"
      slave: 1
      address: 55
      input_type: input
      scale: 0.25
      precision: 1
      unit_of_measurement: "C"