Integration Sensor Doesn't Show in Energy

I have a handful of Sonoff S-31 switches flashed with ESPHome, all configured identically (save names, of course) and matching integration sensors for each of them to calculate the energy usage for each.

However, not all of the integration sensors (configured via HA, not ESPHome) show up in the Energy configuration section. All of the integration sensors show up in Developer Tools, the history graph, etc.

The issue has persisted through a couple of updates, many reboots, adding a new switch & integration sensor.

Does anyone have any ideas? Thanks

What attributes do they have shown there?

Here’s a sensor that shows up in the Energy config:

state_class: total_increasing
source: sensor.equipment_rack_power
unit_of_measurement: kWh
friendly_name: equipment_rack_energy
icon: mdi:chart-histogram
device_class: energy

And one that doesn’t:

state_class: total_increasing
source: sensor.ev_charger_power
unit_of_measurement: kWh
friendly_name: ev_charger_energy
icon: mdi:chart-histogram
device_class: energy

Oh, and here’s the snippet of my sensors.yaml that has both:

- platform: integration
  source: sensor.equipment_rack_power
  name: equipment_rack_energy
  method: left
  unit_prefix: k
  round: 2
- platform: integration
  source: sensor.ev_charger_power
  name: ev_charger_energy
  method: left
  unit_prefix: k
  round: 2

That all looks good to me. I can’t see why they would not be able to be selected for the energy dashboard.

Do you know if there are any logs or other debug info I could possibly gather for a bug report? I don’t see anything that obviously stands out in the logs.

No. Your entities have all the required attributes.

state_class: total_increasing
unit_of_measurement: kWh
device_class: energy

You could open an issue here:

have you try put state_class ‘via’ customize.yaml?