Homie not working after restart openhab

Homie was working find in my openhab installation. After restarting the openhab service, I noticed all my homie things were down.
The reason for this is:

Did not receive mandatory topic value: xxx/yyy/$name

$name is indeed mandatory, but will only be send when the homie node starts. As this node is still running while openhab reboots, no update will be send. If I restart my homie device, it works but this can’t be the final workflow.

The $name attribute is retained, so nothing have to be published I believe.

update: I’m running openhab 2.5

Which homie implementation do you use?

The homie topics must be sent retained, so they are resent by the broker if openhab reconnects to it.

2.1 QoS and retained messages
The nature of the Homie convention makes it safe about duplicate messages, so the recommended
QoS for reliability is  **QoS 1** . All messages MUST be sent as  **retained** , UNLESS stated
otherwise.

Hi, thanks your reply.

The homie implementation is use is using the python homie library (https://pypi.org/project/homie/)
My broker is mosquitto.(1.4.10).

I can see with MQTT explorer that it is sent as retained, but QoS seems to be 0.

I wrote a python library that I use with OH2.5

Thanks Michael,

this might be interesting in the future. At the moment, I don’t think the issue is the used library. I did an upgrade of my mosquitto install and was not able to reproduce the issue. As Ian mentioned, the broker should sent the attribute when openhab restarts. That’s why I’m looking into that direction.

I didn’t see that you had it working before. It could be the QoS setting. Shouldn’t be hard to find that in the library you are using.

Thanks!

Yes, it did work before upgrading from OpenHab 2.4 to 2.5. I was able to reproduce it again. I will change the qos settings and see if this will fix it.

I did some further debugging through the mosquitto logging, and I believe this is an openhab issue:

The Homie devices is sending the information with QoS 1 to the broker. The broker is forwarding with QoS 0, which indicates the subscription is done with QoS 0. To other clients, I can see that QoS 1 is used.

I’ve the exact same problem. After stoping, restarting several times either Openhab and my device, it finally worked…
I’m using microhomie (Homie 4.0.0 support) on several ESP32 devices.

I’ve got some other issues about Channels: Why do I have in PaperUI a channel greyed with a O instead of the classic blue channel. This seems to be related to the “retained” property when set to false.