mqtt-Binding only works after restarting OH2

  • Platform information:
    • Hardware: NVIDIA ION
    • OS: Ubuntu 16.04.6 LTS
    • Java Runtime Environment: Java™ Web Start 11.201.2.09-fcs
    • openHAB version: 2.4

Hi,

i’m new to OH and i want to control different things in my house with Sonoff devices. After finding out, that there where major differences between mqqt v1 and mqqt v2, my sonoff devices with Tasmota Firmware are working.

The weird thing is: Everytime i edit my .items or .things, nothing is working anymore. If i restart OH with
/etc/init.d/openhab2 restart
everything works fine. Is this normal?

My things-file:

Bridge mqtt:broker:ikarus [ host=“localhost”, port=1883, secure=false, username=“xxx”, password=“xxxxx” ]
{
Thing topic Garagentor {
Channels:
Type switch : Garagentor “Garagentor” [ stateTopic=“stat/Garagentor/POWER”, commandTopic=“cmnd/Garagentor/POWER” ]
Type number : rssi “WiFi Signal Strength” [ stateTopic=“tele/Garagentor/STATE”, transformationPattern=“JSONPATH:$.LoadAvg”]
}

}

my item-file:

Group Garagentor “Garagentor”
Switch Garagentor_Power “Garagentor” { channel=“mqtt:topic:ikarus:Garagentor:Garagentor” }
Number Garagentor_RSSI “WiFi Signal Strength [%d %%]” { channel=“mqtt:topic:ikarus:Garagentor:rssi” }

thanks a lot!

This is a known bug in the 2.4 version of the binding. It was fixed almost immediately after 2.4 was released. It is strongly recommended that if you use the MQTT binding to run at least 2.5 M1. The current milestone release is 2.5 M4.

Being out of the loop for a bit and home automation has been working fine on 2.4. Is 2.5 M1 as solid as 2.4 stable? I’m planning to add several new devices (all mqtt) in the near future and would be nice if a restart on item file change wasn’t required.

As always, thanks Rich!

It’s important to understand how the OH release process works. Every six months, there is a freeze on new features being merged into OH for a couple of weeks. At the end of the two weeks a new release is made. We all do are best to test during those two weeks but honestly there isn’t that much testing. There will be plenty of known bugs and open issues that still exist that don’t have a known solution yet.

For a milestone release, at the end of a month there is a survey to see if there are any open issues that are major problems that can be fixed. When those are worked down or just accepted a new milestone release is made.

In both cases those of us running the snapshots are usually the only ones doing any real testing. So IMHO, there is nothing special about the release. The only thing stable about 2.4 release is that it hasn’t received any updates for almost 11 months now. There is no reason to stick to 2.4 release over any of the 2.5 Milestone releases except that you don’t want to update. The milestones are as “stable” as any of the releases.

That doesn’t mean that there are not some problems with some bindings in the milestones. But those sorts of problems exist in releases as well. So whether it makes sense to move to any specific milestone depends on what bindings you are running. Watch the releases announcements to see if there is anything known to be wrong with your specific bindings.

If you are going to upgrade, I’d recommend going straight to 2.5 M4, unless you depend on Hue Emulation which is broken I believe.

1 Like

Please be aware.
There may be problems upgrading or even starting from scratch as there seem to be some problems getting beyond the Java update in the upgrade process, which will stop the process…

I have no idea if this has been fixed in 2.5M4. I have just seen several posts about the issue. And the manual fix isn´t that clear either, unless you´re used to deal with linux…
I´m stuck on M2, untill I know for sure I can get to M4.

These are openHABian issues, not openHAB issues. They are independent of the version of OH being run and have nothing to do with a specific milestone version of OH. openHABian has it’s own version numbers and release schedule independent from openHAB.

In short, the openHABian problems do not make you stuck on OH 2.5 M2. You can get to M4 right now, but I don’t know if you can do it through openhabian-config. But if you are already on a milestone you can run

sudo apt-get install --only-upgrade openhab2

or you can go into openhabian-config and change the OH version and then change it back to testing from the 40 menu.

Or you can upgrade everything installed through apt and bypass the Java issue and run

sudo apt-get update && sudo apt-get upgrade

You may be right on this, Rich… I have simply lost the overview as I tend to see lots of post about the issue, not only related to openhabian. Thats why I wrote, I´m stuck on M2 untill I know for sure I can make the update without the issue…
I ran into the issue on my second setup running Ubuntu. I had to deal with the fix there to get to M4.

As far as I recall, the apt-get update and apt-get upgrade is what openhabian is doing, when selecting to update all packages. (at least that what I understood when beeing told).

When I did that on my test setup, the upgrade process stopped with the Zulu Java hostname error. There where nowhere to bypass the java process. I had to provide the “fix” first, and then make a new attempt to upgrade, (which then bypassed the Java upgrade from the fix).

But again - On my main Rpi3B+ system I´m using openhabian (hasslefree) 2.5M2 - And I´m not sure if I upgrade to M4, if I will end up with the same error, having to deal with it again. I have seen several post about people starting from scratch with a fresh image install, and yet they end up with the problem.
I simply cant figure if this is safe or not.

If you watch what the script is actually doing, you will see that it does a wget to pull down the Java Zulu package to install and it’s that line that fails. So for what ever reason openHABian doesn’t go through apt to install Java, probably because it’s not in the apt repos for Raspbian.

Well, if it fails, it fails but it doesn’t break anything. It just fails to upgrade Java which isn’t that big of a deal. It’s not like Java 8 is seeing lots of updates these days.

The problem is with openHABian and has nothing to do with openHAB milestone releases.

I ran the update/upgrade command above and it worked without problem. If you try to run the update through openhabian-config you will see the problem independent of what version of OH you are running.

Hi,

thanks a lot!

Do you recommend to use the testing release from the repository?

BW

The testing releases are the Milestone Builds Rich mentionend:

Hi,

upgrading to the current release solved the problem!

Thanks a lot!