Long delay writing to modbus registers Fronius invertor from Home Assistent

I am developing smart power plant control for our customers on the Home Assistent platform. I am trying to set the maximum power values of the power plant in registers 40236 and 40232.

Unfortunately, we are encountering a problem that prevents reasonable control of Fronius inverters, namely that when trying to write values via the Modbus protocol, it takes an unbearably long time for the write to be completed. We are talking about about 15-30 seconds before the write is completed. I have tried to find all possible information on the Internet and in Fronius manual, and unfortunately I have not found the reason why the write takes so long.

Modbus in the Home Assistent application seems to work correctly, because for example Victron responds completely correctly and writes to this device occur without delay.

I have tried several different Fronius inverters and they all behave the same, they all have a desperately long delay when writing values. However, when communicating between Victron and Fronius, the writes work quickly, so I assume that there is no fault in Fronius. Likewise, writing from Home Assistent to Victron works immediately, so I assume that there is no error in the Home Assistent application either. The problem only occurs in the communication between Home Assistent and Fronius.

Here is the beginning of the Fronius device configuration file, as I have it set up for Home Assistent:

Code:
- type: tcp
    name: Fronius201
    host: 10.130.17.201
    port: 502
    delay: 1
    timeout: 9
    message_wait_milliseconds: 200
    sensors:
    - name: Fronius201_40233_SetPowerOutputToLevel
      slave: 1
      address: 40232
      data_type: uint16
      unit_of_measurement: "Wmax"
      scale: 1
      precision: 1
      scan_interval: 1
      device_class: power
      state_class: measurement
I’ve tried playing around with setting the timeout, delay, and message_wait_milliseconds values, but to no avail.

Here’s the script I use to change the registry values:
Code:
sequence:
  - if:
      - condition: state
        entity_id: input_select.rezim_omezovani_vyroby_fronius201
        state: Manual Power Limit
    then:
      - action: modbus.write_register
        metadata: {}
        data:
          hub: Fronius201
          address: 40236
          slave: 1
          value: 0
      - delay:
          hours: 0
          minutes: 0
          seconds: 3
          milliseconds: 0
      - action: modbus.write_register
        metadata: {}
        data:
          hub: Fronius201
          address: 40232
          slave: 1
          value: "{{ states('input_number.maximalnivykonfronius201') }}"
      - delay:
          hours: 0
          minutes: 0
          seconds: 3
          milliseconds: 0
      - action: modbus.write_register
        metadata: {}
        data:
          hub: Fronius201
          address: 40236
          value: 1
          slave: 1
        enabled: true
alias: Fronius_nastaveni_max_vykonu
description: ""
As I mentioned above, the script works, but it takes about 40 seconds to complete, which is unbearably long. Each write takes about 10-15 seconds, and three writes in total take about 40 seconds.

Can you please suggest what could be the reason for such a slow write? I would like to point out that I am using the latest firmware versions on both Fronius and Home Assistent.
 
I suggest trying to gain more insight into the issue. It seems you've already determined that the issue probably lies in Home Assistant and not in the Fronius, since you stated that when communicating between Victron and Fronius, the writes work quickly.

Therefore, focus on what Home Assitant is doing. Review the diagnostics information for HA's Modbus integration to check for things like issuing multiple read or write requests simultaneously or sending too many read requests too quickly such that HA is unable to send write requests until all the reads have completed.

I know you've already tried modifying timing parameters such as timeout, delay, and message_wait_milliseconds, but what happens if you increase the scan_interval setting? Does this reduce the write delay?

If HA's diagnostics information does not provide enough insight, I recommend capturing the Modbus TCP traffic using Wireshark and analyzing the requests from HA and responses (or lack of responses) from the Fronius. If HA is running on a computer, then simply run Wireshark on that computer. Otherwise, you will need to use an Ethernet switch with port mirroring enabled to capture the packets between the HA device and Fronius using a computer.
 
If Victron is a drive and Frontius is a drive and Home assistant, a Modbus master/client, writes to both devices, each a Modbus server/slave, how do two Modbus slave/servers talk to each other, successfully?
 
If Victron is a drive and Frontius is a drive and Home assistant, a Modbus master/client, writes to both devices, each a Modbus server/slave, how do two Modbus slave/servers talk to each other, successfully?
With Modbus TCP some devices are both a master and a slave, though I don’t know if this is the case here.
 
I am developing smart power plant control for our customers on the Home Assistent platform. I am trying to set the maximum power values of the power plant in registers 40236 and 40232.

Unfortunately, we are encountering a problem that prevents reasonable control of Fronius inverters, namely that when trying to write values via the Modbus protocol, it takes an unbearably long time for the write to be completed. We are talking about about 15-30 seconds before the write is completed. I have tried to find all possible information on the Internet and in Fronius manual, and unfortunately I have not found the reason why the write takes so long.

Modbus in the Home Assistent application seems to work correctly, because for example Victron responds completely correctly and writes to this device occur without delay.

I have tried several different Fronius inverters and they all behave the same, they all have a desperately long delay when writing values. However, when communicating between Victron and Fronius, the writes work quickly, so I assume that there is no fault in Fronius. Likewise, writing from Home Assistent to Victron works immediately, so I assume that there is no error in the Home Assistent application either. The problem only occurs in the communication between Home Assistent and Fronius.

Here is the beginning of the Fronius device configuration file, as I have it set up for Home Assistent:

Code:
- type: tcp
    name: Fronius201
    host: 10.130.17.201
    port: 502
    delay: 1
    timeout: 9
    message_wait_milliseconds: 200
    sensors:
    - name: Fronius201_40233_SetPowerOutputToLevel
      slave: 1
      address: 40232
      data_type: uint16
      unit_of_measurement: "Wmax"
      scale: 1
      precision: 1
      scan_interval: 1
      device_class: power
      state_class: measurement
I’ve tried playing around with setting the timeout, delay, and message_wait_milliseconds values, but to no avail.

Here’s the script I use to change the registry values:
Code:
sequence:
  - if:
      - condition: state
        entity_id: input_select.rezim_omezovani_vyroby_fronius201
        state: Manual Power Limit
    then:
      - action: modbus.write_register
        metadata: {}
        data:
          hub: Fronius201
          address: 40236
          slave: 1
          value: 0
      - delay:
          hours: 0
          minutes: 0
          seconds: 3
          milliseconds: 0
      - action: modbus.write_register
        metadata: {}
        data:
          hub: Fronius201
          address: 40232
          slave: 1
          value: "{{ states('input_number.maximalnivykonfronius201') }}"
      - delay:
          hours: 0
          minutes: 0
          seconds: 3
          milliseconds: 0
      - action: modbus.write_register
        metadata: {}
        data:
          hub: Fronius201
          address: 40236
          value: 1
          slave: 1
        enabled: true
alias: Fronius_nastaveni_max_vykonu
description: ""
As I mentioned above, the script works, but it takes about 40 seconds to complete, which is unbearably long. Each write takes about 10-15 seconds, and three writes in total take about 40 seconds.


the process of troubleshooting and integrating systems whether it's improving the responsiveness of a smart home or designing an interior space requires the same kind of patience and attention to detail As Cairenn Foy Interiors emphasizes how important the seamless integration of design elements is to create functional and harmonious spaces. Similarly, ensuring that the "design" of your smart system flows smoothly whether it's reducing Modbus delays or improving how Home Assistant interfaces with your devices can make a huge difference in the overall experience.

Can you please suggest what could be the reason for such a slow write? I would like to point out that I am using the latest firmware versions on both Fronius and Home Assistent.
try to increase message_wait_milliseconds to 500ms or 1s.

or extend delay in your script to 2-5 seconds between writes.

then test Modbus with a lower scan interval for Fronius registers.
 
Top