I’m running into a lack of knowledge trying to make Sonoff S20 with Tasmota play nice with Openhab2.
I decided to go for the embedded broker & don’t use Discovery.
Honestly, there is virtually no advantage except configurability via Paper UI. A basic installation already gives you everything that the embedded broker would provide.
That configurability in the Paper UI is quite mysterious, I’m not able to add this ‘Generic MQTT thing’.
Conclusion seems to be that Embedded is a no go.
The Generic MQTT thing is completely independent from the embedded MQTT broker.
The MQTT Broker is a separately installed add-on that provides a service. It has no Things.
To actually work with the embedded MQTT broker (or any other broker for that matter), you need to install the MQTT2 Binding. Once installed you need to create an MQTT Broker Thing with the connection parameters to the broker. Only once you have this Thing can you create a Generic MQTT Thing.
I have just completed a project where I set up an ESP8266 with multiple inputs using Tasmota and the embedded MQTT binding and got it connected to OH 2.4 . I’m planning to do a writeup with screen captures for the whole project that might help new users. Maybe this will help and can be used as training material.
Oh, I hadn’t upgraded to 2.5 yet. I was just excited to finally get everything fully working in 2.4.
I’ll have to back everything up and move up to 2.5 and check it out.
Ward
Did you install MQTT from the configuration screen? That is where you have to ssh into OH with putty. Once that is done you have to add the embedded binding and MQTT binding in the Paper UI.
Then go into the Paper UI and under Configurations >Services under the MQTT tab, that is where you setup the connections to the MQTT broker. Usually the address that your RPi is located along with the password etc.
Once you do that, you should see an entry in the INBOX for the MQTT. If you click on the checkmark, if I remember right, that will add the embedded broker to your system. Then you can go into THINGS and add click the + button and add the MQTT Thing Binding. If it doesn’t find any then you have to add one manually. You can add a name for this connection then select the Bridge Selection. It should show the connection you had made. Then click on the blue checkmark. Unless I forgot something, that should create the MQTT connection you just created.
I was hoping to show all this with screen shots as time permits.
Using putty, I opened openhabian-config and installed Mosquitto
Then, I installed the MQTT binding 2.4.0
I have automatic inbox acceptance, else I would have had to approve it manually in the inbox
Connecting to the openhab folders via Samba, I created a broker thing in a new text file mqtt.things under the Things folder, with this content:
Bridge mqtt:broker:MosquittoMqttBroker “Mosquitto MQTT Broker” @ “MQTT” [
host=“192.168.0.10”,
secure=false,
port=1883,
qos=0,
retain=false,
clientid=“Oh2Mqtt2Thing”,
//certificate="",
//certificatepin=false,
//publickey="",
//publickeypin=false,
keep_alive_time=30000,
reconnect_time=60000,
//lastwill_message="",
//lastwill_qos=1,
//lastwill_topic="",
username=“openhabian”,
password=""
]
I added a Generic MQTT thing from the MQTT binding, named it “S20_90”.
I added a channel with the topics for Tasmota (stat/S20_90/power and cmnd/S20_90/power, where S20_90 is the topic I chose in the web ui for my Sonoff S20)
I linked a new switch item to that channel.
I’ll try to make screenshots, where should I post the result?
OH 2.5 has full autodiscovery for Tasmotas though
(And hopefully also a Paper UI replacement that is easier to grasp.)
Hi Dave
I up graded to OH 2.5 last week and it didn’t find any of my Tasmota controlled boards when I did a search. Is there anything special I needed to do?