MQTT to OpenHAB stalls after time

My OpenHAB system was running fine for several years. However no I moved to a new place and I added a lot of Shelly around the new flat.
Since the beginning I use a separate mosquitto broker and it worked fine.
But now and I don’t why OpenHAB won’t update any Items that are linked to an MQTT item. It somehow stalls after a given time and only continues to display or save values when I restart the MQTT broker binding. When I directly connect to the mosquitto broker via “MQTT Explorer” I see the values updating etc. but somehow OpenHAB are not subscribed any more to all the topics… I can’t see a disconnect in the mosquitto log files so OpenHAB is still connected

Any idea what might cause this?

I may have noticed the same thing every once in awhile, but only with some of my MQTT things/items and not others. I’m still using text files for config, so I just remove the thing, save, and then add it back to get it working again.

thx but that’s not a solution for me.
Is OpenHAB too slow to handle new data over mqtt once every 1-2s?

What version of OH are you running?

This implies a very old version?

I have 2.4 and 3.2 running here, and MQTT handling in 3.2 is a lot more robust than in the previous version.

3.2.0 - Release Build, “running fine for several years” just means never had any problems with this kind of setup.

Ah. Okay, then it’s not that. I haven’t seen the same thing in 3.2 yet but I might have been lucky. In 2.4 I see things like this all the time. A single unsubscription can hose the entire MQTT binding and require re-starting the binding by disabling and re-enabling.

I wasn’t suggesting it as a solution, just comparing experiences. But I see why you read it that way.

Sorry for that, I’m just a bit puzzled that openHAB or mosquitto I’m not sure who is responsible for this problem is acting so strange…

No worries. If Mosquitto is still processing messages, then it’s not the problem. As you noted earlier, for some reason openHAB just stops picking them up.

I suggest setting your logging for the MQTT binding to DEBUG to see if there are any unusual messages the next time it happens. I’d also be curious if it’s all of your MQTT things, or just some of them (as with me).

The same Item, all Items, or random Items?

How are your MQTT Things configured? Manual? Homie? Home Assistant?

What device is openHAB running on? What device is Mosquitto running on?

You’ve moved to a new place. New router from the ISP? New network? Do your devices have a reserved IP address?

Any other technologies with openHAB? Zigbee? Is this continuing to work fine?

All items taht are linked to a MQTT topic fail

They are configured manual

openHAB is running on a VM on a proxmox machine
Mosquitto in a Linux Container on the same proxmox machine

Same ISP, same Network
Zigbee yes but over MQTT.
There are a few scripts that directly sends data via REST to openhab and they do work even after MQTT fails

Can you share your Bridge configuration please?

And these Items also fail, presumably?

UID: mqtt:broker:mosquittoDebianBroker
label: MQTT Broker lxc
thingTypeUID: mqtt:broker
lwtQos: 1
publickeypin: false
clientid: 5c0aa775-86ea-4b7a-9d34-155566c24c39
keepAlive: 60
secure: false
certificatepin: false
password: *****
qos: 1
reconnectTime: 60000
port: 1883
lwtRetain: false
enableDiscovery: false
username: ****


Can you confirm that there is nothing else in your network that uses this ClientID when connecting to Mosquitto?

yes they have all different IDs. Most of them are more readable than the one OpenHAB got / uses

EDIT: Maybe I’m going to change it to a more readable ID

ok now it just happend again after 3h of last restart of the binding.
I can’t see anything in the openhab logs and nothing in the mosquitto logs.

I post around 1 min logfiles since I know it happend exactly at 11:46:38

Here is the a log abstract of 1min of the mosquitto log file:

And the log file from openhab:

in the log file form openhab you can clearly see that the sensor value “ShellyServerPM_Power” stops reporting after 2022-05-13 11:46:38.648.
This sensors sends every 1 to 2s data so that is why I know it failed at 11:46:38

And in the mosquitto file you can see that the same value is received at 2022-05-13T11:46:42 so past the openhab binding “crash”

Any guess?

However I just discovered that some data still get to OpenHAB. Sensors that do not report that often maybe once every 10 to 30min. That’s why I first wrote that no data is collected by OpenHAB once the binding “crashes”. I can say that around 1-2% of the data coming from mosquitto lands in openhab after the “crash” and not more so hardly any data.
And as mentioned a simple pause and resume of the broker binding

How can I get more Log infos from the mqtt bindig? I set this in the opnehab console
log:set DEBUG org.openhab.binding.mqtt
What else should i log?

What do you think the cutoff is? What’s the shortest update interval that continues to work?

No idea but i will try to stop those devices that sends at a short interval and see if it gets better

so after disabling two MQTT devices there was no stall of OpenHAB (those were publishing data every second).
Now I got an additional script running that filters the data coming from the MQTT device and publish it on a different topic where OpenHAB is subscribed to.
And after 1.5 days no stall at it’s working flawless!
So it seems that opneHAB can’t handle that much data over the MQTT binding and after filtering the data all is back to normal

I have a very similar setup to you using Proxmox, except openHAB is in an LXC container rather than a VM. I’d be interested to try this out to see if it happens on my system to.

Do you have an example payload published by your devices, and what’s the publishing interval? Can you also share the Thing configurations for these devices? I can setup a script to mimic the behaviour and see if openHAB falls over…