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
69.49k stars 28.68k forks source link

Modbus integration is really slow with 33 climate modbus entities and scan_interval set below 60 seconds #117684

Closed rjulius23 closed 2 weeks ago

rjulius23 commented 1 month ago

The problem

I have a set up where I have 33 climate entities via modbus TCP. I have noticed the following:

What version of Home Assistant Core has the issue?

core-2024.1.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

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

modbus:
  - name: modbusHub
    type: tcp
    host: 10.118.91.192
    port: 22
    climates:
      - name: dh_118_201_fancoil_climate
        device_address: 2
        scan_interval: 90
        address: 1209
        data_type: int16
        max_temp: 30
        min_temp: 18
        offset: 0
        precision: 1
        scale: 0.1
        target_temp_register: 1208
        temp_step: 1
        temperature_unit: C
        hvac_onoff_register: 1202
        hvac_mode_register:
          address: 1203
          values:
            state_auto: 0
            state_cool: 1
            state_dry: 2
            state_fan_only: 3
            state_heat: 4
        fan_mode_register:
          address: 1204
          values:
            state_fan_auto: 0
            state_fan_low: 1
            state_fan_middle: 2
            state_fan_high: 3

Anything in the logs that might be useful for us?

2024-05-18 08:46:06.245 DEBUG (SyncWorker_4) [pymodbus.logging] Running transaction 1747
2024-05-18 08:46:06.245 DEBUG (SyncWorker_4) [pymodbus.logging] SEND: 0x6 0xd3 0x0 0x0 0x0 0x6 0x4 0x6 0x2 0x5b 0x0 0x4
2024-05-18 08:46:06.245 DEBUG (SyncWorker_4) [pymodbus.logging] New Transaction state "SENDING"
2024-05-18 08:46:06.245 DEBUG (SyncWorker_4) [pymodbus.logging] Changing transaction state from "SENDING" to "WAITING FOR REPLY"
2024-05-18 08:46:06.532 DEBUG (SyncWorker_4) [pymodbus.logging] Changing transaction state from "WAITING FOR REPLY" to "PROCESSING REPLY"
2024-05-18 08:46:06.532 DEBUG (SyncWorker_4) [pymodbus.logging] RECV: 0x6 0xd3 0x0 0x0 0x0 0x6 0x4 0x6 0x2 0x5b 0x0 0x4
2024-05-18 08:46:06.532 DEBUG (SyncWorker_4) [pymodbus.logging] Processing: 0x6 0xd3 0x0 0x0 0x0 0x6 0x4 0x6 0x2 0x5b 0x0 0x4
2024-05-18 08:46:06.532 DEBUG (SyncWorker_4) [pymodbus.logging] Factory Response[WriteSingleRegisterResponse': 6]
2024-05-18 08:46:06.532 DEBUG (SyncWorker_4) [pymodbus.logging] Adding transaction 1747
2024-05-18 08:46:06.532 DEBUG (SyncWorker_4) [pymodbus.logging] Getting transaction 1747
2024-05-18 08:46:06.532 DEBUG (SyncWorker_4) [pymodbus.logging] Changing transaction state from "PROCESSING REPLY" to "TRANSACTION_COMPLETE"
2024-05-18 08:46:06.533 DEBUG (SyncWorker_55) [pymodbus.logging] Current transaction state - TRANSACTION_COMPLETE

Additional information

No response

home-assistant[bot] commented 1 month ago

Hey there @janiversen, 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. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


modbus documentation modbus source (message by IssueLinks)

PeteRager commented 1 month ago

My guess is you need a faster computer or more RAM. What are you running it on?

janiversen commented 1 month ago

A faster cpu is not needed for that small amount of data !

Please add a debug log as pr modbus documentation, so we can see what happens, I suspect the setting is written fast to your device, but the verify read only happens at scan interval.

You are using 2024.1.5 please update to newest ha version, as there have been many changes in modbus and we do not solve bugs in old versions.

janiversen commented 2 weeks ago

Closing due to missing information.