StealthChesnut / HA-FoxESS-Modbus

Home Assistant Modbus Integration setup for Fox ESS H1 and AC Inverters
77 stars 37 forks source link

Question about sensor update frequency #79

Closed benbeton closed 1 year ago

benbeton commented 1 year ago

I have set my sensors with a scan_interval of 5 - 30 sec. However, the values update very differently, often there are some minutes no update, sometimes even up to 25 min. although the values change with the cloud integration very fast.

But since I prefer the solution via Modbus, I would like to find out if this is a normal behavior or if it can be due to a misconfiguration. Here are a few examples. In this case, there was bright sunshine and the battery was charging at about 3 - 4 KW, so the SoC sensor should have changed promptly, but instead there are jumps of ~20%.

My setup

SoC charge state screenshots:

Screenshot_2023-01-17 11 31 39_b2f7MH Screenshot_2023-01-17 11 10 03_KDudbV Screenshot_2023-01-17 10 52 20_UboAcO

SoC sensor config:

- name: "fox_bat_soc"
    scan_interval: 30
    slave: 247
    address: 31038
    state_class: measurement
    unit_of_measurement: "%"
    data_type: uint16
    input_type: holding
    device_class: battery

Modbus config

- name: FoxESS_Inverter
  type: tcp
  host: 192.168.XX.XXX
  port: 502
  retry_on_empty: true
  retries: 3
  timeout: 5
  close_comm_on_error: false

in the same time template sensor (pv1_power & pv2_power) has delivered timely data:

Screenshot_2023-01-17 11 18 39_86Y794 Screenshot_2023-01-17 10 57 16_duiaxh

so it looks like the inverter is providing data but very different in time, is there any explanation or way to change this? I would like to have as accurate data as possible

regards

williamjeccles commented 1 year ago

What poll rate do you have set on the USR converter? Likely HA is asking the USR for updates every 30 seconds but the modbus settings on the USR are set with a slower polling rate.

benbeton commented 1 year ago

this is my current polling config on the USR:

image
benbeton commented 1 year ago

seems to be fixed, after I set the scan_interval: to 30 (lowest up to 90 highest) instead of 15