Energy Configuration in 2021.8.3+

I am not sure what’s wrong but trying to get my house’s energy data into the new Energy panel.

Firstly when I clicked on the Lightning bolt to set it up the only entity that was available was the “Envoy Lifetime Energy Production” for both the generation and consumption.
I know that it’s wrong but this is what it looks like

This is what is currently displayed and of course it’s nonsense because the two entities are the same.

This is what I have in my configuration.yaml for my Envoy (old style) and I have Efergy using a CT in my switchboard to measure consumption.

  - platform: enphase_envoy
    ip_address: 192.168.0.xxx
    monitored_conditions:
      - production
      - daily_production
      - seven_days_production
      - lifetime_production
# Efergy
  - platform: efergy
    app_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    utc_offset: 600
    monitored_variables:
      - type: instant_readings
      - type: budget
      - type: cost
        period: day
        currency: $
      - type: amount
        period: day
      - type: current_values
#
# PVOutut
# PVOutput only queried every 60 seconds. 
# 
  - platform: pvoutput
    system_id: nnnnnn
#    name: HomeEnergyGen
    api_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    scan_interval: 300
  - platform: template
    sensors:
      power_consumption:
        value_template: >
          {% set pc = state_attr('sensor.pvoutput', 'power_consumption') %}
          {{ '0' if pc == 'NaN' else pc }}
        friendly_name: 'Using'
        unit_of_measurement: 'Watt'

      energy_consumption:
        value_template: "{{ '{:.1f}'.format(state_attr('sensor.pvoutput', 'energy_consumption')|float/1000) }}"
        friendly_name: 'Used'
        unit_of_measurement: 'kWh'

      energy_generation:
        value_template: >
          {% set eg = state_attr('sensor.pvoutput', 'energy_generation') %}
          {{ '0' if eg == 'NaN' else '{:.2f}'.format(eg|float/1000) }}
        friendly_name: 'Generated'
        unit_of_measurement: 'kWh' 

I know all the monitoring works as it now goes to PVOutput.org

And this is the data in my HA using a HA Lovelace History Card
image

I tried changing the Device class to energy in Customization but that did not do anything.

I am guessing that the integrations
Efergy
PVoutput might need some attention

Thank you

After considerable searching I came up with some hints in this post

I got my Efergy to list using this customization

sensor.efergy_3420:
  last_reset: '1970-01-01T00:00:00+00:00'
  device_class: energy
  unit_of_measurement: w
  state_class: measurement

I will have to wait the 2 hours now to see what happens to panel.

unit_of_measurement: w is for power sensors, energy sensors should have kWh.

I am having difficulty understanding how all this works.
I get how “w” is for the sensor because that is what is it measuring in the CT
However when “kWh” is used my understanding is that kWh is the use of Watts over time expressed in Kilowatt Hours.
My solar entity
image
is in Wh
But the Efergy is
image
Solar
image

Should they not be the same???

The numbers add up for the Envoy even if the Entity_ID is wrong. The Entity used is named Lifetime Solar which is 43.1MWh
This is from my Enlighten screen
image

From my EnergyHive (Cloud name for Efergy)

Energy Panel in HA for yesterday 8/8/21

From the Energy Usage graph I don’t understand how there can be Energy Returned?

I have just updated HA to 2021.8.4 @ 05:44hrs (there is no BLOG to tell me what it does though).


Things I noticed

  • the Energy Distribution solar does not have a moving dot where as it did last night when no sun.
  • the Energy usage is at least showing consumed and no returned.

    Don’t get me wrong I think this Energy Panel is a great thing but how to use it ? Very sketchy on detail.

UPDATE
One of the things I do to ensure the accuracy of my data on energy is I have a RPi in my switchboard that takes a photo of the Energy Meter 4 times a day and then can check this against my CT clamp on Efergy.

Thanks @rontaylor : I set the sensor under customization as you suggested but nothing appears on the graph… If I set the unit to kWh it works but with wrong values : now I set it to Wh and let see if it works !.
Thanks !

Yes You are correct.
I get correct data for the solar generation but wrong for consumption.
I think I might wait a bit to se what updates come out as it’s very wrong at the moment. I think the assertion that all the energy integrations were tweaked might be a bit off!
This is what the values should be but I can’t find a way to use this in the Energy panel

1 Like

You don’t have a unit_of_measurement. If you can’t add it to your current sensor, create a template sensor.

Hi,

I think that there is something missing in our configuration using EFERGY !

Efergy sensor, as wrote by @Burningstone takes measurements in W not in W per hours so I think we need to “translate” the sensor values to Wh or better to kWh … Using “intagration” sensor it is possible but I don’t know how then integrate it in HA ENERGY…

There was an issue raised on the efergy integration and a PR has already been created.

I am testing the updated version and it is working for me.
Also make sure you configure a sensor of type amount, that will give you Energy in kWh

platform: efergy
app_token: !secret EFERGY_TOKEN
utc_offset: 600
monitored_variables:
    - type: current_values
    - type: instant_readings
    - type: amount
      period: day
    - type: amount
      period: month

thanks @datamonkey .

is the PR already present in 2021.8.4 update ?

Let’s try to set the sensor as you suggest.

no, it hasn’t been merged.
You can setup the efergy integration as a custom component and test it that way.
Get the code from the PR

this is also described in the issue here:

I am testing the Efergy PR and find that this integration is reporting a different (approx 4 kWh HIGHER) than my PVOutput.org account and it uses the same data from Energyhive.org or Efergy

This was yesterdays (16/8/21 )HA Energy dashboard

This is from my PVOutput

This is the dashboard of energyhive.com

I am not sure if I am reading the energy dash correctly

Looking at today’s data

Consumption is only from the Grid as the Sun is very low on horizon at the moment (07:19hrs) at it’s reasonably accurate given sampling time differences.

I will check later in the day as it appears that the solar may be influencing this???

This graphic is misleading

The same data (Generation and Consumption) is presented to PVOutput.org and this is the result

PVOutput.org calculates my import and exported data and provides a net for the day.

Why does HA need a separate input to know how much is returned to the grid (exported)?

This is what PVO does with data and the red line is below the green line from about 08:00hrs to 17:00hrs so all consumption energy is coming from solar

This is all with exactly the same data.