I often create derivative template sensors from other sensors created by particular integrations/devices. It would be nice to be able to declare the template to be part of the device, so that it could appear on the device’s page (e.g. under a separate template entities categories).
Or devices could automatically show all the template sensors which depend on the device’s entities.
It actually attaches itself to a device automatically, code reference:
Please note, devices are only a feature that can be used for things managed through the UI; there is no device context or possibility available when creating YAML helpers.
For template helper entities created through the UI, you can associate them with a device through the template options.
I’ve been migrating some of my template sensors that were defined in YML to be configured through the UI (If they don’t use properties that are only definable through YML…)
Migration is not the problem. Problematic might be a situation if one wants to maintain his/her configuration organized in packages. Having some sensors in packages while others in UI isn’t a really good idea.
I’m not sure you still need a solution (for yaml created templates).
Since I’m on the same board, I was desperately looking for su a way, I found a custom integration that can do that. It’s still not the same as managing entities in yaml. But it’s better than nothing in some cases
It looks it provides lot of options to manipulate devices.
One of them is assigning any entity to a device. I can confirm I was able to assign the Yaml-created energy template sensor to an existing device.
PS. I hope it will not discourage possible developers to add native way to do so.
That looks interesting, but am I blind or is there no documentation whatsoever on how to use it? The only instructions there is only tells you how to install it. I’ve done that but there is no new Device Tools anywhere within HASS as far as I can find…
It’s true. I didn’t find it either.
But the usage is simple. install it, then in Settings/ Devices&Services use add integration button and select Device Tools.
After that, the GUI will guide you
Within the device, you can then assign the entities you want to.
Go to “Configure” - and there, you can add all the entities to your “new” or “modified” device, you want…