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:
- 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:
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.