Apologies for the noob question but I just can’t seem to find an exact answer to this problem (although there are threads related to this)
I’ve got 2 Sonoff Mini R2’s flashed with Tasmota and connected to my mqtt broker but neither the MQTT integration nor the Tasmota integration is picking up any entities.
Using MQTT explorer I can 100% see topics being published from the devices, but the one item I don’t see is any discovery topic being posted. Could this possibly be why neither integrations pick up the devices and if so, what could be preventing the device to send publish discovery.
I have done SetOption19 0 and 1 multiple times with no effect.
Can I suggest a walk-though of all MQTT settings as a check?:
Most issues where autodiscovery isn’t working come from not instatlling the additional HASS Tasmota integration to get the replacement Tasmota discovery SetOption19 0 working.
The result should be immediate - publish topics, HASS creates entities (something which is useful when creating your own custom MQTT devices).
Some folk found really old verions of Tasmota don’t work as Tasmota Discovery was added in about v9.3. That’s less likely as you did install the latest version, didn’t you?
If things still don’t work, use the GitHub protocol desctiption link above to check topics in MQTT Explorer, and post the result (in code braces!) here.
There are two options with Tasmota on HASS, and neither involve manual YAML:
Use an old Tasmota version with HASS Discovery (which has been removed from Tasmota), and accept poor support in HASS for sensor units and long term statistics.
Connect to your Tasmota device via the web interface, select Console
Enter setoption19 1
You should see MQT: stat/<device-name>/RESULT = {"SetOption19":"ON"}
HASS should discover via the MQTT Integration (not as good as the Tasmota Integration).
Use a recent Tasmota > v9.3, and check setoption19 0 is set for Tasmota Discovery (which adds better support and useful features like sensor units for long-term HASS statistics).
After check setoption19 0 is set.
Using https://mqtt-explorer.com/ you should see tasmota\discovery\HEXDEVICEID\config\{ json kvp of the device parameters }
The only reason to use YAML with Tasmota is for advanced additional sensors or device support where the in-built discuvery might not pick up all the entities, and even then, the main device should still appear immediately.
So it must’ve been an old version. I actually followed a video that used a script and it worked hence why I didn’t go looking further into it.
Stumbled upon another video about 10min ago of someone needing to upgrade the firmware. On version 12.5.0 now and Tasmota integration has picked it up.
I have old Tasmotas, most of them running 8.3.1. They are discovered by MQTT intregration (with SetOption19 set), and are not visible in Tasmota Integration, which I have added later (They can be seen in the Tasmota integration webUI, though, which is another thing). In Tasmota integration there is only one device so far, and it was nicely discovered by the integration.
Is there a good way to switch these old MQTT -disovered Tasmotas to the new Tasmota integration? Firstly, if v9.3 is required, they need to be upgraded first, but what after that?
As we all know, there is this change from 8/2023:
("MQTT entity name starts with the device name in your config... this is not expected. Please correct your configuration. The device name prefix will be stripped off the entity name and becomes 'status'"),
…which I need to get rid of. This has, as far as I understand, been solved in later firmware versions, which is the reason I probably need to upgrade anyway. Even though it could a bit onerous, since the upgrade path from current version to the latest is somewhat complicated. Would like to move on to this Tasmota inegration in the same process.
Upgraded old Tasmotas to the latest version respecting the presented Upgrade Flow as described in Upgrading - Tasmota
The upgraded devices were detected by Tasmota integration
Checked and altered, if needed the entity names to keep my namespaces consistent and cards, automations etc. working
Deleted the devices from under MQTT integration
I did not alter the SetOption19 -settings, whatever they might have been after the upgrade. There are now upgraded units where I have set that when initially joining to my system, and one that I have not touched in that sense. All of them seem to be working OK. The device name prefix -problem was also corrected.
Tasmota discovery works a whole lot better with HASS with HASS discovery, not least as units are supported for long-term statistics. Just set Device Name (hardware device or blank) differently than Friendly Name (thing controlled). The reasons why are documented here.