Homie [MQTT] Device does not initialize properly from retained messages

I have an ESP32 based board that should follow the Homie convention. The device sends Homie MQTT messages at startup (I have verified the messages with the Homie validator and they verify successfully).
All of the messages are sent with a retain flag (I have verified the flag to be set). My mqtt broker is mosquito.

When I add the Homie MQTT Thing, I get the following message:

Status: OFFLINE - COMMUNICATION_ERROR java.lang.Exception: Did not receive mandatory topic value: homie/GFBlinds/$name

If I reboot the device, so that the Homie messages are resent, the device comes online with all of the properties. I get the same message if I disable and enable the Thing, I get the same error message as above.

I have searched through the forum and the web, but could not find any solutions. Any ideas what might be wrong?

Have you verified that the homie/GFBlinds/$name is populated with a retained message? Which version of Homie are you using?

If the answer to the first is “yes” and the second is 3.x or later please file an issue on the binding at https://github.com/openhab/openhab-addons.

Thanks Rich! Yes, the message is published as retained. I also checked the flag value on mosquitto. Version of Homie is 3.0, but since it’s my own implementation, I would still allow a possibility I missed something.

I’ll try to review the openhab source code (I’m not too good at it, but probably worth trying) and enable mosquitto logging to ensure I did not miss something and get as much info as possible before opening an issue.

Which version of OH are you running? There have been recent changes to the MQTT/Homie binding.

I am running openHAB 2.5.3 Release Build. I have just noticed someone opened an issue around the time of my initial post: https://github.com/openhab/openhab-addons/issues/7252, so I added a comment with a mosquitto log that might show where the issue might be.

I used to have that error but it went away with 2.5.2 - wonder if something changed in 2.5.3?