Need help in setting up sonoff switch in Home Assistant

Great!
I can control my switches via Google Assistant via Google Home - they are switches like any other. Just follow the setup docs. I use the manual config rather than nabu casa but both work.

Also if you add more switches, make sure they have a different topin… (ie don’t use sonoff again)

1 Like

Hi, and hi @DavidFW1960, here we go again…

I forgot and I really can’t find in hass and in the forum where I can see my MQTT discovered devices… and the command etc.

I have mqtt explorer and can see a tasmota device sending stuff, in the wrong topic?
See:

and this is my tasmota thing:

how can I add a device in hass and controll it remote?

thanks!

Oh I see some stuff in “tele” also:
image
How can I delete old stuff in mqtt? that is no longer there?

Edit: I can publish:
image

image

EDIT:
Ok I took the bullet and deleted all old stuff (is that a risk?):


Now the tasmota is publishing in the correct group:

But hell… how to get them in hass?

I tried to add in configuration.yaml:

mqtt:
  discovery: true
  discovery_prefix: homeassistant

But then I get:
image
And if i remove the config it’s gone…

then I found this but don’t know how tho do that?

Is everything always so hard in hass :-)?

EDIT hour later:
I do see things and have tried in console go to console and type the discovery cmd: “SetOption19 1”

image

HELP!!! :slight_smile:

Did you enable discovery in Tasmota? SetOption19 On

Yes see screenshot above…

I really appreciate some help here :slight_smile:

If you click on the 3 dots in configuration -> integrations -> mqtt, did you enable newly added entities ?
image

yes …

image

Edit:
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:

image

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

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

And yes now in hass I see:
image

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?
GroupTopic?

Dazzling :slight_smile:

The name comes from tasmota :

image

Under configuration -> configure other

I have:

I played around and see:
image

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:
%topic%/%prefix%/
IF you DON’T use MQTT Discovery, the full topic should be set to:
%prefix%/%topic%/

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:
%topic%/%prefix%/

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”…