autoSteve / acMqtt

CBus Automation Controller: Home Assistant, MQTT, Philips Hue and more (for the SHAC/NAC/AC2/NAC2)
GNU General Public License v3.0
15 stars 6 forks source link

Will stop working in Home Assistant in v2024.2.0 #15

Closed ziogref closed 1 year ago

ziogref commented 1 year ago

Home assistant has a warning that the MQTT devices will stop working and to let the maintainer to know.


Discovered MQTT entities with a name that is equal to the device name This stops working in version 2024.2.0. Please address before upgrading. Some MQTT entities have an entity name equal to the device name. This is not expected. The entity name is set to null as a work-a-round to avoid a duplicate name. Please inform the maintainer of the software application that supplies the affected entities to fix this issue.

List of affected entities:

(Lists all my cbus devices)

https://developers.home-assistant.io/blog/2023-057-21-change-naming-mqtt-entities/

autoSteve commented 1 year ago

I think I've got my head (and code) around this change. In short, the device name now gets prepended to entity names, versus the old behaviour where if the device and entity names were the same then only the entity name was used. I suppose enforcing this naming is an "improvement", but I think it more rigid / less flexible, and at odds with the principal of "If it ain't broke, don't poke".

The most sane thing I could think of to adapt was to have the device name be the "suggested area" name, e.g. Bathroom 2. By doing so, HA will drop the "Bathroom 2" in the UI name because the entity is grouped under that area.

Do let me know if that's a crapy idea. It seems to work perfectly so far at my joint.

I had to clean up a tonne of orphaned old devices in my environment (however they didn't break anything, just made my eye twitch).

Several hours out of my life on this for absolutely no benefit / improvement (save one minor bug fix while I was in there).

ziogref commented 1 year ago

@autoSteve

The most sane thing I could think of to adapt was to have the device name be the "suggested area" name, e.g. Bathroom 2. By doing so, HA will drop the "Bathroom 2" in the UI name because the entity is grouped under that area.

Do let me know if that's a crapy idea. It seems to work perfectly so far at my joint.

I had to clean up a tonne of orphaned old devices in my environment (however they didn't break anything, just made my eye twitch).

Several hours out of my life on this for absolutely no benefit / improvement (save one minor bug fix while I was in there).

I dont think this is a crappy idea, just not maybe the best idea. Since lights themselves are their own entity I now have effectively a room in a room.

e.g Living room (HA room) --> Living room (Cbus) --> Multiple lighting circuits.

Not a huge issue if all the lights were run in CBUS, but if you have other lights (e.g Phillips Hue, Zigbee, Zwave etc) it causes some separation weirdness in HA. Also if you have other non-light devices in Cbus (e.g fans) they fall under the room in a room deal

Could you not leave the Preferred name as the device name with only 1 entity attached to it? This is how Zigbee does it

e.g Kitchen Led Strip has 1 entity attached to it called "light" with its ID being "light.signify_netherlands_b_v_lst002_light_2"

Could you not follow the same with Cbus, with Preferred name, then an entity called "light" or "fan" with the cbus address as the entity ID?

Also, as I have been raising a few issues over the past week and you have clearly been spending many hours on this, I would like to send a small token your way as thank you, but there are no donate buttons anywhere that I can find.

autoSteve commented 1 year ago

This is gold. I'll consider it well.

And yeah, nah, just beer me if we're in the same city and you find me @ziogref. #melbourne. I don't want your money. Just your beer, and a good chat.

autoSteve commented 1 year ago

Hey @ziogref. I have changed the way discovered devices/enties are named.

I now set the entity name blank and the device name to the object name, instead of grouping entities in a room device. This is per the HA suggestion of using a blank entity name to end up with a sole entity for the device, so in line with the naming standard.