Home Energy Management in 2021.8

maybe because the energy integration needs those attributes? How do you think it can calculate daily stuff without last_reset etc.? Developers aren’t stupid, if they filter sensors based on those attributes it’s because it’s a prerequisite for the correct functioning of the integration, not because the list would get too crowded. :slight_smile:

Hello,
i just found this tread - i posted my question in another tread regarding energy management.

I have some trouble setting up the new Energy Dashboard.
I can not select the entity.

Here the Configuration:

I tried many approaches from several treads but i cant get it to work.

What did i do wrong?

Thank You!

1 Like

please show the screenshot of the total_in sensor from dev tools, want to check the attributes from HA’s point of view.

The unit of measurement shouldn’t have a space, and doesn’t need quotes, it should be like this:

unit_of_measurement: kWh

just modify unit of measurement…I don’t see other issues.

can i do this by editing customize.yaml?

sorry - i am not that experienced.

This is your customize.yaml, just modify the unit_of_measurement like I told you, then restart and post the dev tools screenshot again:

i just shared my thoughts with nthis topic as beeing new to energy. So no need of beeing that attackable, please.

I thought that it would do time coun ting itself (e.g. as with power meters from a light sensor). But now i undestand there is more insights i did not think of. Understood better now.

Will try to achieve same with the configs explained above.

/ Ralf

I didn’t attack you, I even explicitly put a smile at the end of the post just in case…but I see it didn’t work. Sorry if you interpreted like that, it was just ironic, not aggressive at all. :slight_smile:

Just for reference, here’s one of my sensors, that are picked up correctly by the integration:

This solved the problem :slight_smile:

No graphic statistic data showing up yet - but a few hours wait should fix that.

Thank You so much!

1 Like

Glad it’s working now. :slight_smile:

Will it ,over time, give me monthly statistics ?
Or is it just day by day?

Anyone else seen that the calculation of peak and offpeak not correct on energy page?

Well i setup a long time ago with the same device a (utility_device) that calculates the daily usage.
After a day i checked and on the energy dashboard it says i consumed total (4.93kWh) and on my utility_device it’s (4.80kWh) i have a dmsr 5 meter so it goes automatically to peak offpeak and i use the Cumulative device…

When i check the saved (Cumulative device) and do some math the utility_meter shows the correct value…

regards

I have a sensor that mesures the current used at all time, so i want to transform it to kWh, which i have done with a template sensor (see code at the bottom), the template sensor works fine, but it doesn’t turn up as a device in the energy management. Somebody suggested using “last_reset” but that doesn’t seem to be possible with a template sensor? I get a config error if i use “last_reset”. Any tips?

- sensor:

    - name: test_kwh

      unique_id: test_kwh

      unit_of_measurement: "kWh"

      device_class: energy

      state_class: measurement

      state: "{{ states('sensor.test_energy')|float * 0.240 }}"

try with customize integration, check a few posts above.

this is the first version, data goes into the new statistics database, I’m sure we’ll be able to do what we want with data. the default view is the daily one.

Read the blog post, particularly this section: 2021.8.0: Feel the energy ⚡️ - Home Assistant

You can create a statistics card: Statistics Graph Card - Home Assistant

1 Like

put this in the customize.yaml

#your sensorname
sensor.test_kwh:
    unit_of_measurement: kWh
    friendly_name: test_kwh
    icon: mdi:YOUR ICON
    device_class: energy
    state_class: measurement
    last_reset: 1970-01-01T00:00:00+00:00

and this configuration.yaml

sensor:
  - platform: template
    sensors:
        test_kwh:
            friendly_name: test_kwh"
            value_template: "{{ states('sensor.test_energy')|float * 0.240 }}"
            unit_of_measurement:  kWh

Thanks a lot, I will try that out. Do you know if they have plans to change this? Seems like quite a roundabout way to do it, and not all that intuitive (at least not for me :))

Like I wrote today to another person who had the same question: Home Energy Management in 2021.8 - #68 by alexdelprete