Hi Ankan,
Thanks a lot for your explanations. At least, now, I understand the structure of your MQTT action with the JSONpath and the regex to filter !
After 4 hours of investigation (tests, retests, reboots, readings and almost despair), I finally made it work. I’ve not yet tried the steps with the Cloud, etc., but at least I get reflected devices between domoticz and openhab…
What helped me, if it can help others…
- read the tutorial https://community.openhab.org/t/mqtt-bi … -101/33958 including the steps 6 and 7 to test… and of course look at Ankan’s message…
- then avoid the stupid but huge mistake I made: in mqtt.cfg file, I used the default name of broker, ie:
broker.url=tcp://localhost:1883
broker.user=openhabian
broker.pwd=abcdefg
but in Ankan’s examples, he uses another name:
mqttBroker.url=tcp://localhost:1883
mqttBroker.user=openhabian
mqttBroker.pwd=abcdefg
as long as I kept the default, the domoticz devices were not detected by openhab… and once I made the change, it worked…
And I realized that Ankan had briefly mentioned that fact, but I had not understood the importance of that short statement…
The weird thing is that the test switch created as per tutorial mentioned above is still working despite its definition in items is:
Code: Select all
Switch MQTT_Test "Testing..." { mqtt="<[broker:testing/mqtt/topic:state:default], >[broker:testing/mqtt/back-topic:command:*:default]" }
thus using “broker” name instead of “mqttBroker”… I don’t know why this one is still working.
So, Ankan, thanks a lot !!! I hope I’ll face less issues with the next steps. I must admit that I find openHab far more obscure and complex than Domoticz.
As a recap for newcomers to openhab and MQTT like me, here are a couple links I found interesting to duplicate the trick from Ankan:
- tutorial on installation of openhab : https://www.openhab.org/docs/tutorial/1sttimesetup.html
- tutorial on MQQT bindings 1.x : https://www.openhab.org/addons/bindings/mqtt1/ for the explanation on filtering trick used by Ankan
- tutorial on installation of MQTT Binding which must be followed even in OPenhab 2.x: https://community.openhab.org/t/mqtt-bi … -101/33958
- comparison MQTT binding 1 and 2: https://www.openhab.org/blog/2018-12-16 … cture.html (if I ever have the time to try transposing to Binding 2.x…)