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
72.14k stars 30.19k forks source link

Modbus write is very slow #102513

Closed scoop643 closed 11 months ago

scoop643 commented 11 months ago

The problem

I have 55 data points which I read via Modbus TCP. And through automations (Service "Modbus: Write register"), I write about 35 data points. It went well until 2023.9.3, but with the update to 2023.10.3 it became extremely slow. Sometimes it takes more than 10 minutes until the register is written into the PLC. If I downgrade it works again quite quickly.

What version of Home Assistant Core has the issue?

2023.10.3

What was the last working version of Home Assistant Core?

2023.9.3

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

2023-10-21 22:40:00.336 WARNING (MainThread) [homeassistant.components.automation.timer_modbus_write_vermogen] TIMER.MODBUS - Write vermogen: Already running 2023-10-21 22:40:39.473 WARNING (MainThread) [homeassistant.components.automation.modbus_900_tijdsduur_minuten_naar_priva] MODBUS.900 - Tijdsduur (minuten) naar Priva: Maximum number of runs exceeded 2023-10-21 22:40:43.584 ERROR (SyncWorker_8) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:41:20.817 DEBUG (SyncWorker_0) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:41:58.055 DEBUG (SyncWorker_7) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:42:35.288 DEBUG (SyncWorker_11) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:42:39.473 WARNING (MainThread) [homeassistant.components.automation.modbus_900_tijdsduur_minuten_naar_priva] MODBUS.900 - Tijdsduur (minuten) naar Priva: Maximum number of runs exceeded 2023-10-21 22:43:12.531 DEBUG (SyncWorker_6) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:43:49.768 DEBUG (SyncWorker_2) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:44:39.473 WARNING (MainThread) [homeassistant.components.automation.modbus_900_tijdsduur_minuten_naar_priva] MODBUS.900 - Tijdsduur (minuten) naar Priva: Maximum number of runs exceeded 2023-10-21 22:44:47.528 ERROR (SyncWorker_1) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:45:00.340 WARNING (MainThread) [homeassistant.components.automation.timer_modbus_write_vermogen] TIMER.MODBUS - Write vermogen: Already running 2023-10-21 22:45:24.760 DEBUG (SyncWorker_6) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:46:03.564 ERROR (SyncWorker_6) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:47:20.916 ERROR (SyncWorker_0) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:47:58.152 DEBUG (SyncWorker_4) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:48:35.389 DEBUG (SyncWorker_6) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:48:39.473 WARNING (MainThread) [homeassistant.components.automation.modbus_900_tijdsduur_minuten_naar_priva] MODBUS.900 - Tijdsduur (minuten) naar Priva: Maximum number of runs exceeded 2023-10-21 22:49:12.626 DEBUG (SyncWorker_9) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:49:49.866 DEBUG (SyncWorker_12) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:50:27.102 DEBUG (SyncWorker_4) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:50:39.472 WARNING (MainThread) [homeassistant.components.automation.modbus_900_tijdsduur_minuten_naar_priva] MODBUS.900 - Tijdsduur (minuten) naar Priva: Maximum number of runs exceeded 2023-10-21 22:51:24.350 ERROR (SyncWorker_10) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:52:01.587 DEBUG (SyncWorker_1) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:52:38.825 DEBUG (SyncWorker_9) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:52:39.473 WARNING (MainThread) [homeassistant.components.automation.modbus_900_tijdsduur_minuten_naar_priva] MODBUS.900 - Tijdsduur (minuten) naar Priva: Maximum number of runs exceeded 2023-10-21 22:53:16.064 DEBUG (SyncWorker_7) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:53:53.315 DEBUG (SyncWorker_0) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:54:30.554 DEBUG (SyncWorker_10) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response 2023-10-21 22:54:39.472 WARNING (MainThread) [homeassistant.components.automation.modbus_900_tijdsduur_minuten_naar_priva] MODBUS.900 - Tijdsduur (minuten) naar Priva: Maximum number of runs exceeded 2023-10-21 22:55:00.336 WARNING (MainThread) [homeassistant.components.automation.timer_modbus_write_vermogen] TIMER.MODBUS - Write vermogen: Already running

Example YAML snippet

# MODBUS PRIVA:
  - name: hub1
    type: tcp
    host: 10.0.0.79
    port: 502

    delay: 0
    message_wait_milliseconds: 100
    retries: 3
    timeout: 5

    sensors:

      - name: Priva_TT_Buiten
        unit_of_measurement: °C
        state_class: measurement
        scan_interval: 60
        slave: 1
        address: 11
        input_type: input
        data_type: int16
        scale: 0.1
        offset: 0
        precision: 1

      - name: Priva_TT_Garage
        unit_of_measurement: °C
        state_class: measurement
        scan_interval: 300
        slave: 1
        address: 12
        input_type: input
        data_type: int16
        scale: 0.1
        offset: 0
        precision: 1

And this is one of the automations:

alias: MODBUS.900 - Tijdsduur (minuten) naar Priva
description: ""
trigger:
  - platform: time_pattern
    minutes: /2
condition: []
action:
  - service: modbus.write_register
    data:
      hub: hub1
      address: 900
      value: "{{ as_timestamp(now()) | timestamp_custom('%M') | int * 1 }}"
mode: queued
max: 3

And another one:
alias: MODBUS.1063 Hue motion toilet 1eV [temperatuur]
description: ""
trigger: []
condition: []
action:
  - service: modbus.write_register
    data:
      hub: hub1
      address: 1063
      value: "{{ states('sensor.hue_motion_sensor_1_temperature_4') | float * 10 }}"
mode: single

wich is triggered by this automation:
alias: TIMER.MODBUS - Write Hue metingen
description: ""
trigger:
  - platform: time_pattern
    minutes: /15
condition: []
action:
  - service: automation.trigger
    data:
      skip_condition: true
    target:
      entity_id:
        - automation.modbus_1023_hue_motion_buiten_temperatuur
        - automation.modbus_1023_hue_motion_gang_temperatuur
        - automation.modbus_1043_hue_motion_toilet_bg_temperatuur
        - automation.modbus_1023_hue_motion_trap_temperatuur
        - automation.modbus_1063_hue_motion_toilet_1ev_temperatuur
        - automation.1073_temp
        - automation.1083_temp
mode: single

Anything in the logs that might be useful for us?

Logger: homeassistant.components.automation.modbus_900_tijdsduur_minuten_naar_priva
Source: helpers/script.py:1783
Integration: Automatisering (documentation, issues)
First occurred: 00:22:39 (235 occurrences)
Last logged: 09:58:39

MODBUS.900 - Tijdsduur (minuten) naar Priva: Maximum number of runs exceeded

Logger: homeassistant.components.automation.timer_modbus_write_hue_licht
Source: helpers/script.py:1783
Integration: Automatisering (documentation, issues)
First occurred: 04:15:00 (2 occurrences)
Last logged: 07:15:00

TIMER.MODBUS - Write Hue metingen: Already running

Logger: homeassistant.components.modbus.modbus
Source: components/modbus/modbus.py:355
Integration: Modbus (documentation, issues)
First occurred: 00:05:37 (222 occurrences)
Last logged: 10:00:33

Pymodbus: hub1: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 8 bytes (0 received)
Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response

Additional information

I just installed node-red and tried a write action to register 900 and that goes very fast with 2023.10.4

home-assistant[bot] commented 11 months 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.

(message by CodeOwnersMention)


modbus documentation modbus source (message by IssueLinks)

janiversen commented 11 months ago

Look at the first 3 log messages:

first it seems you start a second write before the first is terminated, that leads to problems. As you can see in the second log message.

But the real problem is in the 3 log message, your device do not respond within the timeout given. This might actually be due to the first message, and not caused by your device.

Please ensure that your writes are serialized, that should solve your problem, if not add a debug log as pr modbus documentation, including the first write !

scoop643 commented 11 months ago

Can you help me what i need to change to serialized the writes? Have you maybe an example?

I don't understand why it is slow after the update and not before.

janiversen commented 11 months ago

No, issues are for bug reports not support, please ask in one of the support forums. Apart from that I do not use automation.

You have probably been lucky before, because the integration was a lot slower.

We decided long time ago not to break a non-serialized write, because users was against it, so now users must ensure that the writes do not happen in parallel.

scoop643 commented 11 months ago

I think i understand what you mean. I neem to send al the write actions after each other and not at once every 5 minutes. Now i changed the automation, i wait 1 second between the write actions. I rebooted HA, and then i started the automation by hand. Here is the log you asked for.

2023-10-23 13:21:25.824 INFO (MainThread) [custom_components.hacs] Stage changed: running
2023-10-23 13:22:17.597 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Running automation actions
2023-10-23 13:22:17.598 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 900 (pulstrein)"
2023-10-23 13:22:22.606 ERROR (SyncWorker_8) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 8 bytes (0 received)
2023-10-23 13:22:22.715 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:22:23.718 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: VOORWAARDELIJK: Modbus: Write 1011 (Lamp eettafel rechts): Running automation actions
2023-10-23 13:22:23.718 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: VOORWAARDELIJK: Modbus: Write 1011 (Lamp eettafel rechts): Executing step Service "Modbus: Write register 1011 (Lamp eettafel rechts)"
2023-10-23 13:22:28.728 DEBUG (SyncWorker_11) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:22:28.831 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:22:29.833 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 1023 (Sensor Hue buiten TT)"
2023-10-23 13:22:34.842 ERROR (SyncWorker_10) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:22:34.944 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:22:35.946 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 1033 (Sensor Hue gang TT)"
2023-10-23 13:22:40.954 ERROR (SyncWorker_3) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:22:41.058 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:22:42.060 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: VOORWAARDELIJK: Modbus: Write 1041 (Lamp toilet BG): Running automation actions
2023-10-23 13:22:42.060 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: VOORWAARDELIJK: Modbus: Write 1041 (Lamp toilet BG): Executing step Service "Modbus: Write register 1041 (Lamp toilet BG)"
2023-10-23 13:22:47.068 DEBUG (SyncWorker_1) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:22:47.173 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:22:48.175 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 1043 (Sensor Hue toilet BG TT)"
2023-10-23 13:22:53.444 ERROR (SyncWorker_2) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:22:53.547 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:22:54.548 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 1053 (Sensor Hue trap TT)"
2023-10-23 13:22:59.557 DEBUG (SyncWorker_9) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:22:59.659 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:23:00.662 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: VOORWAARDELIJK: Modbus: Write 1061 (Lamp toilet 1eV): Running automation actions
2023-10-23 13:23:00.662 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: VOORWAARDELIJK: Modbus: Write 1061 (Lamp toilet 1eV): Executing step Service "Modbus: Write register 1061 (Lamp toilet 1eV)"
2023-10-23 13:23:05.668 ERROR (SyncWorker_4) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:23:05.772 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:23:06.773 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 1063 (Sensor Hue toilet 1eV TT)"
2023-10-23 13:23:11.781 ERROR (SyncWorker_10) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:23:11.884 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:23:12.886 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 1073 (Sensor Hue SK Xxxxxxx TT)"
2023-10-23 13:23:17.895 DEBUG (SyncWorker_0) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:23:17.997 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:23:18.997 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 1083 (Sensor Hue overloop TT)"
2023-10-23 13:23:25.340 ERROR (SyncWorker_7) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:23:25.447 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:23:26.449 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: VOORWAARDELIJK: Modbus: Write 3001 (Schuifpui): Running automation actions
2023-10-23 13:23:26.450 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: VOORWAARDELIJK: Modbus: Write 3001 (Schuifpui): Executing step Service "Modbus: Write register 3001 (Schuifpui)"
2023-10-23 13:23:31.458 ERROR (SyncWorker_4) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:23:31.561 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:23:32.563 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 3061 (Smartplug droger)"
2023-10-23 13:23:37.571 ERROR (SyncWorker_5) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:23:37.674 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:23:38.675 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 3062 (Smartplug oven)"
2023-10-23 13:23:43.684 ERROR (SyncWorker_13) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:23:43.787 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:23:44.789 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 3063 (Smartplug quooker)"
2023-10-23 13:23:49.799 DEBUG (SyncWorker_12) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:23:49.901 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:23:50.902 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 3064 (Smartplug vaatwasser)"
2023-10-23 13:23:55.910 ERROR (SyncWorker_12) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:23:56.014 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:23:57.016 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 3065 (Smartplug vriezer)"
2023-10-23 13:24:02.024 ERROR (SyncWorker_9) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:24:02.126 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:24:03.127 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 3066 (Smartplug wasmachine)"
2023-10-23 13:24:08.136 ERROR (SyncWorker_0) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:24:08.238 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:24:09.240 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 3067 (Smartplug bureau Xxxxxxx)"
2023-10-23 13:24:14.249 ERROR (SyncWorker_4) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:24:14.352 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:24:15.352 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 3071 (Sensor Badkamer TT)"
2023-10-23 13:24:22.335 ERROR (SyncWorker_4) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:24:22.438 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:24:23.439 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 3072 (Sensor Badkamer MT)"
2023-10-23 13:24:28.450 DEBUG (SyncWorker_8) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:24:28.552 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:24:29.553 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 3081 (Sensor Inloopkast TT)"
2023-10-23 13:24:34.562 ERROR (SyncWorker_5) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:24:34.664 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:24:35.665 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 3082 (Sensor Inloopkast MT)"
2023-10-23 13:24:40.673 ERROR (SyncWorker_13) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:24:40.775 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:24:41.776 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 3091 (Sensor Xxxxxxx TT)"
2023-10-23 13:24:46.787 DEBUG (SyncWorker_10) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:24:46.890 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:24:47.892 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 3092 (Sensor Xxxxxxx MT)"
2023-10-23 13:24:52.900 ERROR (SyncWorker_10) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:24:53.013 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:24:54.014 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 3093 (Sensor Xxxxxxx QT)"
2023-10-23 13:24:59.022 DEBUG (SyncWorker_4) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:24:59.124 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:25:00.125 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 4001 (Multical 603 - Sensor T1)"
2023-10-23 13:25:05.402 ERROR (SyncWorker_3) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:25:05.505 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:25:06.506 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 4002 (Multical 603 - Sensor T2)"
2023-10-23 13:25:11.515 ERROR (SyncWorker_12) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:25:11.619 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:25:12.122 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.electricity_meter_energy_consumption_tarif_1_cost, last_reset set to 2023-10-23T11:21:10.974586+00:00 (old last_reset 2023-10-22T08:48:49.447644+00:00)
2023-10-23 13:25:12.122 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.electricity_meter_energy_consumption_tarif_2_cost, last_reset set to 2023-10-23T11:21:10.974964+00:00 (old last_reset 2023-10-22T08:48:49.448067+00:00)
2023-10-23 13:25:12.122 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.electricity_meter_energy_production_tarif_1_compensation, last_reset set to 2023-10-23T11:21:10.975139+00:00 (old last_reset 2023-10-22T08:48:49.448274+00:00)
2023-10-23 13:25:12.122 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.electricity_meter_energy_production_tarif_2_compensation, last_reset set to 2023-10-23T11:21:10.975303+00:00 (old last_reset 2023-10-22T08:48:49.448455+00:00)
2023-10-23 13:25:12.123 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.kamstrup_multical_603_heat_energy_e1_cost, last_reset set to 2023-10-23T11:20:58.527792+00:00 (old last_reset 2023-10-22T08:48:16.796993+00:00)
2023-10-23 13:25:12.123 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.priva_e_watermeter_totaal_cost, last_reset set to 2023-10-23T11:21:15.041762+00:00 (old last_reset 2023-10-22T08:48:39.526729+00:00)
2023-10-23 13:25:12.621 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 4003 (Multical 603 - Power)"
2023-10-23 13:25:17.631 DEBUG (SyncWorker_4) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:25:17.734 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:25:18.735 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 4004 (Multical 603 - Flow)"
2023-10-23 13:25:25.039 ERROR (SyncWorker_11) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:25:25.142 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:25:26.144 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 4005 (Multical 603 - Heat Energy E1)"
2023-10-23 13:25:31.152 ERROR (SyncWorker_12) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:25:31.255 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:25:32.257 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 4006 (Multical 603 - Volume)"
2023-10-23 13:25:37.265 ERROR (SyncWorker_2) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:25:37.390 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:25:38.392 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 5001 (PV-1 voorspelling)"
2023-10-23 13:25:43.399 ERROR (SyncWorker_10) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:25:43.501 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:25:44.503 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 5002 (PV-2 voorspelling)"
2023-10-23 13:25:49.510 DEBUG (SyncWorker_7) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:25:49.612 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:25:50.614 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 5003 (PV-3 voorspelling)"
2023-10-23 13:25:55.956 ERROR (SyncWorker_10) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:25:56.068 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:25:57.069 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: VOORWAARDELIJK: Modbus: Write 7001 (Airco SK Xxxxxxx vermogen): Running automation actions
2023-10-23 13:25:57.070 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: VOORWAARDELIJK: Modbus: Write 7001 (Airco SK Xxxxxxx vermogen): Executing step Service "Modbus: Write register 7001 (Airco SK Xxxxxxx vermogen)"
2023-10-23 13:26:02.078 ERROR (SyncWorker_11) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
2023-10-23 13:26:02.181 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:26:03.183 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: VOORWAARDELIJK: Modbus: Write 7101 (Kookplaat vermogen): Running automation actions
2023-10-23 13:26:03.183 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: VOORWAARDELIJK: Modbus: Write 7101 (Kookplaat vermogen): Executing step Service "Modbus: Write register 7101 (Kookplaat vermogen)"
2023-10-23 13:26:08.191 ERROR (SyncWorker_14) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response

And this is the complete automation:

alias: MODBUS.WRITE Registers
description: ""
trigger:
  - platform: time_pattern
    minutes: /5
condition: []
action:
  - service: modbus.write_register
    data:
      hub: hub1
      address: 900
      value: "{{ as_timestamp(now()) | timestamp_custom('%M') | int * 1 }}"
    alias: "Service \"Modbus: Write register 900 (pulstrein)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - if:
      - condition: device
        type: is_on
        device_id: b656bce1773aea267a7cd468f2015f95
        entity_id: a3e59008a7f031b32e8999e50867f07d
        domain: light
    then:
      - service: modbus.write_coil
        data:
          hub: hub1
          address: 1011
          state: 1
    else:
      - service: modbus.write_coil
        data:
          hub: hub1
          address: 1011
          state: 0
        alias: "Service \"Modbus: Write register 1011 (Lamp eettafel rechts)\""
    alias: "VOORWAARDELIJK: Modbus: Write 1011 (Lamp eettafel rechts)"
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 1023
      value: >-
        {{ states('sensor.hue_outdoor_motion_sensor_temperature') | float * 10
        }}
    alias: "Service \"Modbus: Write register 1023 (Sensor Hue buiten TT)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 1033
      value: "{{ states('sensor.hue_motion_sensor_gang_temperature') | float * 10 }}"
    alias: "Service \"Modbus: Write register 1033 (Sensor Hue gang TT)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - if:
      - condition: device
        type: is_on
        device_id: 579aae427a6c09e9022f9b766d6a3005
        entity_id: ae760788ed62e4faaeefb3df3d1c8f42
        domain: light
    then:
      - service: modbus.write_coil
        data:
          hub: hub1
          state: 1
          address: 1041
    else:
      - service: modbus.write_coil
        data:
          hub: hub1
          state: 0
          address: 1041
        alias: "Service \"Modbus: Write register 1041 (Lamp toilet BG)\""
    alias: "VOORWAARDELIJK: Modbus: Write 1041 (Lamp toilet BG)"
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 1043
      value: >-
        {{ states('sensor.hue_motion_sensor_toilet_bg_temperature') | float * 10
        }}
    alias: "Service \"Modbus: Write register 1043 (Sensor Hue toilet BG TT)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 1053
      value: "{{ states('sensor.hue_motion_sensor_1_temperature') | float * 10 }}"
    alias: "Service \"Modbus: Write register 1053 (Sensor Hue trap TT)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - if:
      - condition: device
        type: is_on
        device_id: 52d8346d6b33ce79d25ce34752c42fac
        entity_id: 5b04b7cf37ca2eac64bd2d1cf158d442
        domain: light
    then:
      - service: modbus.write_coil
        data:
          hub: hub1
          state: 1
          address: 1061
    else:
      - service: modbus.write_coil
        data:
          hub: hub1
          state: 0
          address: 1061
        alias: "Service \"Modbus: Write register 1061 (Lamp toilet 1eV)\""
    alias: "VOORWAARDELIJK: Modbus: Write 1061 (Lamp toilet 1eV)"
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 1063
      value: "{{ states('sensor.hue_motion_sensor_1_temperature_4') | float * 10 }}"
    alias: "Service \"Modbus: Write register 1063 (Sensor Hue toilet 1eV TT)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 1073
      value: "{{ states('sensor.hue_motion_sensor_1_temperature_2') | float * 10 }}"
    alias: "Service \"Modbus: Write register 1073 (Sensor Hue SK Xxxxxxx TT)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 1083
      value: "{{ states('sensor.hue_motion_sensor_1_temperature_3') | float * 10 }}"
    alias: "Service \"Modbus: Write register 1083 (Sensor Hue overloop TT)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - if:
      - type: is_open
        condition: device
        device_id: 8ec81a22217d02c9365c0d91a6239565
        entity_id: binary_sensor.deurcontact_schuifpui_iaszone
        domain: binary_sensor
    then:
      - service: modbus.write_register
        data:
          hub: hub1
          address: 3001
          value: 1
    else:
      - service: modbus.write_register
        data:
          hub: hub1
          address: 3001
          value: 0
        alias: "Service \"Modbus: Write register 3001 (Schuifpui)\""
    alias: "VOORWAARDELIJK: Modbus: Write 3001 (Schuifpui)"
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 3061
      value: "{{ states('sensor.smart_plug_droger_current_power') | int }}"
    alias: "Service \"Modbus: Write register 3061 (Smartplug droger)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 3062
      value: "{{ states('sensor.smart_plug_oven_current_power') | int }}"
    alias: "Service \"Modbus: Write register 3062 (Smartplug oven)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 3063
      value: "{{ states('sensor.smart_plug_quooker_current_power') | int }}"
    alias: "Service \"Modbus: Write register 3063 (Smartplug quooker)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 3064
      value: "{{ states('sensor.smart_plug_vaatwasser_current_power') | int }}"
    alias: "Service \"Modbus: Write register 3064 (Smartplug vaatwasser)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 3065
      value: "{{ states('sensor.smart_plug_vriezer_current_power') | int }}"
    alias: "Service \"Modbus: Write register 3065 (Smartplug vriezer)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 3066
      value: "{{ states('sensor.smart_plug_wasmachine_current_power') | int }}"
    alias: "Service \"Modbus: Write register 3066 (Smartplug wasmachine)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 3067
      value: "{{ states('sensor.smartplug_bureau_xxxxxxx_active_power') | int }}"
    alias: "Service \"Modbus: Write register 3067 (Smartplug bureau Xxxxxxx)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 3071
      value: "{{ states('sensor.tz3000_xr3htd96_ts0201_temperature') | float * 10 }}"
    alias: "Service \"Modbus: Write register 3071 (Sensor Badkamer TT)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 3072
      value: "{{ states('sensor.tz3000_xr3htd96_ts0201_humidity') | float * 10 }}"
    alias: "Service \"Modbus: Write register 3072 (Sensor Badkamer MT)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 3081
      value: >-
        {{ states('sensor.ruimtesensor_inloopkast_temperature_2') | float * 10
        }}
    alias: "Service \"Modbus: Write register 3081 (Sensor Inloopkast TT)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 3082
      value: "{{ states('sensor.ruimtesensor_inloopkast_humidity_2') | float * 10 }}"
    alias: "Service \"Modbus: Write register 3082 (Sensor Inloopkast MT)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 3091
      value: >-
        {{ states('sensor.ruimtesensor_slaapkamer_xxxxxxx_temperature') | float *
        10 }}
    alias: "Service \"Modbus: Write register 3091 (Sensor Xxxxxxx TT)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 3092
      value: >-
        {{ states('sensor.ruimtesensor_slaapkamer_xxxxxxx_humidity') | float * 10
        }}
    alias: "Service \"Modbus: Write register 3092 (Sensor Xxxxxxx MT)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 3093
      value: >-
        {{
        states('sensor.ruimtesensor_slaapkamer_xxxxxxx_carbon_dioxide_concentration')
        | int }}
    alias: "Service \"Modbus: Write register 3093 (Sensor Xxxxxxx QT)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 4001
      value: "{{ states('sensor.kamstrup_multical_603_temp1') | float * 100 }}"
    alias: "Service \"Modbus: Write register 4001 (Multical 603 - Sensor T1)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 4002
      value: "{{ states('sensor.kamstrup_multical_603_temp2') | float * 100 }}"
    alias: "Service \"Modbus: Write register 4002 (Multical 603 - Sensor T2)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 4003
      value: "{{ states('sensor.kamstrup_multical_603_power') | float * 10 }}"
    alias: "Service \"Modbus: Write register 4003 (Multical 603 - Power)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 4004
      value: "{{ states('sensor.kamstrup_multical_603_flow') | float * 1 }}"
    alias: "Service \"Modbus: Write register 4004 (Multical 603 - Flow)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 4005
      value: >-
        {{ states('sensor.kamstrup_multical_603_heat_energy_e1') | float * 100
        }}
    alias: "Service \"Modbus: Write register 4005 (Multical 603 - Heat Energy E1)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 4006
      value: "{{ states('sensor.kamstrup_multical_603_volume') | float * 10 }}"
    alias: "Service \"Modbus: Write register 4006 (Multical 603 - Volume)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 5001
      value: "{{ states('sensor.energy_production_today') | float * 10 }}"
    alias: "Service \"Modbus: Write register 5001 (PV-1 voorspelling)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 5002
      value: "{{ states('sensor.energy_production_today_2') | float * 10 }}"
    alias: "Service \"Modbus: Write register 5002 (PV-2 voorspelling)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: modbus.write_register
    data:
      hub: hub1
      address: 5003
      value: "{{ states('sensor.energy_production_today_3') | float * 10 }}"
    alias: "Service \"Modbus: Write register 5003 (PV-3 voorspelling)\""
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - if:
      - condition: state
        entity_id: sensor.ac_slaapkamer_xxxxxxx_energy_current
        state: unavailable
    then: []
    else:
      - service: modbus.write_register
        data:
          hub: hub1
          address: 7001
          value: "{{ states('sensor.ac_slaapkamer_xxxxxxx_energy_current') | int }}"
        alias: "Service \"Modbus: Write register 7001 (Airco SK Xxxxxxx vermogen)\""
    alias: "VOORWAARDELIJK: Modbus: Write 7001 (Airco SK Xxxxxxx vermogen)"
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - if:
      - condition: state
        entity_id: sensor.zigbee_digital_meter_power
        state: unavailable
    then: []
    else:
      - service: modbus.write_register
        data:
          hub: hub1
          address: 7101
          value: "{{ states('sensor.zigbee_digital_meter_power') | int }}"
        alias: "Service \"Modbus: Write register 7101 (Kookplaat vermogen)\""
    alias: "VOORWAARDELIJK: Modbus: Write 7101 (Kookplaat vermogen)"
mode: single
janiversen commented 11 months ago

your device do not respond, see the log: No Response received from the remote slave/Unable to decode response

scoop643 commented 11 months ago

Oke, i'm sorry. I think i know where the problem is. I didn't send the slave ID with the write actions. The Priva PLC (Building Automation) did receive the message from Home Assistant, so I always assumed the connection was good. I will also adjust the others to slave ID 1 tonight and then try the upgrade to 2023.10.3 again. Here you can see the new log with some write actions on Slave ID 1.

2023-10-23 13:56:39.336 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Running automation actions
2023-10-23 13:56:39.336 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 900 (pulstrein)"
2023-10-23 13:56:39.462 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:56:40.464 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Skipped disabled step VOORWAARDELIJK: Modbus: Write 1011 (Lamp eettafel rechts)
2023-10-23 13:56:40.464 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:56:41.467 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 1023 (Sensor Hue buiten TT)"
2023-10-23 13:56:41.590 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:56:42.591 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 1033 (Sensor Hue gang TT)"
2023-10-23 13:56:42.730 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:56:43.732 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Skipped disabled step VOORWAARDELIJK: Modbus: Write 1041 (Lamp toilet BG)
2023-10-23 13:56:43.733 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:56:44.734 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 1043 (Sensor Hue toilet BG TT)"
2023-10-23 13:56:44.853 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:56:45.854 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 1053 (Sensor Hue trap TT)"
2023-10-23 13:56:45.979 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:56:46.980 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Skipped disabled step VOORWAARDELIJK: Modbus: Write 1061 (Lamp toilet 1eV)
2023-10-23 13:56:46.980 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:56:47.982 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 1063 (Sensor Hue toilet 1eV TT)"
2023-10-23 13:56:52.989 ERROR (SyncWorker_14) [homeassistant.components.modbus.modbus] Pymodbus: hub1: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 8 bytes (0 received)
2023-10-23 13:56:53.093 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step delay 0:00:01
2023-10-23 13:56:54.095 INFO (MainThread) [homeassistant.components.automation.modbus_write_registers] MODBUS.WRITE Registers: Executing step Service "Modbus: Write register 1073 (Sensor Hue SK TenT TT)"
scoop643 commented 11 months ago

I found the 2 problems i had.

Problem 1: I had multiple automations that were on a 5 minute trigger. As a result, they wanted to do a writing campaign at the same time. I solved this by creating 1 automation and placing all write actions conditionally (entity must be available) one after the other so that they are written one after the other.

Problem 2: I used address 1 to read modbus TCP data. But I had not entered it when writing. The PLC did receive the write actions, but (presumably) did not return the correct answer to Home Assistant, which caused the errors.

In summary: Now the script runs in a short time. For the adjustments with 2023.9.3 it took him 3 minutes. Now with the adjustments in 2023.10.3 in a few seconds.

My apologies for creating a bug report, so it was my own fault.

janiversen commented 11 months ago

No problem, happy that you have a solution.