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
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.
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.
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).
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
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?
EDIT:
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
EDIT2:
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?
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…