PSA: MQTT Name changes in 2023.8

What is the impact on ESPHome?

Currently, I have several remote ESPHome devices connected via MQTT. The entity names for those devices are prefixed with the device name and I am getting similar messages this time.

Should I change the entity name in ESPHome and update the firmware for these existing devices?

1 Like

I agree that this has been handled really poorly. In the end, this wasted a lot of everyones time, but no big issues coming out of this. I hope Nabu Casa learns from this for future releases. And thanks to @petro ro for clearing stuff up.

2 Likes

Hrmm. z2m was supposed to be unaffected, yet somehow mine has had itā€™s guts fall out.

All my devices (bar one) have disappeared from the z2m dashboard. The remaining one has lost itā€™s configuration.

Iā€™m not sure what happened. Perhaps not entirely related to this change.

I installed 2023.8, noticed that my SleepAsAndroid MQTT (and HASS AGENT, I think) stopped working, so attempted to restore a backup. Which failed for whatever reason I didnā€™t catch.

So I decided to be patient and let them be broken for now, and went ahead installing 2023.8.1. After which I noticed the above issue, that my entire zigbee network was essentially empty from within z2m (edge branch, last updated who knows when last year).

The devices/entities for the missing z2m devices all appear within my mosquito broker with This entity is no longer being provided by the mqtt integration. and I no longer get the repair warning list containing these devices.

No idea what caused this, or if it can be quickly fixed. Restoring a backup of the add-on did not resolve the issue. I have to assume that my zigbee co-ordinator itself was wiped somehow? Rebinding, naming etc several dozen zigbee devices is going to be a nightmare.

I wonder if anyone else has experienced a similar problem.

If they have disappeared from the z2m dashboard, it has nothing to do with name change.

Do you have older backups ?

2 Likes

That is unrelated to this change. Whatever your problem is itā€™s entirely within Zigbee2MQTT and you should start a fresh thread.

2 Likes

Yeah my apologies, figured that might be the case. Posted just in case I was missing some linking cause, as updating to 2023.8 was the initiator for my problem to appear.

I was also worried about this change and have a lot of (now ignored) warnings.

But I upgraded the MiFlora-mqtt-Daemon (GitHub - ThomDietrich/miflora-mqtt-daemon: Linux service to collect and transfer Xiaomi Mi Flora plant sensor data via MQTT to your smart home system, with cluster support šŸŒ±šŸŒ¼šŸ„€šŸ”šŸŒ³) and the warnings for MiFlora sensors were gone after a restart of HA.

Now waiting for an upgrade of Zigbee2MQTT

My Ā¢0 this topic. The HA announcement and warning itself are far from clear and MQTT docs are not updated at all. And this is the ONLY complain from me.

I run my own MQTT device with discovery, so I googled around and found this topic. It makes everything clear but only if you can ignore most of whining. It looks like only handful users actually understand the case.

For me the change is very logical and welcome. It makes device name important and part of entity name but also removes some unnecessary duplication. It is also well engineered as it doesnā€™t change any existing entity id (unless discovery message shows it like a new device).

I donā€™t understand users who call HA developers to let device developers ā€œfixā€ their software beforehand. You canā€™t change MQTT discovery messages before HA change without big negative impact in entity names. Think about it and you can figure out yourself (or read along) what would happen in this case.

Only possible problem I see here is with users who donā€™t upgrade HA. After MQTT discovery message change in their devices (or running newer version of Zigbee2MQTT or other software), their entity naming for new devices will be quite bad because HA versions before 2032.8 didnā€™t add device name to the entity name.

Assume your device name is ā€œDeviceā€ and sensor name is ā€œSensorā€. Depending on version of HA and MQTT discovery message, this is what happens:

  • Old MQTT, old HA: sensor.device_sensor
  • Old MQTT, new HA : sensor.device_device_sensor ā† this is what a warning is about
  • New MQTT, new HA: sensor.device_sensor
  • New MQTT, old HA: sensor.sensor ā† this is what happens when other devs change before HA

Now when you are in the last combination all your new temperature sensors will be just temperature_2, temperature_3 and so on with all called just ā€œTemperatureā€ instead of kitchen_temperature or shelly_livingroom_temperature.

Sorry for this long post.

7 Likes

Iā€™ve read the entire thread however I just want to be clear as 99% of everything in my house is MQTT.

All of my MQTT entries are manually defined like:

mqtt:
  light:
##################SHOP INTERIOR
    - name: "Shop Light South"
      state_topic: "/shop/r7_s/"
      command_topic: "/shop/r7/"
      payload_on: "1"
      payload_off: "0"
      qos: 0
      retain: true
    - name: "Shop Fab Light"
      state_topic: "/shop/r6_s/"
      command_topic: "/shop/r6/"
      payload_on: "1"
      payload_off: "0"
      qos: 0
      retain: true

So this does not effect me because I donā€™t use any MQTT autodiscovery?

It affects you if you make devices in YAML, otherwise, No. When I say devices, I mean devices: in the literal sense, not your YAML MQTT entities.

1 Like

I think Iā€™ve corrected all my devices that publish HA discovery messages to MQTT. After Iā€™ve clicked ignore for the warning messages, is there a way to retrigger the check to confirm Iā€™ve fixed them correctly?

Wel, I took action. Tried to restore full backup from before the upgrade. Didnā€™t work. Took me a full day to get it up and working again. Was not amused!

You can look for warnings in the logs. Also, you can un-ignore the repair from the repairs menu by showing hidden repairs.

1 Like

Iā€™m using HASS.Agent and corrected sensor names. After which, I noticed in HA settings, duplicate sensors were created, this time with ā€˜mqtt_ā€™. All my original sensors, which I corrected the names for, suddenly do not work. Iā€™m so confused by this change. Honestly, itā€™s changes like this that make me want to not spend my hours working w/ HA any longer. Iā€™ve been a huge supporter, use HA Cloud, etc.

1 Like

If you read the main post, youā€™d notice that you canā€™t do anything other than contact the upstream dev to fix their software. And click ignore on the repair.

3 Likes

did you make any progress with this? espresense hasnā€™t indicated they are aware of the problem that I can find.

Hi, Iā€™ve received the error messages and spent three hours ā€œresolvingā€ the reported errors i.e. making the entity_id names unique from the MQTT names AND having to change EVERY Automation and Script where each entity_id is used. Three hours of my life, which will NEVER be recovered.
I do not blame this Developer - I blame the HA Core Developer(s) who have made this necessary:

  1. What is wrong with having the SAME entity_id name and MQTT name?
    It seems sensible to use the SAME name to co-relate the entitiy_id with the MQTT name.
  2. Having the SAME entity_id and MQTT name has been working without fault for a long time so what is the fault that has to be fixed?
  3. Have these HA Core Developer(s) not heard the adage - ā€œif it ainā€™t broke, donā€™t fix itā€?
  4. It appears to be change for change sake or pedantry but no useful purpose - the worst sort of Development change!
  5. Where is Change Control in the Home Assistant Core?

Where can I register a complaint about this apparently unnecessary action on the part of the HA Core Developer(s)?

As you can probably guess; the waste of three hours of my life for no genuine purpose is NOT appreciated, so please excuse me for my rant.

Many thanks
Joe.

2 Likes

Please read the first post, it explains how you handle this. Also, please understand that Name does not equate to entity_id.

i.e. this does not change your existing entity_idā€™s, so you donā€™t need to change any automations, scripts, etc.

1 Like

Hi Petro,

Firstly, thank you for your very quick response.

I hadnā€™t seen your post when I received and addressed the ā€œissuesā€ listed in the Error messages. Had I done so, I could have just Ignored the Error messages as you advocated.

Thank you for pointing out that Name does not equate to entity_id. This highlights my error in writing this post: The Error message states ā€œSome MQTT entities have an entity name equal to the device nameā€, so I should have referred to entity name NOT entity_id.

Your last two points are appreciated - if only I had seen your Post BEFORE receiving and dealing with the Error messages.

Best regards to you for 1. Your warning Post (which I didnā€™t see in time), for your excellent Response Time (which is very much appreciated, and for your Informative response.

Joe.