Tasmota Autodiscovery Not Working

I recently set up a HA system and I’ve been trying to use the instructions posted at


and
https://tasmota.github.io/docs/Home-Assistant/
to add my Tasmota devices through auto-discovery.

MQTTT broker (HA add-on) and integration is installed. Tasmota is 9.3.1 and is set with SetOption19 0. HA Tasmota integration is installed. But nothing is happening.

Any ideas why this isn’t working? Are there other setup steps I need to do that are not mentioned in these two tutorials?

Hi, there please share the logs from the tasmota console from the time the device startups.

00:00:00.050 CFG: Loaded from flash at FB, Count 17
00:00:00.055 QPC: Count 1
00:00:00.064 Project tasmota Tasmota Version 9.3.1(sensors)-2_7_4_9(2021-03-09T16:13:23)
00:00:00.142 I2C: SHT3X found at 0x45
00:00:00.768 WIF: Connecting to AP1 Linksys-WRT-2.4GHz Channel 11 BSSId 94:10:3E:05:E5:23 in mode 11n as tasmota_1C8425-1061...
00:00:03.755 WIF: Connected
00:00:04.009 HTP: Web server active on tasmota_1C8425-1061 with IP address 10.82.0.146
14:07:45.051 RSL: tele/tasmota_1C8425/INFO1 = {"Module":"Generic","Version":"9.3.1(sensors)","FallbackTopic":"cmnd/DVES_1C8425_fb/","GroupTopic":"cmnd/tasmotas/"}
14:07:45.056 RSL: tele/tasmota_1C8425/INFO2 = {"WebServerMode":"Admin","Hostname":"tasmota_1C8425-1061","IPAddress":"10.82.0.146"}
14:07:45.067 RSL: tele/tasmota_1C8425/INFO3 = {"RestartReason":"Software/System restart"}
14:07:46.177 QPC: Reset
14:07:49.179 RSL: tele/tasmota_1C8425/STATE = {"Time":"2021-03-26T14:07:49","Uptime":"0T00:00:11","UptimeSec":11,"Heap":24,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":0,"Wifi":{"AP":1,"SSId":"Linksys-WRT-2.4GHz","BSSId":"94:10:3E:05:E5:23","Channel":11,"RSSI":100,"Signal":-42,"LinkCount":1,"Downtime":"0T00:00:05"}}
14:07:49.234 RSL: tele/tasmota_1C8425/SENSOR = {"Time":"2021-03-26T14:07:49","SHT3X-0x45":{"Temperature":20.9,"Humidity":58.6,"DewPoint":12.5},"TempUnit":"C"}

Thanks!

The issue is that the tasmota device is not transmitting data through mqtt. If it was using mqtt, the logs would have sais MQTT in the place of RSL. This usually happens because of errors while compiling. Did you use a pre compiled release firmware or did you compile yourself?

In any case, as far as I know you would need to reflash the device again.

1 Like

I flashed the device with a pre-compiled release using Tasmotizer. But I don’t think it’s a problem with the firmware as I have multiple devices of multiple types that show the same output.

I’m guessing it’s most likely a problem with the settings in either the HA MQTT broker add-on, the HA MQTT integration, or the MQTT settings in Tasmota. But the documentation says nothing about special settings for any of these. :unamused:

Here are mine. If you’re able to confirm that everything is correct, that would be a help.


Screenshot_mqtt-integration

From the image of tasmota mqtt parameters, I see that you have no configured the Host which is the ip address of HA device. And the username is not ha_mqtt which has been set in the broker. Is it like this or you shaded out the parameters in the image?

No, the Tasmota MQTT Host is currently blank. I’ll fix that.

What should the UN and PW in the broker be? Should the broker UN and PW and the integration UN and PW be the same? If so, does it matter which one I change?

And do I need to enter the same UN and PW in Tasmota so remain as “DVES_%06X”?

You are configuring the device to connect to the MQTT Broker. Therefore you must supply:

  • Host: The host name (or IP address) of the machine hosting the MQTT Broker (i.e. in your case, it’s the machine hosting Home Assistant)
  • User: The user name of an account that you have defined to permit access to the broker.
  • Password: The account’s password.

The “Client” is how the connected account will uniquely identify itself in the MQTT Broker’s log. The idea is that you can use a single account for multiple devices but each uses a different “Client” identifier (if they all use the same account and the same client identifier, you will get a mess).

Here’s an example:

Host: ha_server
Port: 1883
Client: pump_%06X
User: ha_mqtt
Password: whatever
Topic: pump
Full topic: tasmota/%prefix%/%topic%/

A second device could use the same account but with a different client identifier:

Host: ha_server
Port: 1883
Client: dishwasher_%06X
User: ha_mqtt
Password: whatever
Topic: dishwasher
Full topic: tasmota/%prefix%/%topic%/

Sorry, I was just confused when I said about the client, but thanks for the clarification.

Just FYI, does it matter that there’s a different UN and PW in the integration options?

What matters is that you configure each device with a valid account to the MQTT Broker.

In my case, I don’t use the logins option but simply create a User account dedicated for the use of Tasmotized devices: User accounts

@123 and @sheminasalam Thanks for your help. Now that I’ve added the host, UN, and PW to the Tasmota MQTT settings, the autodetect is working correctly. I’ll submit a suggesting to add this info to tasmota, as I think it would be helpful for new people like myself when setting this up for the first time.

@123, when you say you say you don’t use logins, I’m assuming you mean your broker config is just blank (i.e. logins: [])? In that case, do you have to set anonymous: true?

1 Like

Almost. logins is blank but anonymous is false. I don’t permit anonymous access to the broker.

Actually, that has little to do with the configuration of the Tasmota integration and everything to do with configuring a Tasmotized device. It’s explained in Tasmota’s own documentation here:

That’s true, but it seems like it couldn’t hurt to give a few extra pointers – especially for people newly setting up both Tasmota and HA. Plus that page just says the UN / PW should be whatever “for authenticating on your MQTT broker”. I’m assuming most newbies like me would be left wondering which UN / PW from HA that would be.

For your Tasmota-specific user account in HA, does it have to be an admin? And do you have to do anything specific to let the the HA MQTT broker or integration know that you’ve set it up for that purpose?

(Sorry for all the questions. Just trying to make sure all the other newbies who might read this post will have the right info.)

Just like it couldn’t hurt to read the available documentation.

For people who have no understanding of MQTT, I recommend what I used when I first started:

Sorry, but I have to disagree – and take umbrage with your insinuation. Home Assistant is widely acknowledged as a system with a steep learning curve. I have spent hours, maybe even days, reading documentation, tutorials, blog posts, etc. trying to figure all this out. And I’d like to think I’m a fairly competent user, having worked various IT-related jobs over the years.

The HA page on Tasmota lists just 3 requirements:

  • MQTT server and the MQTT integration set up in Home Assistant.
  • Tasmota devices flashed with version 9.2, or later.
  • Tasmota devices configured for native discovery ( SetOption19 0 )

No mention (not even a passing reference) of the need for to configure Tasmota’s MQTT settings.

And similarly, Tasmota HA page lists various ways of connecting Tasmotas with HA – differentiating between the “official Tasmota integration” and “MQTT discovery”. The next line then says " Once you configure the Home Assistant integration, every new Tasmota device with SetOption19 0 set, will be discovered automatically." Again, no mention of the need for particular settings in Tasmota.

Something like this may be be obvious to an experienced user, but surely an extra sentence or two to help people new to smart home stuff isn’t unreasonable.

The fact is you overlooked to configure your Tasmotized devices, like it’s described in Tasmota’s own documentation for its MQTT feature.

Respectfully, I wish I had a dollar for every time someone used their work background as a defense for their mistakes. I also found I had a lot to learn but didn’t blame the documentation for my errors and attributed it to, me.

Here’s the very first line (emphasis mine):

This integration allows you to control Tasmota devices over MQTT.

It’s pretty clear the Tasmota devices must communicate via MQTT and they certainly won’t if their MQTT settings aren’t configured.

FWIW, prior to the introduction of the Tasmota integration (very recently), Tasmota devices were discovered via Home Assistant’s MQTT Discovery (it can still be done but the Tasmota project is phasing out support for MQTT Discovery in favor of their own technique). Anyway, the upshot is that for years there was no documentation in Home Assistant for specifically discovering Tasmota devices (or any others). All of it was (and still is) done by configuring the Tasmota device as per its documentation.

Nonetheless, if you feel the documentation should read like a tutorial, then the good news is that anyone can submit changes; you are free to enhance it to the degree you believe is necessary. Someone on the development team will vet your submission and, if approved, it’ll be incorporated into the official documentation. If you want to learn how, here’s a Community Guide: Editing the Documentation and Creating a Pull Request on GitHub


BTW, the custom of this community is to add the Solution tag to the post that introduces the idea/instructions/concept that resolves the original question/problem. You have chosen to mark your own post which simply repeats what was already suggested by others. If everyone did that, it would appear that all users ultimately “solve” their own problem. In this case, sheminaslam was the first to identify that you overlooked to configure MQTT in Tasmota and so that’s the post that ought to be marked with the Solution tag.

@123 My apologies. I didn’t mean for this to devolve into a criticism. In the same way, I was not trying to take credit for the solution, but just to mark the post that I thought would have the clearest summary for others who came upon this post later. I appreciate your and sheminaslam’s help.

I believe that would still be sheminasalam’s post (contains more information). However, you’re the topic’s author so it’s your decision.