The net sensor should be positive when importing from and negative when exporting to grid. I don’t recommend changing the net sensor in my solution as that will have a knock on effect on the other template sensors we need.
If you have grown accustomed to it being the other way around for some reason, you can create another seperate sensor that will invert the polarity of the power net sensor.
Example
template:
- sensor:
name: Power Net Inverted
state_class: measurement
icon: mdi:transmission-tower
unit_of_measurement: W
device_class: power
state : >
{{ (states('sensor.power_net') | int(0) * -1) }}
Hm, so I just got word back from my installer about the consumption meter install location - sounds like my electric company required the solar connection to be on the utility side of the meter, which lead to the situation I’m in. Any idea if I could derive Energy export in any other way?
Anytime you are producing more solar than your house load, we can assume you will be exporting the difference.
Production-Consumption=
Is it a positive number?
If yes, then record it as power export=
2260-995=1265 (your actual figures)
Anytime your house load is more than the solar panel output, we can assume you will be importing the difference.
Consumption-Production=
Is it a positive number?
If yes, then record it as power import=
4000-500=3500 (generic example)
As shown here, your envoy is doing this in the interface
So for load only users, we have some gaps to fill.
For power, the questions I have are, do any of these following numbers show a negative figure either at night or in the day?
Source: /ivp/meters/readings
value_json[0].activePower = Power Production
value_json[1].activePower = Power ?
For energy, the questions I have are, do any of these following numbers behave unlike an odometer and decrease over time either at night or in the day?
value_json[0].actEnergyDlvd = Energy Production
value_json[1].actEnergyDlvd = Energy ?
value_json[1].actEnergyRcvd = Energy ?
Currently only interested in these eids.
Not interested in the 3 phase “channels” yet.
The value from .meters.grid.agg_p_mw appears to be the same value from what I can see w/in the enphase app for instantaneous power export. For example, the app shows I’m exporting 5.2kW and the value from the api is -5189354. If so, unless I’m mistaken, I might just be able to use that?
Yes, value_json[0].activePower = Power Production does appear to show as negative when the panels aren’t producing at night (and I’m importing power) value_json[1].activePower = Power ? - this number has been going up and down throughout the day/night.
value_json[0].actEnergyDlvd = Energy Production - this is increasing throughout the day, until evening started and the number stopped increasing. value_json[1].actEnergyDlvd = Energy ? - only increases throughout the day. value_json[1].actEnergyRcvd = Energy ? - only ever reads 0
If it helps, I did capture screenshots of the app as well as output of the following throughout the day, lmk if you want me to post this as well.
@del13r for some of the numbers that you’re able to get from the API, it looks like you’re also able to confirm they’re correct by looking at the web UI at the same time. Are you able to view Energy Export anywhere in the web UI? I really have no idea what my lifetime energy export on the system is, and I don’t see it listed anywhere that I can tell, but wanted to see if your different CT install location lead to a different result in the way its displayed in the web. Thanks!
I am wondering if it is a firmware issue. I am trying to avoid using a Reiman integral sensor and use the approach here. My firmware is 7.3 where OP has 7.6. Also my CT clamps are different the OP, leading to needing differnet fields
the other values are zero. This is not enough to calculate energyExport. Seems like what is happening for you. Not sure if this is a CT clamp issue or a firmware issue.
I am also working on a simple integration to get all this information, so do not need to setup all the sensors individually. I will post once I figure everything out. It takes the token and returns the above information and optionally the inverter info. However, without the lifetime export sensor, no real advantage over @briancmpbll integration (which I currently use and works fine with the new token).
Thanks for this. I will check this out once I get back to my laptop. Just stuck in a hospital for a few days at the moment so my reply might take a while is all.
Thanks @jaaem - my envoy is also on 7.3, how is your consumption CT setup, is it Load with Solar production or Load only? What you’ve said is exactly my situation, so that’s an interesting data point.
Has anyone noticed lifetime import numbers are slightly off when using the new sensors based on actEnergyDlvd? All my midday hourly numbers now have small bits of imported energy. Previously (using one of the HACS integrations), I never saw that at all, and my Enlighten data is also showing zero imported energy (and anecdotally, it has been 100% sunny without a single cloud in the sky.)
It looks like the import energy sensor is creeping up slightly throughout the day during the time where there appears to be zero imported usage according to my other data sources. Could it be related to the Wh to kWh conversion and rounding (since you essentially lose a lot of precision with that operation)?
From my perspective, this is correct and I do not see any problem.
The Wh to kWh conversion is simply done by dividing by 1000. All this does is move the decimal place over by three digits. The accuracy is still retained on the other side of the decimal point.
If you are unhappy with the precision of the Wh to kWh, feel free to use a higher round(X) number or even just removing the round(X) from the sensor will make it as accurate as possible with the data available.
Personally, I was happy with the results using round(2).
My details below. I do not have installer access, but the nice people on enphase live chat told me I was “load only”. So seems we are in the same boat. A Reiman sum integral works ok. However, the app knows the import/export and I doubt they are running an integral on our data, so the system must run one locally. Maybe latest firmware will allow access to this. The live chat people are super quick, I guess I could ask them for a firmware update and see if that helps.
Part Number 800-00695-r01
Software Version D7.3.130 (91f206)
Software Build Date 22 Jun, 2023 5:43 AM
This is not true, the metered versions are expected to, but the standard version of the Envoy solely relies on the values provided by the inverters (at the expense of 5% accuracy loss). Metered versions can be installed without clamps, but then essentially function as the standard edition.
Thanks, appreciate the confirmation. I chatted with them this morning and said I was suspicious there was a bug in the version i was on, they a very hesitant to upgrade firmware, I can’t imagine how shitty their release/testing process is, i pushed over and over and they kept saying that they don’t upgrade them unless there are real issues because they’ve seen solar production issues when upgrading in the past.
Thanks for the info! Digging a bit deeper, I found that the Enlighten dashboard/calcuations appears to be what is actually off. For the data gathered yesterday (my prior screenshots), the net values from my utility company actually match the graph almost exactly. E.g. from 12pm-1pm, the utility recorded a net value of -1.17 kWh, and the hass energy dashboard reported exports of -1.37 kWh and imports of 0.22 kWh, for a total of -1.15 kWh.
I guess the resolution at 15 seconds might miss out on some tiny spikes that do eventually add up to be ever so slightly visibile You can see in my second screenshot that the lifetime energy import ticks up a few times (20 Wh), but the consumption remains under production, and power import remains zero.
Given that what my utility sees correlates with the net values reported in the energy dashboard, it really seems like a resolution/sampling rate type of issue. In the end, it accounts for almost nothing, but I guess psychologically it looked nicer not seeing any blue caps on my bars
No, the only thing is my HVAC (3.5 tons). It uses about 3.5kW, and my solar at peak generates about 3.5-3.7 kW. Maybe the initial compressor activation pulls a bit more to spin everything up. The only times I see the creep is while the AC is going.
If your consumption ct is set to any other measurementType, then I assume my template sensors will not calculate correctly and another solution will need to be found for “load only” users