Tasmota not getting messages from MQTT

  • Platform information:
    • Hardware: CPUArchitecture/RAM/storage
      Pi 2 B
    • OS: what OS is used and which version
      Latest, +/- 2 days old now
    • Java Runtime Environment: which java platform is used and what version
      Latest
    • openHAB version:
      Latest
  • Issue of the topic: please be detailed explaining your issue:

Tasmota connected to MQTT server (visible states in MQTTLens) doesn’t receive any commands from the MQTT/OpenHAB server - no commands coming through in Tasmota console

In puTTY I can see the commands coming in under the command line, just logged into Openhabian.

In MQTTLens I can see my commands coming through the server

In Tasmota I can’t see anything coming in, only going out from Tasmota.

I’m also pretty sure I don’t have the channels, commands and other settings in OH correct and that is likely causing issues too, I can only find V1 Binding help on this part…

I need some quidance or something to copy from someone else’s setup for the following settings:

  1. Tasmota topic and full topic
  2. MQTT State Topic
    3 . What to set in channel settings - must there be a channel per sonoff?

Any help will be greatly appreciated.

Thank you for reading!

Here’s my tasmota.things file, which includes a bridge and three devices. As you can see, each channel has a stateTopic and a commandTopic. You’ll need to edit the topics to match your Mosquito and device settings.

These are all multi-outlet devices, so there’s a channel for each outlet. If your device only has one hardware switch, you’ll only need one channel.

Bridge mqtt:broker:mosquitto "Mosquitto MQTT Broker" [ host="openhab", port=1883, secure=false, username="openhabian", password="xxxxxx", clientID="OpenHAB2" ]
{
    Thing topic tasmotapsw "Tasmota Power Strip (White)" {
    Channels:
        Type switch : power1 "Outlet 1" [ stateTopic="stat/tasmotapsw/POWER1", commandTopic="cmnd/tasmotapsw/POWER1" ]
        Type switch : power2 "Outlet 2" [ stateTopic="stat/tasmotapsw/POWER2", commandTopic="cmnd/tasmotapsw/POWER2" ]
        Type switch : power3 "Outlet 3" [ stateTopic="stat/tasmotapsw/POWER3", commandTopic="cmnd/tasmotapsw/POWER3" ]
        Type switch : power4 "Outlet 4" [ stateTopic="stat/tasmotapsw/POWER4", commandTopic="cmnd/tasmotapsw/POWER4" ]
        Type switch : power5 "USB" [ stateTopic="stat/tasmotapsw/POWER5", commandTopic="cmnd/tasmotapsw/POWER5" ]
    }

    Thing topic tasmotapsb "Tasmota Power Strip (Black)" {
    Channels:
        Type switch : power1 "Outlet 1" [ stateTopic="stat/tasmotapsb/POWER1", commandTopic="cmnd/tasmotapsb/POWER1" ]
        Type switch : power2 "Outlet 2" [ stateTopic="stat/tasmotapsb/POWER2", commandTopic="cmnd/tasmotapsb/POWER2" ]
        Type switch : power3 "Outlet 3" [ stateTopic="stat/tasmotapsb/POWER3", commandTopic="cmnd/tasmotapsb/POWER3" ]
        Type switch : power4 "Outlet 4" [ stateTopic="stat/tasmotapsb/POWER4", commandTopic="cmnd/tasmotapsb/POWER4" ]
        Type switch : power5 "USB" [ stateTopic="stat/tasmotapsb/POWER5", commandTopic="cmnd/tasmotapsb/POWER5" ]
    }

    Thing topic tasmotaop "Tasmota Outdoor Plug" {
    Channels:
        Type switch : power1 "Outlet 1" [ stateTopic="stat/tasmotaop/POWER1", commandTopic="cmnd/tasmotaop/POWER1" ]
        Type switch : power2 "Outlet 2" [ stateTopic="stat/tasmotaop/POWER2", commandTopic="cmnd/tasmotaop/POWER2" ]
    }
}

When you’re creating items, the channels look like this:

channel="mqtt:topic:mosquitto:tasmotapsw:power1"

Hope this helps!

1 Like

Sounds like openHAB is not connected to the mqtt service. Tasmota and openHAB have to use the same mqtt broker.

1 Like

What mqtt broker are you using, the embedded one or other(mosquitto) and is it installed on the same device as OH?

1 Like

Hi, Thank you!

Looks like you have a tasmota.things file? Is this still for OH version 2?

Thanks for the info above, it’s a big help to the right direction!

Hi,
Thanks for replying, OH is talking to Mqtt and Tasmota is talking to Mqtt but the messages aren’t going to Tasmota or Tasmota is simply ignoring them.

Hope I’m making sense

Hi,

Thanks for the reply, I’m using the built in Mqtt server, installed from openhabian-config, optional software. I think it is still Mosquito.

It sounds as if your topics are incorrect. Can you list topics?

2 Likes

Yep, I’m on OH 2.5. As @Thedannymullen says, it would be helpful if you showed us your work so that we can help you debug it.

2 Likes

Im just about to be at this stage, needing to get all my tasmota stuff working. I just am having issues with MQTT connecting, or im confused on which mqtt server i should use… I have insalled it on my windows PC, and through the config menu on the Pi, Here is the link to my thread, or if anyone here can let me know what direction i should go…


Im looking forward to having the problem from this thread next! lol.

Hi,
Sorry I’ve taken so long to come back, we’ve has some mild internet issues here.

It definitely seems I’ve got some things wrong…!

Here is the item from my .items file:

Switch          GF_Office_Light         "Light"                  <light>           (GF_Office, gLight)         ["Lighting", "Switchable"]   {channel="mqtt:topic:bd3a065a:bd3a065a"}

Looking at the channel syntax in your item do you have simple mode turned on? If so please turn it off and delete the item that was auto created.

1 Like

Thanks, I reverberate seeing an option for easy mode, I’ll look for it now and report back shortly.

If you use PaperUI to create the Things (FYI, you can not have things in both files and PaperUI) then you can copy the channel info (to use in your Items file) and the syntax will be correct. BTW, this is the recommended way due to errors with channel syntax.

2 Likes

Thanks, This is a new menu for me so I’ll have to figure it out, it’s not making sense to me just yet.

So I have turned off Easy mode and recreated my generic mqtt thing.

I also forgot to add this screenshot, this is what I am seeing on mqtt Lens:-

Screen shot has the topic as tele/myhome/sonoff1/$homie have you tried that in the config?

1 Like

Do you mean in the Tasmota config? I didn’t think of it, I’ll try it after dinner and report back.

Thanks!

Hi!

I made some changes as per your suggestion and I’m now getting some reaction from Tasmota on the console!! It is saying " {“Command”:“Unknown”} " but at least it is receiving a message!

It is working!!! Thank you for the above screenshot of your setup, it hit that final nail in and started to work!

Very much appreciated!