Why can't we add template entities to existing devices?

I’d like to add link other devices from other integration also. My living room TV has Samsung, Google Cast, Netgear, and DLNA. Four devices. One would be nice.

helpers and such would be nice as well

Related to this feature request for some use cases New Helper: Entity from attribute

Also Riemann sum integral and utility meter entities, insofar as they are used to track energy consumption of a single device. I really like how the Powercalc custom component links the power, energy and utility meter sensors that it creates to the relevant device.

2 Likes

I have several homebuilt particulate sensor monitors. Through some templates I’m able to run the math to convert the raw particulate counts to an AQI which I can compare against official sources and other sensors out there.

But I can’t attach those calculated values to the devices themselves! Instead I’ve got a whole separate set of entities to keep track of.

Easily my number 1 frustration with HA right now is the clutter of different entities floating around that I can’t associate with the actual source. I would so very much love to be able to attach a calculated template entity to an existing device.

Related: Wth can't I add a helper to a existing device?
Just adding so that the comment context is somewhat linked for people originally on this thread.

2 Likes

I am currently building a custom integration that will allow the user to modify devices in the following ways:

  • Change device attributes
  • (Re-)Assign any entity to any device
  • Create new devices
  • Merge two devices

Changing attributes and assigning entities already works, however the integration is currently under development, lacking documentation and should be treated as unstable and experimental.

If you are still interested in these features, Maybe you’d like to check out the repository and follow the development: GitHub - EuleMitKeule/device-tools: Device tools integration for Home Assistant.

3 Likes

Looks promising! Just to check: If I use it to merge 2 devices will it then also merge the statistics of those devices?

I’m not sure what you mean with the statistics of the devices. If you mean the recorder data, that is only in regards to entities not devices. Merging the devices will simply move all entities from one device to another and disable the entity-less device. This process will not change anything about the entities and recorder data should therefore be kept.

This looks encouraging - go give it a thumbs up :slight_smile:

1 Like

Ability to add text (static custom attributes), number (static custom attributes); link media (e.g. for device pictures or custom icons) or calendar to a specific device would be great. This is a semantic grouping thing

1 Like

Seems like this has been fixed in the upcoming 2024.7 release :tada:

Not necessarily. Some issues are being investigated.

What issue lead to the note about YAML configuration support being removed ? I looked over the PRs but didn’t manage to find the change.

The support for yaml never existed. That was the issue that was being investigated. It was an error in the PR description that made it’s way to the beta release notes. So the release notes were corrected to signify that it’s UI only.

Well, nutz! I was looking forward to employing this feature but all of my Template entities are defined in YAML.

Template helpers don’t currently support all available options (for example, a Template Binary Sensor helper only supports three out of about a dozen options) and are limited to sensor and binary_sensor (no support for trigger-based either) so that’s why I continue to define them in YAML.

Anyways, hopefully Template helpers will eventually be fully fleshed out so I can migrate and take advantage of this new feature.


FWIW, it’s a bit surprising that an advanced feature like appending a Template Binary Sensor to an existing device is introduced to the least feature-complete variation (i.e. helper). In contrast, it’s already possible to assign an MQTT entity to an existing device using YAML.

3 Likes

Would like to see/have it for YAML entities as well. Esp. there.

In the current Home Assistant structure, it is possible to create or link a device with just one config entry. Template entities created via YAML do not have a configuration entry.

So it is not an option not to extend it to entities via YAML config, the developers were willing, but it is not compatible.

What does the MQTT integration do differently so that it allows appending MQTT entities to an existing MQTT device, all in YAML?

Is it because it is limited to appending to an MQTT-based device and not a device based on other integrations?

Correct me if I’m wrong, but MQTT integration has a configuration entry (connection to the broker). Only entities are configured via YAML.