What broke for you? It appears you misunderstand the post.
So after updating everything (HA 2023.9 and Z2M 1.33) and restarting etc etc (no error logs) I now end up with Zigbee devices that use the sensor type in the friendly name, like: Kantoor Beweging
, became Kantoor Beweging Beweging
. The only way to fix this is by manually changing the Home Assistant name in Zigbee2Mqtt for every sensor I have, and will connect in the future? Changing it to âKantoorâ in Home Assistant name field, fixes the friendly name and allows me to still use Kantoor Beweging
as Z2M name.
I understand people might not consider this âbreakingâ since entity_idâs stayed the same. But this is defnitely âbreakingâ from UI standpoint and from device management, if I always have to change friendly names manually when adding a new device.
Is this really the solution, or am I missing something very obvious?
The worst part is that Home Assistant puts Door
behind any contact sensor, even if itâs declared as a Window sensor by Home Assistant itself. So the only solution is to change the friendly name of each contact sensor inside HA.
This feels like an extremely bad solution having to manually change these things in order to not have a duplicated name or wrong sensor type names? So I hope I am missing something.
You should not have duplicate names unless you add the duplicated names in Z2M. By default Z2M does not do this either.
All this change did was: Add the device name to the entity name for naming the entity. I.e. if your device is named xyz
in Z2M, and you got 2 entities in the past named abc
and def
. The result would be 2 entities with the name xyz abc
and xyz def
.
So if you named your device kantor beweging
in Z2M and the sensor before was beweging
, you can expect the name to be kantor beweging beweging
.
As it stands, this would have also been the same result using Z2M in the past. So, Iâm not sure how its different for you now.
Yes, but it doesnât make sense to have a motion sensor called âKantoorâ in Z2M, since I also have lights, a curtain, power outelets in that same room. Canât have 8 Zigbee devices in one room that all have the name âKantoorâ in Z2M. Which is why I (and many others) have Kantoor Beweging, Kantoor Gordijnen etc.
What other alternatives are there if you have more than one Zigbee sensor in a room and need to use a logical naming scheme?
Still, I donât understand why a contact sensor automatically gets the âDoorâ name in HA, even when HA itself has it set as window device_class? I either have a window sensor called âKantoor Raam Deurâ or I have to manually set the friendly name in HA, which defeats the whole reasoning of HA putting the device type in the name since that gets overridden this way anywayâŠ
Ok, then name the device appropriately. E.g. âPhillips Hue Motion Sensorâ
I name individual things accordingly. E.g. East Wall Motion Sensor, Fixture Bulb 1, Fixture Bulb 2, etc. Same as you would for all the other integrations that follow this pattern.
e.g.
And if you have 9 of them in your house, in each room one?
Kantoor Phillips Hue Motion Sensor
Slaapkamer Phillips Hue Motion Sensor
So in HA you get:
Kantoor Phillips Hue Motion Sensor Beweging
Slaapkamer Phillips Hue Motion Sensor Beweging
?
Whatâs even the point of Phillips Hue Motion Sensor AND Beweging in the friendly name, itâs completely redundant, since Phillips Hue Motion Sensor IS for motion.
Btw, not coming at you, but Iâm sincerely asking what logical alternatives there are, since this all doesnât make sense this way.
For all other devices types this didnât change anything btw. My lights, eg: Kantoor Lamp Plafond 1, still has that name. It didnât add âLampâ at the end (probably since domain is light and already clear?). It basically only affects binary_sensors since the domain doesnât tell you the device type I suppose.
See my examples above, itâs a lot easier than you think. All of the bulbs in the picture I have shown above are the same device in the same area.
FWIW ESPHOME did almost the same thing (though there entity names changed), and the only fix I found was to shift from MQTT to the API. It broke all my automations, not to mention Google Assistant, and all my web interfaces (manual edited ones). It is shown as cosmetic â it is not. Maybe itâs an ESPHOME bug, maybe not, but it is definitely not cosmetic with a key integration (or more than one).
In your situation, Iâd probably go with
Office <device model number>
, etc
The naming scheme isnât an issue with light bulbs, since those friendly names didnât change in HA.
Your proposition still doesnât make sense for binary sensor devices, since having a motion sensor called âKantoor Phillips Hue Motion Sensor Bewegingâ in HA simply doesnât make any sense. Phillips Hue Motion Sensor already tells you itâs a for motion (which is Beweging).
The issue is when you have 9 motion sensors, 13 contact sensors (9 for door and 4 window) and a few leak sensors. Basically the easiest solution is to rename all friendly names inside Z2M for HA to âKantoorâ. So you still have the Z2M friendly name as is, and in HA it just puts whatever behind it. Still cumbersome having to do this, but it is what it is.
Would be nice to see if HA just added a checkbox for MQTT devices like this to add or not add the device. Seeing as how you CAN override it by setting your own friendly name in HA entity panel, this all just seems extra unnecessarily complexâŠ
Thank you for your help and suggestions, Iâll see whatâs the best way forward for new entities!
This is how all other integrations work. Sorry itâs inconvenient for you. You could always just not change the name and change the name in your frontend based on itâs context in the frontend. Or use the area card, which will remove the device name from included entities.
Thank you for your quick replies. For future devices or installations, it wonât really matter that much. Just one extra step in my case to set the HA friendly name in Z2M for a new device. For my current installation I just uploaded my Z2M devices.yaml to ChatGPT-4 and gave it instructions to change it devices containg doors, windows etc according to my example. so it wasnât that much work to manually change each.
Unless I am missing something, appending the device name to the friendly name is a major user interface issue for me. I have a lot of kc868 relay boards and use ESPHome on them with MQTT. Now instead of âWest Outside Lightsâ and âBack Fruit Treesâ, I have âkc868-west West Outside Lightsâ and âkc868-west Back Fruit Treesâ. All I need to know is what the entity is, I donât care about the device. How do I revert this without hand editing 80+ entities in HA?
That sounds like a horrific workaround, but I would like to see it.
I reverted my HA install to 2023.7.3 to get the old behavior back. I am hoping that someone will realize that if the device friendly_name is not specified, the name (or device ID) is not something people want forced in the UI.
I was not referring to you workaround, the horrific part is something that complicated is needed at all. Itâs basically exporting every device, editing them, them importing them again. If doing that is the âofficialâ way to handle using an ESP multi-relay/sensor board, yikes.
I upgrade now my z2m to â1.33.0â and the messages appear:
Logger: homeassistant.components.mqtt.mixins
Source: components/mqtt/mixins.py:296
Integration: MQTT (documentation, issues)
First occurred: 20:03:49 (1 occurrences)
Last logged: 20:03:49
MQTT device name is equal to entity name in your config {âavailabilityâ: [{âtopicâ: âzigbee2mqtt_EDGE/bridge/stateâ, âpayload_not_availableâ: âofflineâ, âpayload_availableâ: âonlineâ}], âbrightnessâ: True, âbrightness_scaleâ: 254, âcolor_modeâ: True, âcommand_topicâ: âzigbee2mqtt_EDGE/Lampadas Movel/setâ, âdeviceâ: {âidentifiersâ: [âzigbee2mqtt_12210510398101101501091131161169569687169_2â], ânameâ: âLampadas Movelâ, âsw_versionâ: âZigbee2MQTT 1.32.1-devâ, âconnectionsâ: []}, âjson_attributes_topicâ: âzigbee2mqtt_EDGE/Lampadas Movelâ, âmax_miredsâ: 500, âmin_miredsâ: 153, ânameâ: âLampadas Movelâ, âschemaâ: âjsonâ, âstate_topicâ: âzigbee2mqtt_EDGE/Lampadas Movelâ, âsupported_color_modesâ: {âcolor_tempâ, âxyâ}, âunique_idâ: â2_light_zigbee2mqtt_EDGEâ, âoptimisticâ: False, âwhite_scaleâ: 255, âhsâ: False, âencodingâ: âutf-8â, âflash_time_longâ: 10, âpayload_not_availableâ: âofflineâ, âavailability_modeâ: âlatestâ, âenabled_by_defaultâ: True, âxyâ: False, ârgbâ: False, âcolor_tempâ: False, âpayload_availableâ: âonlineâ, âretainâ: False, âqosâ: 0, âflash_time_shortâ: 2, âeffectâ: False}, this is not expected. Please correct your configuration. The entity name will be set to null
And now ?
I found out. the problem is with the z2m edge.
But the problem is that it has already been uninstalled and still has the same message.
What do I do ?
Hi, Im having the same issue only for my PS5:
MQTT entity name starts with the device name in your config {âavailabilityâ: [{âtopicâ: 'ps5-mqtt/âŠ
Is there any update on this?
Has that been reported to the developer of whatever is generating those MQTT Discovery messages?