Add Device for custom_components Integration for showing up in Energy -> Individual Devices -> Add device

Hi,
I am new to Home Assistant.
I recently started to extend fishbigger’s TapoP100 and HomeAssistant-Tapo-P100-Control for adding support of TP-Link’s P110 smart plugs with power measurement functionality. Once finished, I plan to give my work back to fishbigger…

I want to achieve that I see these devices under top-level Energy screen.

In order to bring them on this view, I thought simply adding them in Configuration → Energy → Individual devices → Add device will do the job.
But as of now, the drop-down only shows “Add a device” with “Select the entity that represents the device energy usage.” with “No matching statistics found”.
I assume that the Entities (I have three of these P110 things) need to show up under Configuration → Devices&Services → Devices first. But… this is not the case for me.

I followed Defining devices documentation and added to my newly added .homeassistant/custom_components/HomeAssistant-Tapo-P100-Control/tapo_p100_control/sensor.py :

class P110Plug(SensorEntity):
[...]
    @property
    def device_info(self):
        """Return device specific attributes."""

However, there are still no Device entries shown in Configuration → Devices&Services
I assume I can add the Devices to Configuration → Energy → Individual devices only after some time due to this info “After setting up a new device, it can take up to 2 hours …”. But I also assume that the Devices would already show up “Devices & Services”.
In Developer Tools, the entities show up nicely with (example of the P110 for my computer)

sensor.computer_power 	116.034 	state_class: total
Computer power                      unit_of_measurement: W
                                    device_class: power
                                    friendly_name: Computer power

Any hint on where I am doing wrong is highly appreciated. I wrap my head around this issue now for > 1 week…

My (development) configuration:
Home Assistant Core 2021.12.3 installed on a Windows 10 Home with using WSL according to https://www.home-assistant.io/installation/windows#install-home-assistant-core.

Resolved myself:
For showing up in the Configuration → Energy, an Entity must be of device_class = energy. Yes… makes sense when I am now typing this in :slight_smile:
I was a bit confused by the documentation of “Long-term statistics” from Sensor Entity | Home Assistant Developer Docs. But now after reading it several times, I understand the difference between state_class and device_class and what the consequences thereof are.

Did you ever solve the device issue ?
Im having a similar issue with a component I am working on.

Entities are all created, the device_info property is there, but I am just not getting a device created.