I’ll just ask if anyone has any ideas. In openHAB 2 I still used the Legacy 1.x binding for MQTT for a long time. It works stably. With this rule I have occasional problems that some things have to be sent out twice. Has anyone here had similar problems and a solution? Otherwise, the principle works with master and slave and vice versa.
So thank you very much for your suggestion.
Cloned my VM and then upgraded to openHAB 3. I hoped that the rule would work in the same way. The rule is at least displayed as being present. But with mosquitto_sub -v -h localhost -p 1883 -t ‘#’ I can’t see that anything has been published, even after status changes.
In my opinion, this can be due to two things and maybe someone here can help me. Either a difference between the bindings MQTT2 and MQTT3. Or differences between openHAB 2.5 (where it ran) and openHAB 3.
Off course I looked inside the MQTT 2.5+ Event Bus topic. The Rules DSL does not work either. Jython works.
I found Jython more cumbersome. I also adapted the mqtt_eb files a bit to create a solution similar to the one above. Unfortunately, it doesn’t work nearly as well as this rule in openHAB 2.
My first insight seems to be that the rule DSL does not work. Maybe someone can confirm this for me. Since I got a few things to work unstably in Jython, I am now simply trying out certain adjustments that I can take from https://github.com/openhab-scripters/openhab-helper-libraries/pull/257. My first attemp does not work either.