Tasmota / MQTT discovery not working

Hi all,

Having a few problems getting auto-discovery working with my first tasmota device on a pre-existing HA installation. Here’s the current situation:

  1. MQTT (mosquitto) installed and working (I already use for other, bespoke integrations)
  2. The “enable newly added entities” option is enabled in the MQTT integration
  3. Tasmota device flashed and configured for both wifi and MQTT
  4. I have issued the SetOption19 1 command on the tasmota device
  5. I have subscribed to the topic (homeassistant/switch/2579D0_RL_1/config amongst several others) where the tasmota device is sending data using the MQTT integration UI and can see the following being pushed to HA’s broker:
{
    "name": "snug_lamp snug_lamp",
    "stat_t": "tele/snug/lamp/STATE",
    "avty_t": "tele/snug/lamp/LWT",
    "pl_avail": "Online",
    "pl_not_avail": "Offline",
    "cmd_t": "cmnd/snug/lamp/POWER",
    "val_tpl": "{{value_json.POWER}}",
    "pl_off": "OFF",
    "pl_on": "ON",
    "uniq_id": "2579D0_RL_1",
    "dev": {
        "ids": [
            "2579D0"
        ]
    }
}

(yes, the names and stuff are a bit odd - just want to get one working end to end and will then go back and sort it out properly!)

At this point, I would expect the entity to appear, but I can’t find anything relating to this device in HA. Nor can I see anything in the logs relating to this.

Any suggestions on where to look next? Have I missed something…?

1 Like

Problem solved, thanks to the guys on digiblur’s discord. You need to go into the MQTT integration and do a “reconfigure” to enable MQTT discovery, despite the UI suggesting that it’s already done. Once this was done, it all sprang to life.

5 Likes

Can you explain a little more? What do you mean by ‘reconfigure’?

Enable discovery is ticked in my MQTT options (Integrations -> MQTT configure -> re-configure MQTT -> Next), and I’ve tried toggling it, but Discovery is still not working.

I have gone into the /etc/mosquitto config files and setup separate users with individual passwords, and each of the individual users work fine. I can send commands to my Tasmota device from Home Assistant’s MQTT Integration. I can also subscribe to the device’s messages in the MQTT Integration and see their payloads when I operate my Tasmota device through its web UI. Using MQTT Explorer, I can see all the above as well as the telemetry messages.

However, nothing comes through the tasmota/discovery/# topic.

Did you flash tasmote-lite.bin or Tasmota.bin ?

Tasmota.bin, using tuya-convert (which I cloned a week ago). However the program version suggests it’s lite.

Program Version 9.2.0(lite)
Build Date & Time 2020-12-17T10:06:08
Core/SDK Version 2_7_4_9/2.2.2-dev(38a443e)
Uptime 0T00:26:10
Flash write Count 532 at 0xF8000
Boot Count 31
Restart Reason Software/System restart

MQTT No Retain Disabled

Emulation None
mDNS Discovery Disabled

Flash Size 1024kB
Program Flash Size 1024kB
Program Size 476kB
Free Program Space 524kB
Free Memory 28kB

@francisp : Thanks for taking a look at this.

I have the option to Upgrade Firmware on the device.
Should I use that to flash a different firmware version? Can you suggest a link?

tasmota.bin from

http://ota.tasmota.com/tasmota/release/

paste this in your ota field:

http://ota.tasmota.com/tasmota/release/tasmota.bin

1 Like

@francisp : Awesome!! It upgraded to 9.5.0 and it’s working in HA now. :slight_smile:

This version actually allows me to turn off the entire powerboard (even the ‘always on’ plug)… oops.

Thanks for posting the solution (and to digiblur for providing it to you). Still paying dividends 2+ years down the track. Kudos.

1 Like

this just fixed a problem for me too :slight_smile: