I installed Openhab on Pi3.
I installed Mosquitto on first installation setup secreen but There is nothing in mqtt.cfg.
After that mqtt binding (2.4) and Embedded mqtt broker (2.4) installed on paper ui. but there is nothing in mqtt.cfg again.
I don’t have different device for mqtt. So openhab and mqtt ips are same. There is nothing in my inbox. I added manually Mqtt Broker. Is it normal?
I am trying add Sonoff Th with am2301. And I added but It is’not seen right;
Read MQTT documentation and the subpage for “MQTT Things and Channels Binding”. If you have understood that process and you do have further questions don’t hesitate search in the forum (this has been asked and answered several times) or ask again.
I read MQTT documentation but there is no detailed information. And I searched in the forum but I didn’t find anything about my problem. And then I asked here.
If you know the topics you mentioned, you can send the link
Well, if you set up all the settings correctly, as described in the documentation, then yes. Configuring also means you have to click the “Configure” button and fill in the fields there
Is it openHABian? Then the setup screen would be openhabian-config.
Yep, that’s right, configuration for mosquitto is to be found in /etc/mosquitto/ (mosquitto.conf and maybe additional configuration in ./conf.d/)
That’s perfect.
Don’t install both mosquitto and Moquette (that’s the embedded broker) as both will try (and one will fail) to use the same port 1883
Correct. The file mqtt.cfg is for mqtt1 Binding only.
If there is a running broker and avahi does work as expected, the broker should be found by autodiscovery, but as far as I remember, I had to create the bridge manually, too. What is mqtt ips? Do you mean openHAB and the MQTT Broker are both on the same machine? That’s a common installation.
First you have to create at least one mqtt generic thing (or use homie or homeAssistant compliant devices - afaik tasmota does provide homie standard).
Channels are created as part of the Thing (or are autodiscovered when using homie or homeAssistant).
AFAIK the bridge has to be created manually, for sure if one is using the Generic Things.
@onkal
As you see in the example files from @H102 you do need a bridge (the broker thing you have created on PaperUI, hopefully with correct settings) AND you need a generic MQTT thing (representing your actual sonoff device) which connects to this bridge. Using files this connection is done by the above used syntax, on PaperUI you need to select the already created broker thing.
On this generic MQTT thing you need to create the channels ( switch and two numbers).
Having done that via file you would need to restart openHAB or at least the mqtt bundle ( that is a known bug of 2.4 which is already solved in more recent versions).
Thanks @opus for adding the info about steps needed in PaperUI and the need to restart OH after making a change in files. I was looking to see the best way to give an example but you summed it up very well.
I’ve actually made all the suggestions. There was a problem like the screenshot I added in my first message.
But I guess my first wrong that I installed both mosquitto and Embedded mqtt brokers. I will edit it and write it back.
Thank you, everybody.
Correct, In PaperUI > Addons > Misc click uninstall on the Embedded mqtt broker. Under the Bindings tab scroll down and uninstall the Mqtt binding. With both uninstall I would stop OH from command line with sudo systemclt stop opanhab2 then clean the cache with sudo openhab-cli clean-cache then either restart with sudo systemctl start openhab2 or reboot sudo reboot. I mentioned the reboot b/c there have been times a reboot fix my issue.
After that you can return to PaperUI and install mqtt from the addons > bindings tab. If you have the “include legecy bindings” option turned on and want/need the mqtt 1.x version you can install it as well. Also, as mentioned above, if you plan to use the 1.x version you will also need to configure the mqtt.cfg file. Using the 1.x version IMHO would be b/c you just want to and not something that’s required (I say this but there may be some odd situation that needs 1.x version).
In your Items; ... { mqtt="<[ ...
is the syntax for MQTT binding version 1.
This will never work with MQTT binding version 2, which works with Things and channels.
You had channel links configured before, don’t know why you changed that.
Hey @onkal it seems you struggle really hard.
I don’t know which timezone you live in (I’m UTC+1).
If you want to we can arrange a screen sharing or Anydesk session so I can assist you.
BUT
I am sure with careful reading of the docs of the mqtt binding 2 it can be done.
Even a simple YouTube the search “openHAB mqtt binding 2” gives you full german/english tutorial. @MK-SmartHouse in this example tutorial even uses your tools (MQTT.fx).
It’s a full STEP BY STEP tutorial!
Cheers,
Elias and big thanks to @MK-SmartHouse for making such amazing YouTube tutorials!