We are developping an openHAB binding based on the MQTT binding.
In our binding we can set the name of the broker, and the binding takes care of finding the broker and subscribing to the relevant topics.
Before the update of openHAB, we have manually defined mqtt brokers using config files, and found the matching broker iterating over
mqttService.getAllBrokerConnections()
Now, after the update, things are different. As far as we understood, brokers can now be defined directly using the PaperUI (nice feature ). Also, an embedded MQTT broker is available (which is apparently not visible for other applications except openHAB).
After updating our code to the new API of the MQTT transport binding and defining brokers only via the PaperUI, the only broker found is the embedded one. In the PaperUI, the broker shows up online, and a quick test using a openHAB rule was successful.
We still iterate using the same method (which now returns a map, rather than a list).
So, questions are:
Is the way, we define brokers, correct? And, how can we find our brokers within the binding code?
I’m pretty sure this is incorrect. It wouldn’t be that much use if it could only be used for OH to talk to itself. It should start up on port 1883 like any other broker. It doesn’t have many security features enabled at this time though so beware if you choose to use it that you don’t expose it.