Cannot set target temperature on modbus climate

Hi,

I have several TCP modbus hubs, and one Serial. I have 3 climates (which are working great) controlling over TCP. But I am struggling to config one over serial modbus.

modbus config:

  - type: serial
    name: Hladilna_tehnika_klet
    method: ascii
    port:
      /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AB0L4W5T-if00-port0
    baudrate: 9600
    stopbits: 1
    bytesize: 7
    parity: E

climate config:

- name: Hladilnica
        slave: 2
        current_temp_register: 0
        current_temp_register_type: holding
        data_count: 1
        max_temp: 24
        min_temp: 0
        offset: 0
        precision: 1
        scale: 0.1
        target_temp_register: 204
        temp_step: 0.5
        data_type: uint
        scan_interval: 30

I was trying to change any parameter according to docs page. But if doesn’t change my problem.

I got following warnings:

2021-07-08 16:53:35 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/modbus/climate.py", line 211, in async_update
    self._target_temperature = await self._async_read_register(
  File "/usr/src/homeassistant/homeassistant/components/modbus/climate.py", line 222, in _async_read_register
    result = await self._hub.async_pymodbus_call(
  File "/usr/src/homeassistant/homeassistant/components/modbus/modbus.py", line 325, in async_pymodbus_call
    return await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/modbus/modbus.py", line 310, in _pymodbus_call
    result = self._call_type[use_call][ENTRY_FUNC](address, value, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pymodbus/client/common.py", line 114, in read_holding_registers
    return self.execute(request)
  File "/usr/local/lib/python3.8/site-packages/pymodbus/client/sync.py", line 109, in execute
    return self.transaction.execute(request)
  File "/usr/local/lib/python3.8/site-packages/pymodbus/transaction.py", line 181, in execute
    valid_response = self._validate_response(
  File "/usr/local/lib/python3.8/site-packages/pymodbus/transaction.py", line 125, in _validate_response
    mbap = self.client.framer.decode_data(response)
  File "/usr/local/lib/python3.8/site-packages/pymodbus/framer/ascii_framer.py", line 55, in decode_data
    uid = int(data[1:3], 16)
ValueError: invalid literal for int() with base 16: b':0'
2021-07-08 16:53:40 WARNING (SyncWorker_2) [pymodbus.client.sync] Cleanup recv buffer before send: 0xa

and

Pymodbus: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 5 bytes (0 received)

Strange thing is that if I manually call service modbus.write_register with target temp register. It does write properly in register.

does anyone else experience similar issue ?

Hi, I’m having the very same message in my config since 2021.07… my modbus sensors also did stop working at ‘Last logged’

Source: components/modbus/modbus.py:237
Integration: Modbus (documentation, issues)
First occurred: 2021. july 8. 18:56:21 (44 occurrences)
Last logged: 4:20:06

Pymodbus: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 8 bytes (0 received)

Hello, thanks for response.

2021.7.0 and 2021.7.1 are no go for me since doesn’t work for almost all modbus hubs I have (3 TCP, 1 serial - which actually works). So I rolled back to 2021.6.6

Mini climate card

type: custom:mini-climate
entity: climate.climat_rdc_ch_2
target_temperature:
icons:
up: mdi:chevron-up
down: mdi:chevron-down
unit: °C
min: 16
max: 31
step: 1
change_action: |
(value, entity) => {
var temperature = value * 10;
this.call_service(‘modbus’, ‘write_register’, {
hub: ‘HS-AC-MBS’,
address: 104,
slave: 1,
value: temperature
});
}