Need help in setting up sonoff switch in Home Assistant

yes …


I should see devices popping up in entities as “integration” mqqt" though then?

Ok, a question and an observation about your tasmota device :
question : what .bin did you flash? Not all .bin’s support autodiscovery
observation: your full topic is wrong.

Ok, wokring on an answer.

what should the “full topic” be then? I used homeassistant/tasmota_01 as well, with no luck

%topic%/%prefix%/ or %prefix%/%topic%/ , your choice. I prefer the first.

Ehm… that is in the last screenshot of post above isn’t it?

it is. :+1:

I don’t know what happened… but… I hit the update from tasmoadmin:


then suddenly this came in mqtt explorer extra (a lot):

is that ok? Shouldn’t this be under the device?

And yes now in hass I see:

but its a mystery for me now how these names are decided by mqtt and hass… where to put them?

EDIT: When I look in the settings of the device via tasmoadmin I see:

Is that where hass takes it’s name from? What if I change it now? Or does it take the name from:

What is MQTT Client name?
What is MQTT Topic? Fulltopic?

Dazzling :slight_smile:

The name comes from tasmota :


Under configuration -> configure other

I have:

I played around and see:

but it does not change the mqtt name? correct?

Sorry I think I really don’t get MQTT… I need to learn :-(… what I see now is it change into this without me doing anything:

Once HA has seen the device, the device name won’t change even if you change the friendly name.

IF you use MQTT Discovery, the full topic should be set to:
IF you DON’T use MQTT Discovery, the full topic should be set to:

Tasmota will set these AUTOMATICALLY when you enable discovery but will not reverse it if you turn discovery off - you need to do that yourself.

I have it set like last screenshot and that works (and discovers). Why should I set it to what you say? What is the advantage? Disadvantage?

The problem is homeassistant uses the homeassistant prefix for discovery messages. Now you use it for normal operations. It does not matter much for you since you only have 1 tasmota device. But each time a message arrive, HA tries to discover before HA realizes it is for a regular device. Once you reach more than 1 device you will start noticing the lag.

Appreciate all the help!

Still not getting “it”. I look at my mqtt broker with mqtt explorer and see:

But I notice no lag at all…

If I use in mqtt:

How does “discovery” than work in homeassistant? because I do not see any “messages” coming in that group then?

When I use these settings for both tasmota’s:

I then see (I deleted the topics under homeasssitant there :slight_smile: - not sure if this is “allowed”…

Nobody is forcing you to do anything. MQTT is very flexible, HA and Tasmota is very flexible. They adapt to any correct configuration.

But when you reach something like this :

You think about optimizing things :slight_smile:

Yes! And therefor I changed it :-)…I ordered 10 extra “tasmota’s”(ESP-01S’s) to use, below 2 USD to get information in HA and to control lights…

But I want to “understand” why this is. So are your devices sending stuff to the homeassistant topic? Or is it just a matter of “not sending” to much information to that optic in order to have homeassistant get overloaded by messages in there?

I just use the homeassistant topic for auto-discovery messages. So HA only uses this listener for creating devices.

Ok, think I am getting it… thus this looks ok:

and how can I change a name that HA has decided? I do this by shutting down the mqtt broker, delete the topic, restart HA, start container and then after name was set correct it takes the new name in hass… but there must be a more easy way?

If using tasmota, a new Setoption19 1 deletes the device in HA, and creates a new one with the new friendly name/ topic set in tasmota.

So, I did that on the “wrongly name” module, but nothing changed.

but if is did this:
Setoption19 0

and then

Setoption19 1

yes, that works… so much to learn :slight_smile:

EDIT: this topic I will look a lot to from now :slight_smile: