Need help in setting up sonoff switch in Home Assistant

Yes. I see MQTT Mosquito Integration inside Configure -> Integrations

Nope. I don’t see any switch entities

This is inside log

Log Details (WARNING)
Fri Jan 31 2020 10:03:20 GMT+0530 (India Standard Time)

Config entry for mqtt not ready yet. Retrying in 5 seconds.

Yes. I created User named mqtt

I mean the log for the broker… Go to hassio side panel and click on MQTT - look in the log at the bottom. I assume you started the broker?

There should be no ‘config entry for mqtt’! Did you restart HA after you removed it from configuration.yaml?

Here is the log of MQTT Broker.

10:45:55] INFO: Setup mosquitto configuration
[10:45:55] WARNING: SSL not enabled - No valid certs found!
[10:45:55] INFO: No local user available
[10:45:55] INFO: Initialize system configuration.
[10:45:55] INFO: Initialize Hass.io Add-on services
[10:45:55] INFO: Initialize Home Assistant discovery
[10:45:55] INFO: Start Mosquitto daemon
1580447755: mosquitto version 1.6.3 starting
1580447755: Config loaded from /etc/mosquitto.conf.
1580447755: Loading plugin: /usr/share/mosquitto/auth-plug.so
1580447755: |-- *** auth-plug: startup
1580447755:  ├── Username/password checking enabled.
1580447755:  ├── TLS-PSK checking enabled.
1580447755:  └── Extended authentication not enabled.
1580447755: Opening ipv4 listen socket on port 1883.
1580447755: Opening ipv6 listen socket on port 1883.
1580447755: Opening websockets listen socket on port 1884.
1580447755: Warning: Mosquitto should not be run as root/administrator.
1580447805: New connection from 192.168.31.20 on port 1883.
[INFO] found mqtt on Home Assistant
1580447807: New client connected from 192.168.31.20 as DVES_B0E649 (p2, c1, k30, u'mqtt').

I configured it buddy.

Here is what I did.

Uninstalled MQTT Broker. Restarted Host Machine. Then Installed MQTT with discovery enabled.

Then went to configuration -> Integration.
Found MQTT Device. Added to Lovelace.

Thank you so much for your time and help.

Is it possible to enable my Google Home with Tasmota?

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.