Enphase Envoy with Energy Dashboard

Would Home Assistant show the correct Return to Grid value?

I dont know what recorder config means.

No, it will show net energy instead of just grid export.

the problem is there is nothing stopping the NET ENERGY number from deceasing at night.
So intead of having a value that only increments or increases, you will have a number that goes up and down.

For example:
if the number increases from 1000 to 1070, you have just exported 70 Wh to the grid.
if the number decreases from 1000 to 950, you have just imported 50 Wh from the grid.

This will not get along well with the energy dashboard as it doesnt like when figures decrease.

My POWER sensors seperate this into two different numbers and only record when it increases.
I dont know how to apply this thinking to lifetime energy figures.

In my HA, I was including only a specific set of entities in the recorder. I read in another post that the sensors used by Energy Management have to be in recorder.

I dont have that in my config and it works for me.
Not sure why someone would say that it is needed.

My posts make no mention of this feature.
If you copy and paste my config exactly how I have written it, it should work.
I dont know how to help with something someone else said in an unreferenced post.

1 Like

With your Solar inverter, it is possible to be doing 3 things all at the same time:
Solar panels producing power. (measured as production)
House consuming generated solar power from the solar panels. (measured as consumption)
House either consuming grid power or exporting grid power (never both at the same time) (measured as consumption)

Visual aid courtesy of Tesla style add on

Grid Export Example
2.1 kW house consumption -
2.8 kW solar production =
-0.7 kW exporting to the grid due to production number being larger than the consumption number

Grid Import Example
1.9 kW house consumption -
0.5 kW solar production =
1.4 kW importing from the grid due to consumption number being larger than production number

The inverter adds both solar consumption and grid consumption together into 1 number.

The grid is only involved in 1 of these 3 above activities.

The reason why we have to use power sensors is because when it comes to the grid, you will never be importing from grid and exporting to the grid at the same time.

This fundamental difference is what lets us calculate grid import and grid export based on inverter power figures.

When you take inverter production in Watts and subtract the inverter consumption in Watts, this will give you either a negative, 0 or positive value. I can manipulate that figure so that home assistant only records positive figures, sort of like a counter. This is how I calculate grid export.

When you take an inverter power consumption in W and subtract inverter power production in W, this will give you either a negative, 0 or positive value. I can manipulate that figure so that home assistant only records positive figures, sort of like a counter. This is how I calculate grid import.

When you do the same with accumulated energy in Wh it does not work the same way due to the negative, 0, positive logic no longer having a meaningful effect.

The statistical sensors require that data be stored to enable the integration to work.

So if people have limited their recorder to only certain entities or domains then the historical sensors and energy integration won’t work.

It’s not necessarily something wrong with the instructions, but it’s a larger issue that would apply to anyone who restricts recording of sensors to individual entities or only certain domains.

1 Like

aha, that makes more sense now.

Ive never messed with the recorder before so i was a bit confused why it was being brought up.

Ok, thank you for your insights. I have to look into this a bit more. I was thinking maybe this would be a simple addition to the envoy_reader API or even just a simple addition only on the Home Assistant envoy sensor code.

The Envoy backend does expose a net-consumption value. I’ll see if I can use that instead.

net-consumption is the same as getting production and subtracting consumption.
It wont work because the number goes up and down rather than just up.

Here is a way to test the logic in home assistant using Developer Tools / Template

{% set production = states('sensor.envoy_SERIALNUMBER_current_power_production') | int %}
{% set consumption = states('sensor.envoy_SERIALNUMBER_current_power_consumption') | int %}

Production = {{ production }}
Consumption = {{ consumption }}
Net = {{ production - consumption }}

Results in Watts (W)

Production = 5781
Consumption = 1986
Net = 3795

Now I do the same with lifetime figures

{% set production = states('sensor.envoy_SERIALNUMBER_lifetime_energy_production') | int %}
{% set consumption = states('sensor.envoy_SERIALNUMBER_lifetime_energy_consumption') | int %}

Production = {{ production }}
Consumption = {{ consumption }}
Net = {{ production - consumption }}

Results in Watt hours (Wh)

Production = 3218663
Consumption = 3116485
Net = 102178

If you press spacebar every minute or so, the figures will update.

So, when you go to Developer Tools / States and type in _current into Entity, what do you get?

image

On my home system I only have Current Production, because my Envoy is old and only supports Production data.

I can load another Envoy that is exposed on the Internet into my development system, and that Envoy has Production and Consumption data.
Screen Shot 2021-08-11 at 8.21.13 PM

Great, now, when you choose etiher, do you get a number show up for each under state like this?

Consumption
image

Production
image

Yeah each one has a value

Thats great news then. Your envoy is recording consumption and production.
At what point did you decide this wasnt going to work?

Wait, you have more than 1 envoy? Im confused now.
Most houses only have 1 envoy.
Which envoy are you showing me in your screenshots that have values for both production and consumption?

I’ll have to play around with it a bit more. Maybe I can get something to work.

I maintain the Enphase Envoy sensor code in Home Assistant (or atleast try to been bust the last few months) just getting back to it now and trying to get the Return to Grid values to correctly appear in Home Assistant.

I have access to multiple Envoys, but only have one at home. The others are for testing :slight_smile:

1 Like

That net-consumption in the backend will most likely be the same as Net Power at envoy.local

image

That’s what I’m hoping for. So I don’t need to worry about any calculations, just pass the value from the Envoy to the API to Home Assistant

Sorry, I am still trying to work out what you are doing and why.
Is this to try and make it work better with the energy dashboard?

1 Like