Extend/customize devices

I’d like the ability to extend or combine devices by adding entities. Rather than have an independent helper, an entity could be added that contains a helper construct (text, number, etc.).
Possible use cases:

  • some door locks include a contact sensor to detect when a door is open or closed. It would be handy to be able to add entities from an independent sensor into the door lock device.

  • If you have an esphome device that needs to be calibrated, you might pass the calibration data through from an HA helper. It would be nice to attach a helper construct as an entity.

In the meantime, you can try:

2 Likes

or…
Why and how to avoid device_ids in automations and scripts.

I don’t think the FR here is in any way connected to the “dealing with(out) device_id” recommendation (for automations).

It’s about grouping stuff. When I go to my device page, I’d like to see stuff that’s about that device. If I add a custom sensor (via template sensor helper, for example), I may also want to see the new sensor on the particular device page.

2 Likes

You can do it with MQTT Discovery. I have done it many times, add entities to devices. Just have to match the device info with an existing device.

I think I heard about something called labels that should work many times better, though. Actually be useful.

2 Likes

That’s hacking. The FR is about an official (and hopefully easy to use) way :slight_smile:

I personally think a lot in terms of devices, not entities. I know, entities are base of HA, blah, blah → but that’s the reality.

When I want to do/check something, I find my device and look at its “control panel”. I don’t browse entities. I browse devices.

I don’t think labels help here in any bit. Should I create a label for every device to browse through “device labels” instead of just devices? Even if I did, it would not be such a nice presentation of “device atrributes” (a.k.a. entities) as the device page.

Well, I’m obviously wrong then.
I stand corrected.
There can only be 1 way…

I don’t see the relationship to what I am asking. Care to elaborate?

Interesting about the MQTT hack, but I’m thinking of a built-in feature.

Is there an existing FR I should be voting on? I didn’t find one when I searched

Just offering an alternative.

Device_Id’s are cumbersome (32 random characters) that use the new type of entity_id’s ( also random 32 chr names) and not meant to be used outside of the ui editor environment. There have been changed to make that better, but they were added as an extra layer to entity_id’s to work better in the UI. (I have been told) They don’t do templates well (many functions not at all). You have issues if you try to convert automations, scripts using Device ID’s to anything that the UI doesn’t do.

If you want to do something the UI editor cannot, you will struggle.

Traditional entity_id’s can work with templates and can do more things. (And work in the UI)

My alternative is to ignore Device_id’s (where possible) and use the traditional entity_id functions instead. Templates, service calls, etc. And if you ask the new entity_id’s and the traditional entity_ids are sometimes interchangeable, sometimes not. (just to be confusing)

Just offering an alternative opinion.

And the MQTT Discovery entity / device-entity creation isn’t a hack, it’s a built-in feature that uses a world standard protocol.

That’s like saying modbus is a hack, or mdns is a hack.

Thanks that’s interesting information, but I’m not sure how it applies. I’m not working with device_ids. I’m looking for a way to tie entities together into custom devices to provide a logical unit for relating the entities.

Device IDs are in reality your entities. Think of the IDs as secondary identifiers.

You could accomplice something similar, with either old_style group, or i.e Labels
A “breaking” aspect i see in this FR, is the fact that you want to tie a template/helper to 1 physical Device.

What if this specific helper/template in fact is depended upon another Device ? i.e State of another entity ?

I could see that i.e Helpers/Templates, is " Shown " on the Device-Page, like Related Automations/Scripts

But Creating a “Fictive” Device, with a helper/template with i.e State from another Device
And “registrar” This as 1 and the same Device, in same integration ?

Use Group/Labels, Labels in i.e Auto-entities_Card etc., list what you want to include, Create A Dashboard, with your “merged” Devices, or just add the Cards to your existing , You then get a Personal Customizable Card, with the entities, their individual state/features etc.

What’s happening beyond the “Hood”, you have no control over anyways

Then I just wouldn’t “tie” it to any of those two (sharing) devices. When it makes sense, it makes sense; when it doesn’t, it doesn’t.

Devices are not necessarily a super universal way of categorization/grouping stuff, but a good one in many (not all) cases.

If there was a FR, I’d vote for it <3

I’m configuring dashboard for like maybe half of my devices. Many devices don’t need controlling/checking on regular bases and maintainig dashboard is extra chore. I just browse them via Settings when I need to.

Maybe you’re right that labels could help in some cases, but attaching a custom helper to the specific devices would be even better for some of the use cases. I’m voting for it, and I’m using the HACS solution until it maybe becomes possible natively :slight_smile:

1 Like

Agreed. I use Device Tools for a few specific purposes and it works very well. For example:

I have a number of wireless sensor tags monitoring temperature and humidity. The integration is quite an old one, still in yaml and cloud based. Although there are half a dozen physical devices, all I get is a bunch of entity values. Device Tools groups them conveniently.

I also use the Bayesian integration to decide whether the house is probably occupied. Device Tools gives me a convenient overview of the data:

For other purposes labels may be better.

1 Like

Take that up in the Specific Integrations Github, it’s Not an universal HA Issue

Not sure it would make a big Diffence, in how i Manage my Devices/Functions, thou i often(For some Integrations) Are using The Integration/Device Page as You

Maybe im just not quite sure what You and OP Means by the Word Attaching, sounds like you want to “tamper” with some Integrations Devices( Making it to an additional Fictive Custom Device)( In Same Integration ? ) , which im sure could be a difficult thing for HA to perform in “An universal” manner

That’s one way of doing it, not necessarily the best one. That would require:

  • thinking it through (instead of just doing quick tweaks, experimentations)
  • find the proper GH, make an issue
  • someone has to agree it is universally a good idea, someone has to make a PR, PR must meet specific quality and testing standards, someone has to accept it, finally waiting for the update

And here I want my one, useful for me, helper.

  • Use case nr 1: Make a single Helper → add it to a specific existing device.
  • Use case nr 2: Make entirely new device out of (multiple) helpers.

HACS’ DeviceTools works ™. It’s just a bit early stage for now and not OOTB.

It’s actually quite easy to do. Try using MQTT discovery, you can attach entities to any device rather easily as long as you have a matching identifier connection.

1 Like

So Will MQTT expose 2 Devices ?, The Orig, And The one With the Added Entity ?, Or Will HA only see 1 Device, Exposed From MQTT ?
Or, Is HA creating this “new” Device ?