Climate Modbus integrations issues

Hi,

I have thermostat on Modbus. I have made all setup and I’m able to read temperature (Current Temperature, Manual Temperature and Auto Temperature) - modbus sensor. I can as well read status of Thermostat and setup status as well (modbus switch).

I try to use modbus climate. I’m able to read data as current temperature but I’m not able to setup.

My configuration is:

modbus:
  name: RS485
  type: rtuovertcp
  host: 192.168.0.7
  port: 1234

climate:
  - platform: modbus
    name: Czujnik_Test
    hub: RS485
    slave: 1
    data_type: int
    data_count: 1
    scale: 0.1
    offset: 0
    precision: 1
    max_temp: 30
    min_temp: 0
    target_temp_register: 4
    current_temp_register: 1

Screenshot from HA
image

It looks to me that register target_temp_register is able to ready setup temperature from Thermostat, but is not able to setup. This is my observation due to whenever I try to setup from faceplate it is overwrite after a few seconds (refresh interval ).

Do you have idea how to make multiple function to be able to read current temperature and set-up temperature into thermostat?

NOTE: I have not used the Modbus Climate Integration.

Have you read the documentation here? In particular the ‘Services’ section where it gives some detail:

SERVICES

Service Description
set_temperature Set Temperature. Requires value to be passed in, which is the desired target temperature. value should be in the same type as data_type

So you will need to constuct an automation to pass the values something like this below:

NOTE THIS WILL NEED TO BE ADAPTED TO USE YOUR CLIMATE DEVICE VALUES AND THE ‘set_temperature’ SERVICE

- id: SludgePumpRestartDelay
  alias: Sludge Pump Restart Delay
  trigger:
    platform: state
    entity_id: input_number.slider2
  action:
    service: modbus.write_register
    data_template:
      hub: hub1
      unit: 1
      address: 3092
      value: "{{ states.input_number.slider2.state|int }}"

So have a go and report back any problems you are having and I will see if I can help more then.

Thank you for your help.
This example it is very useful but I do not have idea how to refer into slider that I have on my card. I’m using type: thermostat (as in above screen), so how can I refer into slider on that? Do you have any idea?
Can you refer into manual that I will be able to ready more about it? Where can I find name of slider that is on Thermostat card?

Sorry for those question but I have started HA working and there is a lot of thinks that I try to manage but I do not have full picture where to find what :slight_smile:

1 Like

I read a little better what your config is presently doing (I may have been on the wrong track with my advice) so I would ask could you perhaps post a link to your heating unit manual so I can read that please?

Cheers!

I’m using Modbus protocol to communicate with my thermostat. All data are kept in registers that I can read or write. Entity Climate is one of the entity that I use. Based on HA I can used Thermostat card that I see current temperature and I could be able to setup. If I’m right click on ring I can changed temperature within the range that is setup but I’m not able to send setup. As you have mention I should use “modbus.write_register” but from where I should read that data? To what shall i refer? You are using slidere2 that is defined but how can I read temperature from slider use in Thermostat cards? How to refer into this slider?

I feel I need to look at the manual for your climate device to get on track please?

I am also working towards using modbus climate platform. When you click on the ‘ring’ to change target termperature, it will send new target temperature via modbus, BUT when it updates the target_temperature, it not only writes register address 4 ( per your setup), it uses a multiple address write and also writes a zero to the following address ( address 4+1=5 in your setup). The data_count: 1 only affects the reading back of the registers ( target and current temperatures). When writing, it always sends two registers, the value and a following zero. No idea why. These lines from climate.py

    def _write_register(self, register, value):
        """Write holding register using the Modbus hub slave."""
        try:
            self._hub.write_registers(self._slave, register, [value, 0])
        except ConnectionException:
            self._available = False
            return

        self._available = True 

Hi [dougfreeman], where can i see this function in files, i’m triing to integrate modbus thermostat, but it doesnt support FC 17 i need to change function to use FC 6

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
});
}