Combine related entities

I would like to combine entities to create more logical ones: for example, I have a wifi wall relay that controls a IKEA zigbee bulb and I would like to treat it as a single entity: when I want to turn it off, I use the relay; if I adjust the brightness to something different that 0, I first turn on the relay then I send the brightness to the bulb.

Another use case is my door: it has a HomematicIP lock and a zigbee contactor to detect if it is open or close. For almost all humans, there is a single thing, the door that can be open, closed but unlocked or locked.

Currently, Home Assistant forces me to be think about each of those components. Sometimes, even I forgot it and ask if the door is open to Alexa, which says yes, then I run downstairs to close it only to find it closed but unlocked and only then remembering that I should had asked about the contactor, not the door.

I have a friend that has a door lock with direct integration with Alexa and he can ask how is the door and Alexa answers correctly. I do not understand why HomeAssistant cannot do it.

Sounds like you should rename some of your entities. Call the door contact sensor “door” and the lock “door lock”. Or leave them in HA and use the entity_config option in the Alexa integration to change the name of entities in Alexa specifically. Or make a routine in Alexa so when you say “is my door open” it does what you want.

I actually would also like the ability to merge entities from multiple integrations into one device when it makes logical sense. It bugs me that when I add template entities that are about my phone but can’t include them in the phone device.

But your ask seems to be about Alexa so that’s different. And I think solvable with existing options, just change the names of entities you expose to Alexa to be what you want them to be.

I have been reading Alexa documentation and it says that an endpoint can have multiple interfaces. My door would be the endpoint; LockController and ContactSensor two interfaces exposed by that door.

I have read about OpenHab-Alexa integration and they do allow to map multiple objects to a single Alexa endpoint, so my door can be represented as Alexa expects.

But HomeAssistant does not provide that option and it is a pity. It is superior to OpenHab in many other aspects.

1 Like

Hm ok interesting. Yea I’m not too familiar with Alexa myself tbh. Homekit has some options like that under entity_config for linked doorbell sensor and linked battery sensor. Seems like similar options are needed for Alexa then.

Take a look at the Template Light, Lock, and Switch integrations which allow you to combine component and services into a single entity.