StealthChesnut / HA-FoxESS-Modbus

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

Grid Consumption Accuracy #15

Closed StealthChesnut closed 2 years ago

StealthChesnut commented 2 years ago

Issue with grid accuracy: https://www.facebook.com/groups/foxessownersgroup/permalink/1577479335967576/

"For the last two days I've seen some funny values in my HA energy dashboard. Todays usage, for example, shows we've imported 5kWh from the grid when using the grid_daily sensor for the Grid consumption. But if I change that to use the Hildebrand Glow integration I only see 0.6kWh of consumption. Yesterday was similar, and Octopus, Glow and even FoxEssCloud all seem to agree on consumption. It's just the grid_daily sensor that is wrong."

StealthChesnut commented 2 years ago

Checking my own figures, HA seems to be about 10% down (for grid consumption) vs what Octopus reports that I've used: HA - Octopus (kWh) 3.2 - 3.5 3.9 - 4.3 2.6 - 2.9

The integration sensors should be using trapezoidal as the default method. HA docs recommend "left" for "spiky consumption" devices, which you could argue a lot of these sensors are? https://www.home-assistant.io/integrations/integration/

Daibutt commented 2 years ago

Yes there's soemthing definitely odd with some of the integration sensors. My battery discharge sum and daily both jumped by ~6kWh when I put kettle on. Battery discharge power had been zero prior to that for a few hours as battery was charging from PV. I was wondering whether it's because some of the inputs are at exactly zero for long periods and then suddenly "jump" into action. I would have thought the integration sensor would be able to handle that but maybe not?

I'm giving this a try; Create a sensor with a random 1-10 watts;

- platform: random
  name: random_watts
  minimum: 1
  maximum: 10

And in battery discharge sensor I'm using that instead of zero;

- platform: template
  sensors:
    battery_discharge:
          friendly_name: "Battery discharge"
          unit_of_measurement: 'kW'
          device_class: power
          value_template: >
            {% if (states('sensor.battery_discharge_power') | float ) > 0 %}
            {{ states('sensor.battery_discharge_power') | float * 1 }}
            {% else %}
            {{ states('sensor.random_watts') | float / 1000 }} 
            {% endif %}

Will let you know if that improves things!

Captain0Kangaroo commented 2 years ago

I'm seeing some odd numbers for grid use.

Both export and import are being lumped together in the energy flow data. It use to show up as separate figures with a flow going back out for export.

image

image

Daibutt commented 2 years ago

Did you add it to the corect part of the dashboard as Return? Both your values are blue so it looks like it's seeing them both as consumption. image

Mine shows return/export as purple; image

Captain0Kangaroo commented 2 years ago

I literally just spotted it as you replied!

Totally my bad.

williamjeccles commented 2 years ago

Marking as resolved.