Setting up Tasmota with Embedded MQTT broker

Afternoon!

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.

MQTT Lens can switch the S20, broker works fine then.

My trouble is when trying to add controls for it to Openhab2

I created two items for the S20:

String S20_90_Reachable "Online: [%s]"    {mqtt="<[mqtt:tele/S20_90/LWT:state:default]" }
Switch S20_90  "Switch:"                  {mqtt=">[mqtt:cmnd/S20_90/POWER:command:*:default], <[mqtt:stat/S20_90/POWER:state:default]"}    

Now I understood from related topics that I should also define things in the Things folder. However…

  • I couldn’t find how to define the embedded broker as a thing.
  • If I can immediately make the Sonoff thing, how to reference the broker?
  • I also can’t find the Generic MQTT thing from the documentation. It doesn’t appear in the Paper UI.

In virtually all the documentation people seem to use Mosquitto, so how to configure in the case of the embedded broker? I couldn’t figure it out from the documentation (https://www.openhab.org/blog/2018-12-16-mqtt-arrives-in-the-modern-openhab-2-x-architecture.html etc)

Thanks in advance,

Ward

You are using the MQTT1 syntax for your items. Please read the examples for the new architecture, all new examples use that.

Simple, don’t do it :grin:

Honestly, there is virtually no advantage except configurability via Paper UI. A basic installation already gives you everything that the embedded broker would provide.

1 Like

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.

Thanks & best regards

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.

Hm. Because of that high support demand due to lack of knowledge of average users I will change the label of the embedded broker. Sigh.

I propose: “MQTT broker (just a broker, no Things!)”

I have no other idea to fight this lack of interest of people reading about the topic.

It also doesn’t help that paperui is not showing the description below the label.

1 Like

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.

John Frankforther

4 Likes

OH 2.5 has full autodiscovery for Tasmotas though :slight_smile:
(And hopefully also a Paper UI replacement that is easier to grasp.)

Quite the contrary. My opening post is totally about how to define the necessary things.

Now I understood from related topics that I should also define things in the Things folder. However…

  • I couldn’t find how to define the embedded broker as a thing.
  • If I can immediately make the Sonoff thing, how to reference the broker?
  • I also can’t find the Generic MQTT thing from the documentation. It doesn’t appear in the Paper UI.

In virtually all the documentation people seem to use Mosquitto, so how to configure in the case of the embedded broker? I couldn’t figure it out from the documentation (https://www.openhab.org/blog/2018-12-16-mqtt-arrives-in-the-modern-openhab-2-x-architecture.html etc)

Don’t quite see how posting a question shows a lack of interest.

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.

Thank you

John

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.

John

Hi John!
This is what I got up and running:

  • 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?

On this setting, I turned it off so I could approve it manually. If I remember correctly, this is where I got stuck originally.

You can post screenshots here. Just upload using the Upload button next to the </> button in the message box.

@David_Graeff

(Setting up Tasmota with Embedded MQTT broker)

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?

John

You are on oh 2.5m1. oh 2.5 is not yet released :wink:
The changes are in no milestone release yet.

openHAB 2.5.0~S1557-1 (Build #1557)
This is what it says when I ssh in If I’m looking in the right place.