It would be great to be able to add custom data (states/attributes from other entities) to attributes when creating helpers in the UI. Particularly for the template sensor, but could also be nice for other helpers.
With the push in recent years to move everything to its own entity instead of having a lot of attributes (and there can certainly be an argument for that in many cases), it can make some things difficult to do in HA afterwards when the information you would like associated with one entity-card (or however it’s displayed in your UI) is actually split across sometimes dozens of entities.
A nice and semi-easy workaround could be to create a template sensor, and throwing all the additional data you need into attributes. But the only way I currently know how to do that is by using AppDaemon. It would be nice just to have available in the UI.
Perhaps I’m not understanding the request fully, and I understand your context is that of the UI, but you can create template sensors with extra attributes quite easily - just not via the UI.
The way you can do this in YAML I just don’t see as a viable option in the UI because unless you intend to always use static attributes or a very short single line template in Jinja then you kind of need YAML to do this.
To give you an example, I have a template sensor that checks three different weather services and compiles their data into attributes of a sensor template so I can reference their data into a weather template. There is no way I could even begin to do that in the UI, it has to be done in YAML because a lot of calculations and logic goes into building the value of those attributes.
PS: You might wonder why I did this template, it’s so I don’t have to call get_forecasts for the forecast data and can revert to the “old style” of just reading an attribute of forecast data - among other data points.
Yes, this was mostly to be able to from UI. I know it can be done in yaml or other text-based approaches.
I’ve been using AppDaemon for things like this (and most automations) for many years, since back when HA “automations” were very rudimentary. I’m just slowly trying to see how much I can move to UI-based, as this seems to be the future.
Specifically, I have an integration (trash pickup dates) that creates 32 entities, I need the information (state) from 16 of them, but I would like the 15 of them integrated into attributes of the “main” sensor (then one that says “days until next pickup”, regardless of type of pickup).
I want to create a (template) sensor that shows the state of the “main” sensor (days until next pickup) as the state, but then has attributes “pickup_today” and “pickup_tomorrow” that lists the types of trash that are due today or tomorrow. That is, the types for the other 15 sensors if their state is “0” (meaning today) or “1” (meaning tomorrow), along with an attribute that shows days until pickup for a few “special” types of trash.
There are a couple of use cases, but one that I’m missing a lot is to show an icon in the dashboard (I use the mushroom-chips-card) colored by whether there is pickup today or tomorrow, which when you click it to show “more info” of the sensor, will have the lists in attributes about which types of trash I need to put out today. I don’t want that info front and center, but I want it easily accessible from the “chips” card.