I would like to see these show up in the Devices page. So for the Office Window Left I would see all the Entities for this zwave device, and have a new section that would be any template sensors that reference this device. This would allow me to more easily see everything associated with a device.
I would say if an entity of a device was referenced it might show up in a template section as an option. Or have the ability to manually link a template sensor to a deviceā¦
Currently an entity belongs to a single Device. Therefore inferring the Device from the template is problematic because it may contain multiple entities.
Manually defining the Device would be the most straightforward way of making the association. The major hurdle is that thereās no easy way to refer to a Device in YAML (where Template Sensors are defined).
Take a peek inside the core.entity_registry file and youāll see entities identify their parent Device using its device_id (not its name) which is a long-winded string.
Example:
"device_id": "ad5b16a3e66349b78b14ef4g4c1e0ea1",
If youāve ever created a Device Automation, and looked at the code it produced, you may recognize that nomenclature.
Even if you were prepared to enter that long identifier, first youād have to find it and, currently, itās not revealed anywhere. You would have to look in places that werenāt intended to be explored.
The solution is to be able to create Template Sensors via the UI. Then it could offer a list of Devices (by name) to associate with the Template Sensor (and, under the hood, save its device_id). Unless that becomes available, I see no practical way of implementing your Feature Request.
Definitely see your points. Another method would be to customize the entity. So it would come in as a āOn/Offā sensor or 22/23 sensor, but then being able to select that and change type to āWindow/Doorā etc. and specify and open closed value. This could be maintained as a custom device template, not in the use config yamls.
This kind of dynamic āon-the-flyā re-configuration of an entity is not possible if the entity is defined in YAML. It, as you know, requires restarting Home Assistant.
It may change if Template Sensors are ever allowed to be created and stored via the UI (and stored in the .storage directory). Thatās now possible for the so-called āHelpersā (input_text, input_boolean, etc).
Iām searching the exactly same thing.
I have a z-wave device with some entities linked to it.
One of them expose the status of a switch in a numeric form as a sensor (0 when closed, 255 when opened). I can obviously create a binary template and turn it in a door sensorā¦ but I like to see it in the list of entities linked to the device.
Also looking for the same thing. I have a Z-Wave device with an entity that occasionally sends incorrect/erroneous values. I can make a template sensor to filter the outliers, but it would be nice to associate this sensor with the device.
I would love to see this functionality implemented. I have a lot of sensors that require some sort of manipulation (e.g. filtering for temperature, power, humidity), or other manipulation (integration of power to get energy for the energy dashboard).
This means I have all these nice devices with their overview pages, and then a whole bunch of entities which a derived from those devices but not linked to them.
I think it would make a lot of sense if we could link entities to devices.
I need this fonctionality too, for linking template sensors, and helper to existing device.
For example :
I made an automation to shutdown a switch if power is less that a numerical values since a delay.
It would be nice in in device pannel, i see the automation, the power values, and the delay value
+1. I am often needing to clean up values (especially cumulative energy from zwave devices). So a way to associate template sensors and also filter sensors with a device would be extremely useful.
I believe this may be possible if the derived sensor entity is created using MQTT, but seemingly not when it is a template sensor
I have so many template sensors that simply exist to address dealing with āunknownā values or more often, simply rounding decimals off temperatures to prevent database bloat and IO frequency
Being able to associate them with a device would be great, however for me, the best solution (in most cases) would be to not require so many template sensors, but to define a templated attribute for the underlying source entity that controlled the precision I actually care about having stored in the database as well as how significant the change should be for me to even consider recording it
Giving this a bump because it seems HA now has the capability to do this internally, so I feel like it isnāt a stretch to ask for this to be exposed to the user base.
For example, when you create a reimann sum integration sensor via the helper page, it adds an attribute called āsourceā to the entity which points to an entity_id. The device page for that entity now shows both the original entities, as well as the newly linked reimann sum entity.
It also adds āReimann Sum Integrationā to the devices integrations list.
I was hoping this meant that I could now manually specify a āsourceā attribute in order to manually link it to the device, in the same way it seems to handle it internally, however, after testing it out, it does not work.
In my case, this would be very useful because I take a lot of time to calibrate all of my temperature entities. I create a template sensor to mimic the original temperature entity, but then it adjusts it using a +/- value. Unfortunately, this occasionally makes using the HA UI a bit annoying because these template sensors donāt have the option to jump to the device page.
+1. Itās starting to be ALOT of template entities in my config after a couple of years. It would be great to be able to organize them with self-defined devices but also the possibility to link them to existing devices.
Why donāt you add the Template-sensor to the Helpers-Page? My utility meter are all added to the respective devices. (I am using HomeAssistant in a docker container. Being able to add template sensors as a āhelperā would allow me to get rid of VSCodeā¦)