Utility meters don't appear with device when they are defined in yaml

Hi experts out there,

I want to define daily/weekly/monthly etc utility meters for my smart energy monitor.
If I defined them from the Helpers web UI, they appear on the device page. However, since there are too many of them, I have a script to generate a yaml file with about 90 utility meters. After I rebooted HA, they appear as entities on the Helpers page, but not on the device page.
I checked the doc, and there seems to be no way to add a device for a utility meter. The device is inherited from the source entity if it is manually created, but not when they are defined in the configuration yaml file.
Is there a way to fix this? or it should be a feature request for HA?

Picture: one utility meter appears on the device page as it is manually created:

All other utility meters appear only on the Helpers page as they are defined in yaml:

If you mean with manual created, created in the UI, this is expected behavior. Only helpers created in the UI can be attached to a device.

In your YAML add in a unique id as described in the docs and add them. Then shutdown HA and edit the JSON file .storage/core.entity_registry to associate them with a device id (or extend your scripts to edit the file). This has a chance of working. Also look at the entity registry for one of the helper created utility meters to see how it establishes the relation.

1 Like

This sounds like a good idea but it didn’t work. I added device_id value for the utility meters and after restarting, it reverted to “null” again.

This kind of works, but you have to manually add all the entities to the Device Tools device via the UI. Is there a way to edit its configuration and add the entities there?

Edit: actually, it didn’t work. It didn’t survive a restart.

There seems to be no way. But it is not a big deal. I just grouped them into a dashboard to easy access.