Modbus Climate: multiple target temp register

Hi, I’m trying to create a climate entity through the home assistant modbus integration that manages fan coils. I have the entire register map available and by creating the various sensors I can easily read the values. The problem arises when I have to set the target_temperature register because based on the HVAC_MODE set, the target_temperature register changes. In fact, the fan coil uses the holding register 28310 for cooling target temperature, 28311 for heating target temperature, 28312 for automatic cooling target temperature, 28313 automatic heating target temperature. How can I handle this problem when changing the HVAC mode? It would be nice to be able to define the target_temperature_register under the definition of the hvac_mode value. I attach the yaml code that I currently use for the heating mode. Thank you

modbus:
  - name: modbus_hub
    type: serial
    port: /dev/ttyACM0
    baudrate: 9600
    bytesize: 8
    method: rtu
    parity: N
    stopbits: 1
    delay: 0
    message_wait_milliseconds: 30
    retries: 3
    timeout: 5

    climates:
      - name: Ulivo PT riscaldamento
        slave: 4
        data_type: int16
        address: 46801
        hvac_mode_register:
          address: 28302
          values:
            state_heat: 4
        hvac_onoff_register: 28301
        input_type: holding
        max_temp: 30
        min_temp: 8
        offset: 0
        precision: 1
        scale: 0.1
        temp_step: 1
        temperature_unit: °C
        target_temp_register: 28311

It would be nice if it could be done like this:

  climates:
      - name: Ulivo PT riscaldamento
        slave: 4
        data_type: int16
        address: 46801
        hvac_mode_register:
          address: 28302
          values:
            state_cool: 1
               target_temperature_register: 28310
            state_heat: 4
               target_temperature_register: 28311
        hvac_onoff_register: 28301
        input_type: holding
        max_temp: 30
        min_temp: 8
        offset: 0
        precision: 1
        scale: 0.1
        temp_step: 1
        temperature_unit: °C

Hi, I was opening a similar request when I found this one.

I don’t know if there are devices which accept 4 registers, but for sure 2 at least for cooling and heating.
I met similar problems surfing the web and in this forum (reference example)

I think that could be useful to open this possibility.

@kneefabio , I suggest to rename the topic in “Modbus Climate: multiple target temp registers” in ordet to make it more generic. This feature, in fact, is useful also for heating pumps, not only fancoils…

Feature is going to be released, my PR implementing it has been merged: Add modbus option to manage different setPoint registers by crug80 · Pull Request #107600 · home-assistant/core · GitHub

1 Like

Hello! This topic has not been clear to me at all. Have you managed to get the Modbus Climate to work with 2 target temps according to the work mode? I’m in the same situation as you.

Thank you!

Yes, the modbus climate accepts different setpoints based on hvac mode.

The problem is that my thermostat has different setpoints depending on the activity, not the HVAC.

I have HVAC AUTO/HEAT/OFF.

When it’s in AUTO it’s sometimes in ECO and sometimes in CONFROT (depoend of the schedule). ECO and COMFORT have different setpoints.

Anyway, can you tell me what the code would be with the HVAC? Let’s see if I can get something like that.

Thank you!

The climate can address one setpoint for AUTO and another one for HEAT, but it cannot manage ECO or confort. They are internal modes of your thermostat that home Assistant will not manage…

The official doc will explain how to set them: Modbus - Home Assistant

That’s the problem. In my system:

  • Heat → Comfort
  • Auto → Eco/Comfort is a Scheduled

I have 2 target temp adress:

    - name: "ACS Temperatura de Confort"
      slave: 100
      address: 1177
      input_type: holding
      data_type: int16
      scan_interval: 5
      device_class: temperature
      unit_of_measurement: °C
      state_class: measurement
      scale: 0.01
      precision: 1
    - name: "ACS Temperatura ECO"
      slave: 100
      address: 1178
      input_type: holding
      data_type: int16
      scan_interval: 5
      device_class: temperature
      unit_of_measurement: °C
      state_class: measurement
      scale: 0.01
      precision: 1

So I don’t know how to solve it.

You could map a different HVAC Home Assistant value to your Eco or confort. Probably it is not the best thing to view, but it should work.
In example:

  # ACS Example Climate
- name: "ACS Example"
  unique_id: "fc_acs_example"
  device_address: 100
  scan_interval: 32
  input_type: depending on your system
  address: your address for current temp
  precision: 1
  scale: 0.01
  hvac_mode_register:
    address: your reg for hvac
    write_registers: depending on your system
    values:
      state_off: depending on your system
      state_heat: depending on your system
      state_auto: depending on your system -> this could be your eco
      state_heatcool: depending on your system -> this could your  confort
  write_registers: depending on your system
  hvac_onoff_register: reg, depending on your system
  max_temp: 35
  min_temp: 15
  temp_step: 1
  target_temp_register: [REG_AUTO, REG_COOL, REG_DRY, REG_FAN, REG_HEAT, REG_HEAT_COOL, REG_OFF]
  target_temp_write_registers: depending on your system
  fan_mode_register:
    address: reg, depending on your system
    values:
      state_fan_off: depending on your system
      state_fan_low: depending on your system
      state_fan_medium: depending on your system
      state_fan_high: depending on your system

In the end, I’m using 2 climates, one for eco and one for comfort.

I hide one and this is the result: