I have Envoy ENV-S-WM-230
Gotcha, I was looking through the thread must have missed it!
IT was not meant to put blame on anyone. Only to help others.
Maybe you could add this background info very short in the OP.
No worries. Good idea, just added that now to the Original Post.
@del13r I’m just getting back to supporting the Envoy sensor and have noticed from reading posts (including yours) that Home Assistant needs a third sensor for the Return to Grid value. I’m thinking of adding a sensor that would be the subtraction of the Lifetime Consumption and Lifetime Production values.
I don’t have an Envoy with Consumption CTs but I feel this would work. Let me know your thoughts.
You can test this in Developer tools / template if you dont want to setup a sensor and reboot every time you make a change to it.
I also have lifetime figures.
This will give you a NET ENERGY value
{% set production = states('sensor.envoy_SERIALNUMBER_lifetime_energy_production') | int %}
{% set consumption = states('sensor.envoy_SERIALNUMBER_lifetime_energy_consumption') | int %}
{{ production - consumption }}
however when this difference value starts decreasing at night, the graph will show negative figures and that will mess up the display.
I dont know how to prevent negative figures using lifetime sensors sorry.
My graphs are still empty
I removed all the sensors and the energy dashboard from HA, rebooted, re-added them. I have also ensured that my sensors are in the recorder config (I read somewhere that this is required). Nothing has worked. Oh well! I will revisit this after a few more releases to see things have improved.
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.
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.
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?
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.
Great, now, when you choose etiher, do you get a number show up for each under state like this?
Consumption
Production