Openhab Things MQTT simple Sonoff switch with Tasmota

Hi and sorry ahead. I don’t get it. Hope someone has the the right patience to let me understand.

I have following Thing in my things file:
Switch Light1 “Light 1” (House, Lights) [“Lighting”] { mqtt=">[openhabian:cmnd/SS01/POWER1:command:*:default], <[openhabian:stat/SS01/POWER1:state:default]" }

It’s a Sonoff T1 3ch Switch with Tasmota.
It appears in my basic ui but doesn’t switch at all.
In MQTT.fx it doesn’t appear when i switch but when i publish .“cmnd/SS01/POWER1” and command “TOGGLE”, then it switches on the device.
Now i was reading a lot about Bridges but don’t understand. Do i need one?

Please guys, I’m a total noob but i hope someone can set me on the right path :slight_smile:

What you have in your things-file is not a “thing” but an “item”, so it belongs in an items-file. Also, this is for MQTT1.x. Depending on your setup you may be using MQTT2.x (check which version of the MQTT-binding is installed). Then the configuration of your “Thing” and “Item” is different. If you use MQTT1.x your item should work, if the rest of your configuration is OK (e.g. sitemap and broker-config).

A Bridge is only needed when you switch the “medium” with which the information is sent. In this case you send MQTT messages via WiFi, so the “bridge” in this case is the router. If you end-device would be a ZigBee device for example you will need a bridge to “translate” from WiFi to ZigBee.

1 Like

The bridge comes into play for mqtt when using the version 2 binding. You would need a broker-thing which acts as the bridge, connecting openHAB to MQTT.

1 Like

Where can I see what Version of the MQTT-binding is installed?
My MQTT-Version is 1.4.10

How would that look like?

Version 1 does not appear in paper UI, thats version 2.

1 Like

So I need a bridge? How would that look like for my case?

Don’t let yourself be confused by words :slight_smile: “Bridges” in openHAB are normal “Things”, they are just part of a hierarchy. And if I look at your screenshot you already have the “Bridge Thing” MQTTBroker (it’s a Bridge technically, not a Thing).

Your MQTT setup is already completed and you can use PaperUI to create channels on your “Generic MQTT Thing”. On OH 2.5 you can also use auto-discovery for Tasmotas if you enable MQTT HomeAssistant support on them.

1 Like

Thanks :slight_smile:
I guess that means im on the right way?

Ive got an ERROR:
image

You have read the Mqtt binding docs? A 2.4 known error, you need to restart oh every now and then.

1 Like

The restart helped to get rid of that Error.
I can now switch from the HABPanel and i see the actions in MQTT.fx.
But its not switching from the Basic UI, which i need to work so it can communicate with Alexa. I guess my Item in the Item file doenst do anything. Any idea?

What is your setting for commandTopic and stateTopic on the channel “RoseaSwitch1”?

1 Like

you mean that?

I can switch from the HABPanel but not from the Basic UI

Does that mean it is running MQTT V3? :hushed:

The only difference to my stetup with a sonoff dual seems to be that you set the retained and is command flags.
Confirm you selected the mqtt broker thing as the bridge on your generic mqtt thing?

1 Like

I had those two flags off already.

image

I know, but the only difference to my working setup is that you have set them, which I did not.

1 Like

The library for mqtt support is version 3.x. But that doesn’t matter. The binding that uses this library is version 2.x.

If Habpanel works, Basic UI will work as well. If not, your sitemap is misconfigured but the rest works.
Please note that sitemaps are the oldest, most broken concept in OH IMO.

Those parts are not related. Alexa works if you either enable cloud support via myopenhab and tag your item with “Lighting” or “Switchable”(?) or via the hue emulation service.

You must have read wrong information somewhere. Can you point to that, so that we can fix it?

1 Like

Thats all i have in there:

Alexa is not my problem right now but the fact that it doesnt work in the Basic UI