This is completely wrong. I didn’t export anything, currently my solar production is so low, the house consumes every single bit of energy !
Why does the graph show the purple bars ?!? this corresponds to the exported energy (energy returned to grid) !
Please, can someone tell me what is wrong ? Am I wrong, or is there a bug in the system ?
Thx
Fred
Hi Fred, what is your configuration? I assume you have an Envoy metered with current transformers installed? You can check in the Envoy diagnostics file what the Envoy is reporting. Look for envoy properties, and ct information below it.
You can find the diagnostics button in the device info.
In the raw_data part of the file you can find what values where last received from the envoy, right before the diagnostic file was generated.
If you want to track the raw data over a longer collection period, then enable debug on the Envoy so it will write all data as received to the HA log file.
Hi Arie,
Well, the ct information is correct.
Here the values for all “Lifetime” sensors in HA:
In Enlighten, I’ve this:
So, you see that the total consumption is correct (56.328 MWh).
The total production seems almost correct (34.334 MWh, where Enlighten shows 33.9)
For other values (self-consumption and export), it’s too complicated to check over Lifetime.
So let take yesterday. Enlighten shows me this:
which is 100% since I can double check with my official meter.
BUT, HA shows me this:
The production is somehow correct, but both other values are completely wrong !
I did not export anything (just 0.1kWh), where HA says 3.21. HA says also I’ve a self-consumption of 63% !! That’s wrong too ! For yesterday I’ve between 99 and 100% self-consumption.
I think, what the documentation about what entity to pick for Grid-import and Grid-Export is wrong, and/or the entities are not calculated properly.
There may or may not be something wrong. While you produce more than you use, you might still be returning to the grid. I will explain how and why below. In the Netherlands, and I believe the whole of Europe, energy companies are required to cross simultaneous import and export away against each other, but your envoy might not be doing that.
It all depends on if you have multiple phases coming in your home, and if you have a single or multiphase system. If you have a small installation, chances are it is a single phase Envoy system you have. If your home is having its use divided over three phases, then the phase that the envoy is connected to might be using way less energy then you produce so that phase is exporting, while you simultaneously consume at other phases. Thus exporting on and consuming at the same time. If your Envoy is also three phase, the effect might be less, but still there.
If you have a smart energy meter that reports return to grid, that will likely be balancing the three phases out, so that number should be more in line with what the energy company is supposed to charge for. A single phase envoy is probably only measuring the one phase, so it cannot do that calculation. Home Assistant can’t either, because it is only sampling the data at low rates. It can ot tell what happened simultaneously and what did not.
Last but not least, even on an all single phase system, when production and consumption fluctuate over time, you may be exporting one second and importing the next. So it is always possible to export and import within the same minute.
I have seen battery companies mention that on a well balanced home + solar + battery, about 70% self consumption is not unexpected!
Please, perhaps my English is not fine enough, or I’m not explaining properly, but I can assure you 200% or even 500%, HA and/or the Enphase Envoy Integration is/are wrong.
In France, the Linky is calculating the flow of energy in each phase, and register the sum of them. That means if I “physically” export 1000W on L1, consume 1500W on L2 and nothing on L3, the Linky will charge (increment the consumption index) by 500W (well ok, over x minutes, … no need to go in details between energy and power, I know everything about it).
If I “physically” export 1000W on L1, consume 500W on L2 and nothing on L3, the Linky will increment the export index by 500W.
That’s how it works in France. At any time, the meter aggregates the 3 phases, makes the sum and increment the corresponding index depending on the sign of the sum.
I’ve indeed a 3-phase installation, my Envoy is a multiphase S metered, … everything is fine… except HA !
As you can see, the data provided on Enlighten are correct (I can verify for every single day, it’s all correct) and it matches what my official electricity registers (I read it through a serial connection called TIC, with it I retrieve the consumption index in Wh - that’s what I pay, and the export index in Wh - that’s what I export to the grid = what I produce and not consume).
Let’s see if and how we can find the right numbers. That may be a bit of a search as the HA integration does not have access to all numbers that the Enphase website has :-(. The integration reports data as received from the Envoy, but selecting what to use may need fine tuning and improved documentation.
The balancing that you and @Edwin_D describe is the same and is actually documented for enphase batteries as it was reported in that context. It should be more generic described.
In a recent version of HA we added lifetime balanced net energy consumption (hidden by default) to see if this would help getting more accurate data in some cases. Unfortunately I have no metered envoy so I can’t verify it.
The idea with the balanced value is to use positive changes of the value as import and negative changes as export using 2 sensor templates. These new sensors would then feed the dashboard.
If you’re not into templating let me know and I can get some examples. If needed you can also send me a HA log file with Envoy debug on and I can extract the data and see of it will return the expected values.
It might be best when you register it as a HA issue as well.
Well, I’ve digged a “little” bit more… till the pyenphase module
What the integration does seems to fully match the doc on the pyenphase github.
When in net-consumption mode, the energy_delivered property reports net-energy delivered to your site/received from the grid while energy_received reports net-energy received from your site/send to the grid to the grid.12 When in total-consumption it only reports on the load (house) consumption.
BUT, it seems then, that the envoy is just sending “BS”/inaccurate data.
That leads to the next question… how can Enlighten shows somehow correct data for every single specific day if the data is inaccurate !
Over a period of almost 2 hours, energy_received from the ctmeter_consumption section has increased by 251, which is completely wrong. The official meter export index has increased by only 20 over the whole current day !!
Is there some “huge luck” that something compensates another one ?!? That’s a mystery !
as I mentioned, we don’t know how Enphase internally is acquiring data. We only have access to the data we have access to…
Over a period of almost 2 hours, energy_received from the ctmeter_consumption section has increased by 251, which is completely wrong. The official meter export index has increased by only 20 over the whole current day !!
The envoy meter reports energy_received in Wh, does your official meter too or is it kWh?
What was the change in energy_delivred over that same period?
As for the balanced option you can try something like below:
Template sensors to track grid import export from lifetime balanced net energy consumption .
By default the lifetime balanced net energy consumption sensor is disabled. Enable it to collect the data for it.
if you have already templates defined in your configuration.yaml or a separate file, edit that file. If not yet edit configuration.yaml in the Home Assistant configuration folder.
In there add:
template: !include templates.yaml
Then edit a new templates.yaml file in your configuration folder and paste the template below:
- trigger:
- platform: state
entity_id: sensor.envoy_<sn>_lifetime balanced net energy consumption
not_to:
- unknown
- unavailable
sensor:
- name: "<Grid Energy Import Name>"
unique_id: <Grid_Energy_Import_Unique_id>
unit_of_measurement: "Wh"
icon: mdi:transmission-tower-import
state: "{{ this.state | int(0) + ([0, (trigger.to_state.state | int(0) - trigger.from_state.state | int(0))] | min )}}"
device_class: energy
state_class: total_increasing
- name: "<Grid Energy Export Name>"
unique_id: <Grid_Energy_Export_Unique_id>
unit_of_measurement: "Wh"
icon: mdi:transmission-tower-export
state: "{{ this.state | int(0) + ([0, (trigger.to_state.state | int(0) - trigger.from_state.state | int(0))] | max }}"
device_class: energy
state_class: total_increasing
Replace <Grid Energy Import Name>, <Grid Energy Export Name>, <Grid_Energy_Import_Unique_id> and <Grid_Energy_Export_Unique_id> by the names you want to use.
Save the changed files.
Restart HA
Text above may still contain typo’s and alike, it’s a concept to try
i’ve had the integration working well for the past year and have just started to look at my solar payback details. I was hoping to run some form of calculation on HA that shows the Consumed Solar Energy.
e.g.since installation accordion to the Enlighten app
i’ve produced 10.7mWh
House has consumed 12 mWh
Grid imported 7.2mwh
Batteries charged 4.5mWh
Batteries discharged 3.6mWh
Exported 5.2mWh
Net Imported 2mWh
are you able to help provide any clarity on this. I came across this thread and wondered if the sensor you mention lifetime balanced net energy consumption is going to help with this?
An alternative is to use the SQL integration and query the database. Haven’t explored it in detail from inside HA, still on my list of items to explore.
Thank you Arie
Could you give me a pointer as to what the lifetime balanced net energy is for?
Also which of the envoy sensors I should be using for the energy dashboard, just to double check I’ve got the right ones.
The with regards to how much Solar my house has actually consumed, any ideas on that “:)? I’m not sure the % displayed takes into account any grid to battery charge?
For example the figures I gave above, in my enlighten app it shows just under 1/3 in the pie chart of house consumed energy was blue (solar) whereas the energy dashboard shows 13%
The lifetime balanced net energy is the balance between grid import and export. If the value of it zero, then amount exported is equal to the amount imported. However, this does not tell you how much was actually involved in the import and expert.
To use this balanced value you have to track the changes to it and split changes in positive and negative changes and then sum all positive and all negative to get the actual import and export values.
If you have a net-consumption CT installed it is measuring import and export directly and no need to calculate the changes. If you have a total-consumption CT installed then there’s only the balance net energy to work with.
For batteries kind of the same. With a storage CT you get the charged and discharged values. Without it needs to be calculated from the power flow to the batteries or from change in battery capacity.
I searched for a solution for a long time and I’m now happy with this clean solution.
If this works for you, do not forget to like so other people will find this !