Energy: Not showing the expected entities for consumption

this seems a very clear message. the unit is incorrect. it really should be and if the entity doesn’t have that, you should either be able to set it in the customize, or preferably, check in the core repo on the integration and file an issue there.
did you check here ?

sure template sensors are allowed, as long as they fit the bill. that is, are of the correct state_class and have the correct unit

      - unique_id: lights_total_device_energy
        name: Lights total device energy
        state: >
          {{states('sensor.lights_inside_total_device_energy')|float(0) +
        unit_of_measurement: kWh
        icon: mdi:lightbulb-group-outline
        device_class: energy
        state_class: total_increasing

working just fine in the panel

the state_classes have been fixed in core HA to set the last_reset, so you shouldn’t need to set that manually.

btw, if yours in a total sensor, the state_class should be total_increasing.

what does your sensor look like in dev tools states?

@francisp Thank you. That means that creating a measure that basically copies my sensor.gas_consumed could work.

@Mariusthvdb I have the following in developer tools:

unit_of_measurement: m³
friendly_name: Gas Consumed
device_class: energy
last_reset: '1970-01-01T00:00:00+00:00'

That looks live I have the right unit of measurement set up, does it not?

Yes. Now take out the last_reset, and add the correct state_class and you’re done.

Solved it…

Downloaded the new firmware for Slimmelezer, downloaded that and removed slimmelezer and all the extra settings I made manually. That did the trick.

Thanks for helping out :smiley:

yeah, that was what we figured :wink:
great you got it working. cool.

Hi, have problem with my 2xBlitzwolf sph2 wifi (mqtt) smart plug sensors. How to solve this? In my configuration.yaml not have these sensors. Get from mqtt integration. TY

Go to developer tools → state and show what you have for these blitzwolf sph2

Have a lot of error and must fix. But don’t know how…
In my configuration.yaml try this:

last_reset: ‘1970-01-01T00:00:00+00:00’
device_class: energy
state_class: measurement

but nothing changed I think.

is already not correct

unit_of_measurement: W
friendly_name: Blitzwolf 2 ENERGY Power
device_class: power

These are useless for showing in the energy tab. You have to convert them to energy sensors first.
use the riemann integration with the left method.

Oh ok, I think leav it. It is complicated for me now.
Thank you anyway.


I’h having a similar issue with an nodemcu esp8266, but this solution does not seem to work for me.

I’ve set it up as described here and it is working as expected. It’s counting pulses and is reporting gas use in m3:

how the sensor was set up:

  - platform: pulse_counter
      number: GPIO5
      mode: INPUT_PULLUP
    name: Gasverbruik
    update_interval : 60s
      - lambda: |-
          static float total_value = 0.0;
          total_value += x * 0.01;
          return total_value;
    unit_of_measurement: m³
    accuracy_decimals: 2
    icon: mdi:fire
    state_class: total_increasing #measurement
    device_class: energy

what I get in the developer tools:

state_class: total_increasing
unit_of_measurement: m³
friendly_name: Gasverbruik
icon: mdi:fire
device_class: energy

This looks all ok to me. But I’m still getting the “Unexpected unit of measurement” warning at the Energy setup page

I had an issue that stumped me for a while around this. After setting up the Riemann sum integration sensors, I was only getting 3/4 options showing in the energy configuration page.
It turned out that one of the units hasn’t configured correctly even though all of the config yaml was the same.
I had to go to the Developer tools > statistics, then ‘fix issue’ regarding the unit

I have a couple of energy measuring wall plugs. Some work with wifi (Tasmota) and I can add them as ‘Individual devices’ in the Energy page. But I also have a Fibaro Zwave plug, and I just can’t get this right.

I have add some parameters with the customize.yaml file.

  state_class: total_increasing
  unit_of_measurement: kWh
  device_class: energy

This is how it looks in Developer Tools states list:

It’s also added to the recorder list.

I just can’t figure out why I can’t see it in the energy configuration page.

I’m pulling my hair out with this one. I have a serial sensor that gets parsed to show me instant watts. Which works fine.


I used this yaml to turn that into a kWh meter.

  - platform: integration
    source: sensor.powerw
    name: House Energy kWh
    unit_prefix: k
    unit_time: h
    round: 2

And that seems to work a treat:


You would think that it would just show up in the list and I’d be off to the races with energy right? Well it’s not in the list for some reason. And I can’t figure out why.

1 Like

I have the same exact issue - either many people are not understanding something or there have been changes that were not implemented/communicated correctly. This should be much easier :wink:

1 Like

I am not able to see energy_ev or any other devices in the Energy as Individual Device. In the Development tab, I can see energy_ev without issues. What am I doing wrong?
PS: I know that I don’t need the sum, but the plan is to extend what I include in it.

LE: After 30’ the information become available.

- sensor:
  - name: "Energy EV"
    unique_id: energy_ev
    unit_of_measurement: "kWh"
    state_class: measurement
    device_class: energy
    state: >
      {{ [ states('sensor.car_charger_channel_1_energy') ] 
              | map('float', 0) | sum }}
      last_reset: '1970-01-01T00:00:00+00:00'
    availability: >
      {{ not 'unavailable' in 
             [ states('sensor.car_charger_channel_1_energy') ] }}

@francisp @teekert ,
I’m pulling almost my ‘hairs’ out for not getting this to work. Please advise what I do wrong:


      last_reset: '1970-01-01T00:00:00+00:00'
      device_class: energy
      state_class: measurement
  - platform: mqtt
    name: "Generation power"
    state_topic: "solarmanpv/station/generationPower"
    unit_of_measurement: 'Wh'
    device_class: 'energy'
    state_class: 'measurement'

So for the energy dashboard all my inputs come from “total_increasing” meter readings rather than Point in Time measurements. I’m not sure if this is a requirement but I think it may be.