Unable to add devices to Energy Config (select doesn't work) - bug?!

I’ve had no issues previously adding individual devices to my energy dashboard, but now after upgrading to 2022.6 it seems I cannot select any devices to add to the list.

I’m sure I’ve got the new devices setup correctly, as they are the same as previous entries and I’ve even removed a working one to re-add to test and it doesn’t let me select it.

Any thoughts an input here would be appreciated.

Previously added entity, been working, no issue, removed to test and now can’t select to add back-in:



# ## Smart Plug Vaccum ##############################################

- platform: integration
  name: "Vacuum Consumption"
  source: sensor.current_consumption_vacuum
  method: left
  unit_prefix: k
  round: 2

Look at your energy sensors in Developer Tools States. They need to have the following attributes:

device_class: energy
unit_of_measurement: kWh #or Wh
state_class: total_increasing # or total

All matches there.
As I’ve said it previously had no issues adding devices, but now I can’t add any additional.

Seems this morning too my Energy Dashboard is blank and the sidebar is just sat at “Loading…”

Any issues you can fix in Developer Tools > Statistics?

Ok. So I cleared some issues yesterday, as the entities no longer existed, that seems to have now put a stop to any energy data going in.
It has now been more than 2 hours since I restarted HA and no energy data is in there.

I have found if I use Firefox I can add that sensor.vacuum_consumption + the others I was trying to add without issue.

You need to add sensors here:

The main graph does not use the individually monitored devices.

Yup, which I’ve got, and it has been working for weeks, and now its decided to just stop working.

Sensors:
Can’t add new sensors into individual devices in Chrome(/webkit). If you can confirm, then it is a bug introduced in 2022.5

Energy Dashboard working yesterday, up until I removed the old and problematic sensors:

Today:

Anyway to kickstart HA to get this going again?

Ok, I think I’ve found the issue, these two templates have stopped working yesterday evening for some reason:

- platform: template
  sensors:
    grid_consumption_power_energy:
      unique_id: grid_consumption_power_energy
      value_template: >-
        {% set power = states('sensor.gm_power_active')|float(0) %}
        {% if power > 0.0 %} {{ (states('sensor.gm_power_active')|float(0) * 1000) }}
        {% else %} 0.0 {% endif %}
      device_class: Power
      unit_of_measurement: 'W' 

- platform: template
  sensors:
    grid_export_power_energy:
      unique_id: grid_export_power_energy
      value_template: >-
        {% set power = states('sensor.gm_power_active')|float(0) %}
        {% if power < 0.0 %} {{ (states('sensor.gm_power_active')|float(0) * -1 * 1000) }}
        {% else %} 0.0 {% endif %}
      device_class: Power
      unit_of_measurement: 'W'

They aren’t reporting as having an issue, and if I copy them into the Dev tools template, the work no issue.

What can I do to nudge these going again?

Neither of those sensors are energy sensors. They are power sensors.

That is correct, they are templates the energy sensors then use for conversion to ensure any usage and export.

I have found the issue though. HA corrupted its database yesterday when it removed statistics. Managed to see in the log that it broke itself.
Now lost a almost a years worth of energy data :frowning:
I’ve got the MySQL tables in the files, but can’t reimport them.

Seems like the energy config does have a bug with Chrome/Edge though.

Seems like the energy config does have a bug with Chrome/Edge though.

Looks like it’s fixed. Works for me now at least.

This may be a really stupid question but how am I to find settings for Energy-related things. I have the dashboard but I am missing some devices and would like to add these but I just can’t find out place where to do that.

Edit. Ah, nevermind: found a solution for this. For anyone wondering the same, this is under Settings > Dashboards > Energy.