zigbee2mqtt
zigbee2mqtt copied to clipboard
Aqara Door Contact Sensor naming in Homeassistant is not correct
What happened?
Somehow the naming of Aqara Door Contact sensors in Homeassistant is a bit messed up.
With the new naming scheme changes in Homeassistant Entities are now named [device name] [sensor].
I have a contact sensor on my Washing machine. Therefore I named the sensor in z2m to "Washing Machine Door". Unfortunately the sensor entity that shows if it's closed or not is named "Door" instead of being the main entity of the device and taking its name.
Thus Homeassistant names the sensor entity to "Washing Machine Door Door".
With the new naming scheme the name of the contact sensor entity should be set to None/null so that Homeassistant will name it to [device name] removing the duplicate "Door".
Not sure how to better express that, I hope it's clear what the issue is.
Z2M Version: 1.35.1 commit: 9eaaa0f
What did you expect to happen?
When I name the device to "Washing Machine Door", the entity that shows open/closed should also be named to "Washing Machine Door" and not to "Washing Machine Door Door"
How to reproduce it (minimal and precise)
Pair an Aquara door sensor and name it to "Something Door".
Zigbee2MQTT version
1.35.1
Adapter firmware version
20220219
Adapter
zStack3x0
Setup
Z2M and HA in docker on a mini pc
Debug log
No response
If this is not the right place, can someone point me to where I should report this to please?
Issue for me too. I have contact sensors on the windows, I name it 'Bedroom Window', in Home Assistant it gets named "Bedroom Window Door"
Same issue here.
Same!
I agree the way this is designed makes naming things difficult / impossible. Only partial solution I've come up with is to manually rename every door's (or window) main entity (not device) to something like "Bedroom Door" so it shows up as "Bedroom Door" instead of "Bedroom Door Door".
Edit: After looking at the MQTT discovery JSON, I suspect this naming problem is more likely in Home Assistant than in Z2M, but I admit I don't know much about how the two interact.
I doubt it's in HA, it's more likely in z2m.
The main entity should report null as name but it probably responds with "Door". If it would respond with null, it would get the name of the device. If it responds with "Door" it gets the name of the device + Door.
So it should be fixable in z2m when it names the entities. However, this code is a bit messy for this device type and I haven't found the obvious fix yet.
I tried again to debug it but I could not find out where the additional "Door" comes from. In https://github.com/Koenkk/zigbee-herdsman-converters lumi.sensor_magnet.aq2 looks fine to me.
The issue still persists in z2m 1.40
Is there a solution to this?
Not yet. I tried to look through the code but I didn't understand it enough to figure out where the issue comes from.
Problem still persists.
Same here, i've been slowly migrating from ZHA to Z2M and notice this.
| ZHA | Z2M |
|---|---|
I also saw it mentioned https://community.home-assistant.io/t/labels-front-door-door/615410 .
The entity id was ok binary_sensor.kitchen_hallway_door_contact.
I wonder if it has anything to do with the default device class, somehow resulting in this duplication in the name https://github.com/Koenkk/zigbee2mqtt/blob/master/lib/extension/homeassistant.ts#L69 but this would apply to all contact sensors and is perfectly valid door: on means open, off means closed.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
not stale! There is still no fix
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
Unstale because still broken
Same issue for me.
Is it possible to remove the contact suffix in entity name?
I'm migrating from deCONZ to z2m and have a lot of entities used in automation that i would not edit.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
Still broken