Closed wptracy closed 2 months ago
Hey there @bdraco, @cgarwood, @dgomes, @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!
(message by CodeOwnersMention)
enphase_envoy documentation enphase_envoy source (message by IssueLinks)
Hi @wptracy , are you using the lifetime energy production value or the daily energy production
for the energy dashboard. Day values have been reported as less reliable and prone to peaks as you describe so best use the lifetime value if not yet.
@catsmanac ,
I'm using lifetime in the Solar panels section of http://10.0.0.213:8123/config/energy
But I see in the Electricity Grid, Return to Grid section I have Smart Electric Meter Production, which is my lifetime sensor for envoy. So I think I have it right.
Can you upload the HA Enphase Envoy diagnostics file here? Download it from HA and then drag it to below a new comment.
Thanks, @wptracy. I guess this is the same system as the other issue reported.
So it's a Envoy-metered without any connected/configured Current Transformers (CT). When you look at a long-term history plot, like 3-4 weeks (2 or 3 of these 10 day periods) of the Lifetime Energy Production Entity do you see an ever increasing trend or a saw-tooth like shape as below?
When you look at a long-term history plot, like 3-4 weeks (2 or 3 of these 10 day periods) of the Lifetime Energy Production Entity do you see an ever increasing trend or a saw-tooth like shape as below?
Yes, I do see saw-tooth. But my graphs are not as sharp as yours.
Here are the screenshots. June 12 and 14 are the days it says I sent 5000kWh to the grid
Those trends are the smart electric meter production
and not the Envoy <serial> Lifetime energy production
from the Envoy. And since you mentioned the issue also happens with the consumption number, I'm wondering if the issue comes from the `smart electric meter' data collection returning 0 values at those 2 moments.
Here are the smart electric meter production history charts. It's hard to see the saw-tooth, but the saw-tooth is there.
I'll enable the logger: default: debug in configuration.yaml when the sun come up, so we do event correlation with other modules. That's at 5:32, about 2.5 hours from now.
Okay, that last picture is the one I expected, it's resetting to zero when it reaches roughly 1.2MWh. This is a known behavior of the Envoy metered without CT installed. This seems to happen roughly every month in your case, so not the 10 days you refer to.
Envoy <serial> Lifetime energy production
coincides with the peaks in the consumption or production. But I'm starting to have a suspicion that the 'smart electric meter' might be reporting unexpected zero's for production and/or consumption.Here are the meter history reports for "Smart Electric Meter Production" and " Envoy 202321168106 Lifetime Energy production"
The production spikes only come from "Smart Electric Meter Production"
This is my configuration.yaml entry for "Smart Electric Meter"
command_line:
- sensor:
unique_id: xcel_meter_power
name: "Smart Electric Meter Power"
#command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/1/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/1/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '([+-]?[0-9]+)'"
unit_of_measurement: "W"
device_class: "power"
scan_interval: 5
command_timeout: 5
- sensor:
unique_id: xcel_meter_consumption
name: "Smart Electric Meter Consumption"
command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/3/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
unit_of_measurement: "kWh"
value_template: "{{ value | multiply(0.001) | round(3)}}"
device_class: "energy"
state_class: "total_increasing"
#scan_interval: 86400
scan_interval: 5
command_timeout: 5
- sensor:
unique_id: xcel_meter_productiion
name: "Smart Electric Meter Production"
command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/2/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
unit_of_measurement: "kWh"
value_template: "{{ value | multiply(0.001) | round(3)}}"
device_class: "energy"
state_class: "total_increasing"
#scan_interval: 86400
scan_interval: 5
command_timeout: 5
- (Get some sleep first as it seems awfully early or late over there)
These are my normal hours. I get up between midnight and 3AM.
- You can check if the reset to zero of
Envoy <serial> Lifetime energy production
coincides with the peaks in the consumption or production
I don't know how to do this.
Oh wait a minute, I do see what you mean.
No, the reset to zero is not on the 12th or 14th.
Reset to zero occurs and on the 2nd, the spikes occurred on June 14 between 1-2PM and on the June 12 between 6-7AM
My monthly reset is on the 9th of each month.
Here is my configuration.yaml entry for the reset.
utility_meter:
daily_energy:
source: sensor.smart_electric_meter_consumption
name: daily energy
cycle: daily
#cron: "* * 9 * *"
tariffs:
- offpeak
- midpeak
- peak
monthly_energy:
source: sensor.smart_electric_meter_consumption
name: monthly energy
#cycle: monthly
cron: "* * 9 * *"
tariffs:
- offpeak
- midpeak
- peak
Okay, that last picture is the one I expected, it's resetting to zero when it reaches roughly 1.2MWh.
My inverters clip a 330watts.
With 20 panels I can only generate a maximum of 6.6MWh
Looking at all the data I see no other conclusion as that on June 12 and June 14 the xcel_meter_production/Smart Electric Meter Production
either had a failure resulting in a zero value, did not find a value resulting in a zero value or found a zero value.
The Energy dashboard can handle a reset to zero and counting up from zero again, but in this case it went to zero and right back again. And that step from zero back to original value is then interpreted as production.
If there's no way to solve the issue at the xcel source you could filter zero values from the input in the value template or additional template sensor. Maybe something like below.
value_template: >
{% set new_value = value | multiply(0.001) | round(3) %}
{{ new_value if new_value else states('sensor.smart_electric_meter_production') }}
Not well versed in these templates so you may want to try with a test sensor first. This will also prevent it from a legitimate zero as well and hold previous value in that case. If zero can be legitimate you need to devise some other logic.
The energy calculation only occurs for a 1 hour period, for both production and consumption.
I don't know how the calculation is made. Somehow it's using the lifetime counters to calculate this.
The following hour is back normal. I can barely see the previous hour and past hour readings because the lifetime peak production and consumption number push the previous and past reading completely off scale.
My daily and monthly register don't include these counts.
The energy calculation only occurs for a 1 hour period, for both production and consumption.
So these are calculated by the xcel source and only updated 1/hour?
The following hour is back normal. I can barely see the previous hour and past hour readings because the lifetime peak production and consumption number push the previous and past reading completely off scale.
That is indeed the effect if there's a zero right in the middle of the data.
My daily and monthly register don't include these counts.
So these come from the xcel source as well?
Today, it happened again. This time on the Envoy production energy usage.
I think this might be an Energy App problem, not an Envoy App problem.
I didn't have debug turned on.
The false power company consumption reading happened once last November, twice in May, and twice this month. with readings from the power company lifetime consumption meter instead of the power company current consumption meter.
The false Envoy production reading happened 4 times this month. with the readings from envoy lifetime instead of current power production meter. I think the energy app is supposed to get it's hourly readings from the power company current meter reading and not the lifetime reading.
Today, the envoy lifetime meter is reading 1095 kWh
The false Envoy production reading happened 4 times this month.
I have to disagree with this, in my opinion it is: The false power company production reading
The problem lies in the xcel power production data. That shows a huge step. You will have to solve that to get rid of the problem. Look back in history for the values and you see what came in.
It's not the Envoy solar production . In the your pictures,
the value in the solar bubble is solar energy calculated for that day using envoy lifetime energy production. It is 0.3 kWh, even though the bar seems huge, check the scale, it's just 0.3 kWh. If you check history for this there won't be a step.
The values in the grid bubble are the values calculated from the xcel data and these show the huge numbers when the issue happens.
This is no Envoy integration problem and without any debug log file I can't do much more. Even though I expect a debug log to not show any Envoy anomalies I'll be happy to analyze it when you provide it.
As for the energy dashboard, when you find the timestamps of the wrong values and know what the values should be (value from right before it I guess) you can correct these one by one. You can do that in developers tools / statistics, set it to the previous or next value and the Energy dashboard will clean up. At the bottom the correct panel has a outliers
button. If you use that it searches for unexpected values. This may find your issue times and value. It does not solve the root cause, but makes your energy dashboard report correctly again. (See HA Community 493558)
The values in the grid bubble are the values calculated from the xcel data and these show the huge numbers when the issue happens.
I agree with you and that's why I'm saying I think this is an Energy app problem not an Envoy problem.
These readings of 20,000kWh and 5,000kWh are the lifetime register readings that it gets from Xcel Energy smart meter, from my configuration.yaml
How does the energy app calculate each hour on the Energy Bar Graph?
How do Envoy readings figure into the Energy App Bar Graph Calculation?
How does it do the math?
Here is my configuration.yaml
command_line:
- sensor:
unique_id: xcel_meter_power
name: "Smart Electric Meter Power"
#command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/1/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/1/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '([+-]?[0-9]+)'"
unit_of_measurement: "W"
device_class: "power"
scan_interval: 15
command_timeout: 15
- sensor:
unique_id: xcel_meter_consumption
name: "Smart Electric Meter Consumption"
command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/3/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
unit_of_measurement: "kWh"
value_template: "{{ value | multiply(0.001) | round(3)}}"
device_class: "energy"
state_class: "total_increasing"
#scan_interval: 86400
scan_interval: 15
command_timeout: 15
- sensor:
unique_id: xcel_meter_productiion
name: "Smart Electric Meter Production"
command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/2/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
unit_of_measurement: "kWh"
value_template: "{{ value | multiply(0.001) | round(3)}}"
device_class: "energy"
state_class: "total_increasing"
#scan_interval: 86400
scan_interval: 15
command_timeout: 15
n
How does the energy app calculate each hour on the Energy Bar Graph?
The Energy app, when opened, first determines what sensors are configured for solar production and grid im/export.
Then for the period specified e.g. yesterday, it will lookup in history the values for these sensors at the start of the period. Then hour-by-hour it will get the values at the end of the hour, subtract the values at the start of the hour and assign the difference that to that hour.
The value for each hour is then plotted in the bars as well as added to the running change since start of day and shown in the bubbles.
If a value resets to zero inside an hour it will use the value change from start of hour till moment it goes to zero as well as the change from zero to the value of the end of the hour. In this way it can handle sensors that reset to zero every now and then, like monthly or so. Left picture.
If the value resets to zero inside an hour and returns to the original value right after that the energy dashboard assumes a reset and adds the change from zero to the original value as change. The right picture.
It will actually decide it's a meter reset if the new value is less then 90% of the previous one, obviously a change to zero qualifies for that.
How do Envoy readings figure into the Energy App Bar Graph Calculation?
Envoy reading is just a reading as any other. The energy dashboard processes these as described above.
How does it do the math?
The Energy app does the math. The Envoy data is collected from the Envoy and written to the sensor values as received.
Here is my configuration.yaml
I understand that you are reading a value using curl. Many things can happen. What happens if an error occurs, is a zero returned? What happens if the value is being updated when you try to read it? Is the source that creates the value reliable?
@home-assistant close
The problem
Not often, but generally every 10 days, my Energy usage meters say I consumed 20,183.7 kWh in one hour, and sent 4,953.8 kWh back to the grid.
For example, the June 5th screenshot shows I consumed 20,183.7 kWh The screenshot for Jun 14th shows I sent 4,953.8 kWh back to the grid.
These numbers are actually my total lifetime Electric Meter Consumption and total lifetime Envoy Production sensor readings for that time period.
The previous hour readings are wiped out because the new consumption/production reading is way off scale to the previous hours.
What version of Home Assistant Core has the issue?
core-2024.6.3
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
No response
Link to integration documentation on our website
https://www.home-assistant.io/integrations/enphase_envoy/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response