I have installed binding-mqtt - 1.9.0.b4 and have setup a switch, that posts a 0 or a 1, every time the switch changes status.
The problem is, that the MQTT channel, received the first 5-7 on/off commands, and then it stops sending them.
If i wait 30 seconds, and then press it again, i might get a couple of more commands thru, but it’s not every time, and its not consistant.
Using an external MQTT client, i can publish 1000 commands, to the same channel, without any problems.
So i’m 100% sure, that the problem is in the Openhab2 Binding.
Any ideas on what to do ?
I have tried to reinstall, but that did not change anything.
Don’t think so, mine is working very reliable with openHAB2.
What do you mean by [quote=“Robert_Jensen, post:1, topic:16844”]
I have installed binding-mqtt - 1.9.0.b4
Where did you get that version? If I look into my version number, it says 1.9.0-snapshot. And if I do a
bundle:list on the Karaf console, it says
201 | Active | 80 | 18.104.22.168611160214 | openHAB MQTT Binding
bundle:list and check if you have more than one MQTT binding active …
I have noticed that occasionally openhab doesn’t send MQTT messages if you toggle switches too quickly. Generally this just seems to a time delay in processing, i.e. if you wait the first command gets send. It seems that if openhab gets delayed processing the first change, then any subsequent changes are lost. Have a look at the logs- the event log should show the switch changes and the openhab log any errors.
I suspect he has installed the Beta4 rather than the nightly snapshot version of OH 2.
Look at the openhab.log or tail the log in the Karaf console to see if the binding is reporting that it is losing its connection then reconnecting all the time. You could also consider upgrading to the snapshot version of OH 2 to get the latest fixes. In my experience I find the snapshot to be no less stable than the last beta.
Personally I find MQTT to be pretty stable. I’ve had a few issues where if I restart the broker OH fails to reconnect, but once corrected it stays connected for weeks at a time.
You are completely right.
I’m running the Beta4, and not the nightly build.
I just changed my apt source, to the nightly build, but after doing an apt-get upgrade, i did not get any updates. So not sure, if i’m doing something wrong there.
I’ve never done the switch. In fact I’m running in Docker so I really don’t have any experience with apt-get installs for OH 2. I assume you did an apt-get update first. Maybe if you do an apt-get install --reinstall openhab2-offline (or online) it will force it.
The solution was the following.
apt-get remove openhab2-online
Change repo from beta to shapshot
apt-get install openhab2-online
Reinstall all bindings etc.
Apt-get remove, keeps configurations. So all my configurations was working, as soon as i installed the bindings again.
mqtt is now 100% stable
Thanks for your help.
I have corrected the typo.