home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.44k stars 30.68k forks source link

Modbus climate integration problem #94906

Closed francescoguidetti closed 1 year ago

francescoguidetti commented 1 year ago

The problem

This is th configuration of my climate device:

When I call the service climate.turn_on, the integration write with function code 16 the value 1 in register 1000 (hvac_onoff) and the value 1 in register 1001 (hvac_mode) and this is incorrect if I want turn on the device in cold mode and my device stop working correctly Climate.turn on should write only in register 1000 (hvac_onoff) There is another service (climate.set_hvac_mode) to set the mode

What version of Home Assistant Core has the issue?

core-2023.6.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

modbus

Link to integration documentation on our website

https://www.home-assistant.io/integrations/modbus/

Diagnostics information

No response

Example YAML snippet

- name: "AC Lavanderia"
        address: 1005
        precision: 1
        scale: 0.1
        max_temp: 30
        min_temp: 25
        target_temp_register: 1004
        temp_step: 1
        hvac_mode_register:
          address: 1001
          values:
            state_auto: 0
            state_cool: 4
            state_heat: 1
            state_fan_only: 3
            state_dry: 2
          write_registers: true
        hvac_onoff_register: 1000
        write_registers: true

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @adamchengtkc, @janiversen, @vzahradnik, mind taking a look at this issue as it has been labeled with an integration (modbus) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `modbus` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign modbus` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


modbus documentation modbus source (message by IssueLinks)

janiversen commented 1 year ago

please provide a debug log as pr modbus integration documentation

francescoguidetti commented 1 year ago

Here is th log of home assistant:

2023-06-20 10:54:52.345 INFO (SyncWorker_5) [homeassistant.components.modbus.modbus] modbus SamsungGateway communication open

This is the log of my hvac after I send the command 'climate.turn_on'

2023/06/20 11:21:11.6343 - > > 0MS:SK4 Rx bytes: 15 2023/06/20 11:21:11.6343 - > > 0MS:SK4 [Rx] D6 37 00 00 00 09 00 10 03 E8 00 01 02 00 01 2023/06/20 11:21:11.6343 - > > 0MS:SK4 [Rx] Slv:0 Func:16 Addr:1000 Qty:1 BC:2 Val:0x0001 2023/06/20 11:21:11.6343 - > > 0MS:SK4 [Tx] D6 37 00 00 00 06 00 10 03 E8 00 01 2023/06/20 11:21:11.6343 - > > 0MS:SK4 [Tx] Slv:0 Func:16 Addr:1000 Qty:1 2023/06/20 11:21:11.6343 - > > 0MS:SK4 Rx bytes: 15 2023/06/20 11:21:11.6343 - > > 0MS:SK4 [Rx] D6 38 00 00 00 09 00 10 03 E9 00 01 02 00 01 2023/06/20 11:21:11.6343 - > > 0MS:SK4 [Rx] Slv:0 Func:16 Addr:1001 Qty:1 BC:2 Val:0x0001 2023/06/20 11:21:11.6343 - > > 0MS:SK4 [Tx] D6 38 00 00 00 06 00 10 03 E9 00 01 2023/06/20 11:21:11.6343 - > > 0MS:SK4 [Tx] Slv:0 Func:16 Addr:1001 Qty:1

[Rx] si communication fron Home assistant and [Tx] to home assistant

janiversen commented 1 year ago

This log have nothing to do with the modbus integration. If you think there are a problem in the integration, you need to supply a debug log for the integration as pr documentation of the modbus integration.

francescoguidetti commented 1 year ago

I added these lines in configuration.yaml

logger: logs: homeassistant.components.modbus: debug pymodbus: debug

but nothing interesting in log:

home-assistant_2023-06-22T11-20-42.196Z.log

what i'm missing ?

janiversen commented 1 year ago

you did not restart HA.

francescoguidetti commented 1 year ago

I have already restarted HA but I did it again , and checked again the configuration
but nothing in log

home-assistant_2023-06-22T15-11-54.110Z.log

janiversen commented 1 year ago

then the debug is not added as pr documentation. Once active you will see hex dumps of what is being sent and received.

Restarting the integration is not enough, so please be sure you restarted the whole HA.

francescoguidetti commented 1 year ago

In attachment part of my configuration.yaml I restarted Home assistant and the whole system but I cannot see hex dump. Are you shure that the log of modbus integration in core 2023.6.3 is working correctly? I checked again and again but I cannot find anything wrong in my setup Thanks for your patience and support

configuration.yaml.txt

janiversen commented 1 year ago

It works on my system.