home-assistant / home-assistant.io

:blue_book: Home Assistant User documentation
https://www.home-assistant.io
Other
4.96k stars 7.27k forks source link

Envoy Enphase paramaters not compatible with HA long term statistics #18816

Closed vdelab closed 3 years ago

vdelab commented 3 years ago

Feedback

Hello,

having moved recently to the version 2021.8 of HA, there is the new page about Energy synthesis and also the capability to have some long term statistics used.

But when willing to select the adequate data from Enphase, it is not proposed. There is only "Envoy Lifetime Energy Consumption" and "Envoy Lifetime Energy Production", but not the instantaneous ones... Also, the inverters (I have 6 mini-inverters on my system) individual data (as a direct solar production would be useful but do not appear. It seems that "You’re configuring a statistic but you couldn’t find your source in the dropdown? That’s caused by a bug in the integration providing the entity. Integrations need to configure their entities correctly so Home Assistant knows that we need to track statistics for it and how."

and it directs to the link below : https://developers.home-assistant.io/docs/core/entity/sensor#long-term-statistics.

If this could be considered in a future evolution of this very useful integration. Sincerely,

URL

https://www.home-assistant.io/integrations/enphase_envoy/

Version

2021.8.3

Additional information

No response

probot-home-assistant[bot] commented 3 years ago

Hey there @gtdiehl, mind taking a look at this feedback as it has been labeled with an integration (enphase_envoy) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

FalconUK commented 3 years ago

The energy calculations currently work with 'meter' values that always increase. The statistics functionality creates a time series from the updating value. So it's not ideal, but it does work.

I've 12 microinverters which I show on a normal graph, with much more frequent updates, so I know what you mean.

Aeirlest commented 3 years ago

When I had a little bit of a dig into the files used to generate the entities of the enphase integration (Of which only 2 exist that can be used on the energy dashboard) the only difference between the ones selectable and the ones not selectable is the last_reset() which exists on the ones that can be selected for use on the energy dashboard. By creating a janky utility meter that has the unit of measure "kWh" and a resetting cycle (daily/weekly/monthly etc) that causes a reset you can use those for the energy dashboard. Please see difference between sensors below.

SENSORS = ( SensorEntityDescription( key="production", name="Current Power Production", unit_of_measurement=POWER_WATT, state_class=STATE_CLASS_MEASUREMENT, ), SensorEntityDescription( key="daily_production", name="Today's Energy Production", unit_of_measurement=ENERGY_WATT_HOUR, state_class=STATE_CLASS_MEASUREMENT, device_class=DEVICE_CLASS_ENERGY, ), SensorEntityDescription( key="seven_days_production", name="Last Seven Days Energy Production", unit_of_measurement=ENERGY_WATT_HOUR, state_class=STATE_CLASS_MEASUREMENT, device_class=DEVICE_CLASS_ENERGY, ), SensorEntityDescription( key="lifetime_production", name="Lifetime Energy Production", unit_of_measurement=ENERGY_WATT_HOUR, state_class=STATE_CLASS_MEASUREMENT, device_class=DEVICE_CLASS_ENERGY, last_reset=dt.utc_from_timestamp(0), ), SensorEntityDescription( key="consumption", name="Current Power Consumption", unit_of_measurement=POWER_WATT, state_class=STATE_CLASS_MEASUREMENT, ), SensorEntityDescription( key="daily_consumption", name="Today's Energy Consumption", unit_of_measurement=ENERGY_WATT_HOUR, state_class=STATE_CLASS_MEASUREMENT, device_class=DEVICE_CLASS_ENERGY, ), SensorEntityDescription( key="seven_days_consumption", name="Last Seven Days Energy Consumption", unit_of_measurement=ENERGY_WATT_HOUR, state_class=STATE_CLASS_MEASUREMENT, device_class=DEVICE_CLASS_ENERGY, ), SensorEntityDescription( key="lifetime_consumption", name="Lifetime Energy Consumption", unit_of_measurement=ENERGY_WATT_HOUR, state_class=STATE_CLASS_MEASUREMENT, device_class=DEVICE_CLASS_ENERGY, last_reset=dt.utc_from_timestamp(0),

What I have also discovered through this whole thing is that enphase "Consumption" and "Production" are Gross values. That is to say that the consumption displayed is inclusive of production. Likewise with production, it is gross, displaying total generated not how much was consumed internally and/or exported back to the grid.

It has meant I've had to create some custom sensors via templating and math etc to achieve what should realistically be easily integrated into the system.

If you use the energy dashboard using the gross values you will notice that without a statistical sensor with units of measure 'kWh" and last_reset() defined being used as a "return to grid" sensor, all production is attributed as being consumed.

This leads the energy dashboard to display Your consumption from the grid (Already grossed thanks to the enphase integration entities being made available to include grid and self generation consumption) and your production (Gross generation including what you sent back to the grid...thanks again enphase integration) as being consumed by your dwelling.

I've created custom Gross and Net instantaneous production and consumption sensors as well as custom gross and net utility meters that allow me to feed the net energy consumption to the energy dashboard for consumption however because there is no way to pull the extra detail of how much was exported back to grid from the enphase integration, there is always the assumption by the energy dashboard that 100% of generation was consumed...leading to an error between the enphase unit and app to the energy dashboard by the amount exported back to grid (Instead being applied back to home consumption).

The end result on the energy dashboard is net consumption (Gross Consumed - gross generation) + gross generation = total consumption with no export to grid.

While I suppose it is no big deal, it does mean that when you are exporting to the grid due to excess generation, and when you are importing from the grid (During no generation) that isn't captured accurately.

When you are paying $0.26/kWh you consume from the grid vs being paid $0.08/kWh for generation back into the grid it throws off any kind of $$$ calculations you may be running.

Anyone wanting to use the custom utility meters or sensors below is the extract from my sensors.yaml for you.

xxxxxxxxxxxx should be your envoy serial number and your device probably won't have the "system" bit after the xxxxxxxxxxxx since I edited the device name after the envoy integration had finished.

Envoy Sensors - Instantaneous

Envoy Sensors - Daily

frenck commented 3 years ago

Hi there @vdelab 👋

It seems like you want to report a bug with a Home Assistant integration, however, you have submitted documentation feedback instead.

Please report issues with Home Assistant integration here:

https://github.com/home-assistant/core/issues

Thanks 👍

../Frenck

vdelab commented 3 years ago

Hello, thanks a lot, Aeirlest, for your inputs and the sharing of your sensors. I think this will address my question for now and allow to define more relevant sensors for an actual energy follow-up.

Frenck, I have nothing against closing the remark, however, I do not undertand what you mean but it being more a bug on the Integration Core rathan than a bug on the Enphase integration itself (not aware I was using the documentation remark area).

Indeed as far as I understand, it is more a bug than a description/documentation issue, but why pointing to bug reporting on HA Core? Isn't there a bug reporting area on the Enphase integration itself (where the sensors are actually defined) ? This was my intent. I was trying to get in touch with the integration designer...

Thanks all for your help.

frenck commented 3 years ago

but why pointing to bug reporting on HA Core?

Because it is an integration provided by the Home Assistant Core.