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
71.16k stars 29.83k forks source link

Envoy Lifetime Net Energy: Wrong Values #123071

Closed FabFaeb closed 1 week ago

FabFaeb commented 1 month ago

The problem

Hi all (and probably @catsmanac ;P), I am currently playing around with the envoy integration for my newly installed enphase system. While doing so, I noticed that the values for Envoy Lifetime net energy consumption and Envoy Lifetime net energy production seem far off when compared to the values in the "Enlighten" app. Here is an example from yesterday: Enlighten reports 0,7 kWh grid consumption and 10,2 kWh grid production. (sorry for the german language in the screenshots - I'd be happy to translate anything for you if there are questions) grafik

While Homeassistant reports 7,8 kWh grid consumption and 17,1 kWh grid production (which is definitely far too high): grafik I have noticed that the values for "solar production" (18,9 kWh) and the "grid overall" value (9,28 kWh in Homeassistant and 9,5 kWh in Enlighten) seem to be correct and unaffected from this issue.

The energy dashboard values are set as described in https://www.home-assistant.io/integrations/enphase_envoy/#energy-dashboard. I have attached the diagnostics data of the Envoy-S-Metered-EU Gateway device (running firmware D7.6.358) from Homeassistant.

Do you have any idea where this could be coming from? Could it be possible that the consumption CTs are set to "NET" when they really should be set to "TOTAL"? But why do the Enlighten Values seem to be correct then?

Thanks in advance FabFaeb

What version of Home Assistant Core has the issue?

core-2024.7.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

enphase_envoy

Link to integration documentation on our website

https://www.home-assistant.io/integrations/enphase_envoy/

Diagnostics information

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 month ago

Hey there @bdraco, @cgarwood, @joostlek, @catsmanac, mind taking a look at this issue as it has been labeled with an integration (enphase_envoy) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `enphase_envoy` 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 enphase_envoy` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


enphase_envoy documentation enphase_envoy source (message by IssueLinks)

catsmanac commented 1 month ago

Hi again @FabFaeb, what you are seeing is the result of 3 phase installations transferring energy between phases by exporting and importing to the grid. This is more a virtual transfer as the phases are separated and there is no way to transfer between them.

So when you are running on battery and one of the phases (say phase L1) needs more energy then the battery can provide on that specific phase, while it has energy available on another phase (say phase L2) this virtual transfer takes place. The battery will export to the grid on phase L2 the amount that it is missing on phase L1. And the phase L1 will pull that energy from the grid. In this way the energy seems to have transferred from L2 to L1. As a result the CT on L1 and L2 measure the exported and imported energy that was virtually transferred and the result is the values are too high.

Your official grid meter is balancing these amount as many EU countries have Summierender Zähler in the grid meters. You don't pay for these transfers. The Envoy CT though doesn't do this balancing.

Thanks to @Hoffmann77 (https://github.com/briancmpbll/home_assistant_custom_envoy/issues/195#issuecomment-2094697886) explaining the issue. He proposes to use the active current and Riemann integrator to calculate import/export. There is also a description on how to use the current in the coomunity

I'm also in the process of adding a lifetime balanced grid import export entity to home assistant which is the sum of import and export. That then can be used to calculate import/export using positive and negative changes much like we did for calculating the battery values the other day (#121988). That would eliminate these double counts using automation and templates.

FabFaeb commented 1 month ago

Hey @catsmanac - thanks for the quick response! That absolutely makes sense, thanks for helping me understand. I look forward to your addition of the lifetime balanced grid import export entity! :) By the way - is there a community discord/slack or anything similar for the enphase-homeassistant community or pyenphase?

catsmanac commented 1 month ago

By the way - is there a community discord/slack or anything similar for the enphase-homeassistant community or pyenphase?

Not specifically for enphase. It's one of the Home Assistant integrations and basically covered by the HOme Assistant community and discord. Issues can be reported for the HOme Assisatnt Integration or if pyenphase specific in the pyenphase github.