GithubHelp home page GithubHelp logo

Comments (7)

jimmyz80 avatar jimmyz80 commented on August 17, 2024

Also here are a couple of screenshots from the Enphase Enlighten system showing my meters are both set up and working. Although now that I look at these I'm seeing that the consumption meter is installed as "load only" which your docs explain will omit the "net" entities.....dang! Is this really a limitation on supporting these, or just a preference? There was no way for us to physically instal the CTs in load with solar mode, since my combined meter/breaker panel doesn't have a space to place the CTs in such a location.

Screenshot 2024-02-21 at 9 37 13 AM Screenshot 2024-02-21 at 9 38 16 AM

from home_assistant_custom_envoy.

catsmanac avatar catsmanac commented on August 17, 2024

Hi @jimmyz80, looking at your data in the "envoy_info": section I see that the consumption CT is configured as total-consumption. (measurementType) The integration expects a net-consumption type to report grid import and export. (See also 180)

"Endpoint-meters": [{
        "eid": 704643328,
        "state": "enabled",
        "measurementType": "production",
        "phaseMode": "split",
        "phaseCount": 2,
        "meteringStatus": "normal",
        "statusFlags": []
    }, {
        "eid": 704643584,
        "state": "enabled",
        "measurementType": "total-consumption",
        "phaseMode": "split",
        "phaseCount": 2,
        "meteringStatus": "normal",
        "statusFlags": []
    }
],

That's why the "CTs consumption data not available for your Envoy device." is showing. So the first question is if the consumption CT is indeed a total-consumption one or a net-consumption one.

from home_assistant_custom_envoy.

catsmanac avatar catsmanac commented on August 17, 2024

Looking at
afbeelding
it is indeed a total-consumption one as indicated by load-only.

from home_assistant_custom_envoy.

catsmanac avatar catsmanac commented on August 17, 2024

Is this really a limitation on supporting these, or just a preference?

Unless we can find a recipe how to calculate from the 2 other CT's or the other data, its a limitation.

This is an excerpt of the CT meters readings

"Endpoint-meters-readings": [{
        "actEnergyDlvd": 12209702.219,
        "actEnergyRcvd": 1697.711,
        "activePower": 5335.441,
    }, {
        "actEnergyDlvd": 9779697.983,
        "actEnergyRcvd": 111.852,
        "activePower": 2201.690,
    }
]

First one is the production CT, second the total-consumption. For production CT actEnergyDlvd is from solar to switchboard, actEnergyRcvd the other direction. The 12.2MWH seems to match the Enphase screenshot.

For total-consumption CT actEnergyDlvd is to the house, 9.7MWh. But we just don't know how much of the solar went into the house or to the grid. And the number differs quite a bit from the 11MWh in your screenshots.

from home_assistant_custom_envoy.

jimmyz80 avatar jimmyz80 commented on August 17, 2024

Back to clarify a few things and add a few thoughts... :)

This is indeed a load-only consumption CT. It's installed around all of the load wires exiting the panel to circuits in the house (other than the solar backfeed circuit).

For total-consumption CT actEnergyDlvd is to the house, 9.7MWh. But we just don't know how much of the solar went into the house or to the grid.

I think the "we" here might be the key. The Envoy certainly does, since at any given time it just needs to subtract the solar CT from the consumption CT. Anything negative is the current net kW being imported and anything positive is the net kW being exported. I can see it doing this in realtime on my status screen.

Screenshot 2024-02-21 at 2 32 38 PM

I can also see the same thing in HA just by calculating this difference between envoy_current_power_consumption and envoy_current_power_production.

So over the lifetime of the system a simple difference between production and consumption will give you the lifetime net import or export. Enphase agrees with this on my lifetime data screen, where I can see 12.2MWh produced minus 9.7MWh consumed = 2.4MWh "net exported".

Screenshot 2024-02-21 at 2 25 18 PM

The "imported" and "exported" numbers on that screenshot through I believe are calculated internal to the Envoy using its database of historical datapoints for either importing or exporting (every 15min?, 1min?, whatever granularity they use for the internal DB). For clarity I would call these total export and total import because again when you calculate their difference you end up at my net export value. 8.6MWh Total Export - 6.2MWh Total Import = 2.4MWh Net Export. In any case, I don't believe these figures would be available externally in either of the CT setting modes.

It seems to me that the integration could fill in sensor.Envoy_current_net_power_consumption just by computing the difference between envoycurrent_power_consumption and envoy_current_power_production. That's what the Enphase software has to be doing when the CT is in load-only mode (not sure why they only use it internally and don't expose it on the API though...). The Envoy just doesn't have to do this math when the CT is in load-plus-solar mode since then it can read that value directly by virtual of "mechanical calculation" of electrons flowing in both directions through a single CT.

Similarly for:

sensor.Envoy_<sn>_lifetime_net_energy_production
sensor.Envoy_<sn>_lifetime_net_energy_consumption

It seems like you would only ever have data in one of these but not both if they're truly "net", correct? I obviously can't see them on my setup so I can't compare to the Enphase values. But by seeing the word "net" in them I would expect to see sensor.Envoy_lifetime_net_energy_consumption be zero and sensor.Envoylifetime_net_energy_production be 2.4MWh. If instead they ended up being populated by 8.6MWh and 6.2MWh that I earlier referred to as my TOTAL export and import, that seems like an error to me. "Net" would mean the difference calculation has been completed and you ended up with a single positive or negative number which would dictate whether it's written into sensor.Envoylifetime_net_energy_production or sensor.Envoy_lifetime_net_energy_consumption and the other would be zero. Otherwise they're just totals of any detected periods of exports or imports, NOT yet netted out.

Sorry about this being so long winded, and hopefully I was able to articulate things in a somewhat clear fashion. :)

from home_assistant_custom_envoy.

jimmyz80 avatar jimmyz80 commented on August 17, 2024

Not entirely relevant to my original topic, but I'm attaching a file that seems to confirm my above hunch that internally the Envoy was using 15min snapshots to create their total export and total import values for any window of time. This was exported from the Enphase Enlighten app. Notice that in every row there's only ever a value in the exported OR imported column but never BOTH. So they just take the production and consumption totals for a 15min window, compute the difference, and then determine if the result goes into the import or export column by checking if the result is positive or negative.

So this total import/export data is clearly something the integration can't provide unless the Enphase API does the math and exposes these totaled up for any given window of time. But I still feel the lifetime NET import and export data, and current net consumption could be provided as I described in my previous post.
4395521_monthly_net_energy_report.csv

from home_assistant_custom_envoy.

catsmanac avatar catsmanac commented on August 17, 2024

I think the "we" here might be the key

Yes you are right. The envoy pushes a blob of data every so often for 15 min time periods and it buffers it if there's network issues. We, mere mortals, can't access that blob.

I can also see the same thing in HA just by calculating this difference between envoy__current_power_consumption and envoy__current_power_production.

We're talking power now, and yes, the diff between sensor.envoy_1234567890121_current_power_production and sensor.envoy_1234567890121_current_power_consumption is sensor.envoy_123456789012_current_net_power_consumption.

  • You can make this calc in HA using a template
  • Looking at the code it's not overly complicated to do this, but you would need to supply datasets I can use for this case and regression testing
  • What is not 100% clear is if these values are snapshots or represent the average of a time interval.
    • The individual inverter data seems to be a Wh average for a 5 min interval calculated every 5 min
    • The current_power_production and current_net_power_consumption come from the production report and may be similar, but I'm not sure. We need to validate this.
    • Using CT numbers may be just snapshot, so collecting these ever 1 minute may be inaccurate.

Back to Energy, That is internally in the Envoy integrated from the powers and calculated. As for 'we ...', we have no reference. If solar produced 12 and the house used 9 then any import/export value pairs that account for 3 net export up to max import of 9 would meet the numbers.

house solar import export
9 12 0 3
9 12 1 4
9 12 2 5

Haven't delved through all other reports if we can find a reference. That's take some time.

Not sure if I addressed all your items. In summary your are right net power can be calculated and net energy can't unless we find some reference in existing reports. (the endpoint... lines in the diagnostic lines, or for multiple sets run with debug enabled over HA restart and couple of minutes)

from home_assistant_custom_envoy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.