HA auto discovery tasmota sonoff not working in 0.100.3

no did not work…

No leave the users under configuration alone.

On my system I created a Home Assistant user called mqttuser with a password. That is the username and password I use in my devices for MQTT.

In the Mosquitto addon, just leave that set at the default:

{
  "logins": [],
  "anonymous": false,
  "customize": {
    "active": false,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "require_certificate": false
}

It will then use the Home Assistant user for authentication.
Anonymous and active should be false.

Your MQTT section in Tasmota must have the same username and password.

You should not have any mqtt: section in configuration.yaml

Sorry for the delay everybody, reached max allowed posts for the day. had to wait 18 hrs…

DavidFW1960,
MQTT, all reset to defaults
{
“logins”: [],
“anonymous”: false,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”,
“require_certificate”: false
}
restarted MQTT

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

new client connected from smart plug ( as per log above), but no new devises discovered in HA…

Set up new user as you per your suggestion ( went hqttuser and a new password) changed all in smart plug and still nothing… running out of ideas
new mosquito hqtt log:
[INFO] found hqttuser on Home Assistant
1572052425: New client connected from 192.168.1.32 as DVES_D322B0 (p2, c1, k30, u’hqttuser’).
1572052428: Client DVES_D322B0 disconnected.
1572052434: New connection from 192.168.1.32 on port 1883.
1572052434: New client connected from 192.168.1.32 as DVES_D322B0 (p2, c1, k30, u’hqttuser’).
1572052629: New connection from 172.30.32.1 on port 1883.
[WARN] Not found homeassistant on local database
1572052630: Socket error on client , disconnecting.

what do you see if you use MQTT Explorer and connect to the broker? (post screenshot)
In the MQTT settings in tasmota… can you post a screenshot of the MQTT settings.

so 192.168.1.29 is the IP address of your home assistant and the broker (mosquito addon) is also running on that ip address?

do you have a mqtt: section in configuration? (if you do delete it and restart)
do you have a mqtt switch configured anywhere for this smartplug? (if you do delete it and restart)

google for and download/install/run MQTT explorer and post screenshot.

ALSO at this point, remove the MQTT integration and restart Home Assistant as well. It will hopefully be redetected when you restart and/or you can add it back then. I am also assuming you created a Home Assistant user Configuration?Users and it’s called hqttuser with a password and that is also the MQTT username and password in Tasmota? (sorry I know these are probably blindingly obvious answers but something has been missed here or is wrong)

DavidFW1960,
hurra…got it…
uninstalled/deleted Integrations>mqtt
uninstalled/deleted Hass.io>mosquitto broker addon
Reboot/restart
HA after restart wanted to install Integrations>mqtt - deleded
installed/added manually - press the “+” button add MQTT add broker, port(same) user and password ( used “mqttuser” as a user and “mymqtt” as a password)
at the Tasmota smart switch in Configure MQTT added mqtt user(mqttuser) and password (mymqtt)
HA automaticly discovered new smart Tasmota switch)

DavidFW1960, I would like to thank you for your patience and help, you are great!!!
considering this is my first interaction with HA. Purchased a raspberry pi and my tuya switch on Monday, installed HA and flashed tuya switch on Tuesday. My first steps into HA on Wednesday and Thursday and today…
Many thanks…

2 Likes

If you don’t mind, could you please share your final Mosquitto add-on config file?

Thanks.

oleggold, the final Mosquitto add-on config file is as original:
{
“logins”: [],
“anonymous”: false,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”,
“require_certificate”: false
}

The only change I did was under the Integrations>mqtt - deleted the mqtt that was automatically added and manually add MQTT back

1 Like

Great thread! But if I understand correctly, most of what’s in here is relevant only if you have Hass.io ?
I have Home Assistant and Mosquitto running in Docker. My objective is to get Integration>MQTT to work and get rid of all the config.yaml stuff.

1 Like

Hello @Viking!
By now, I suppose you’ve figured it out!? If so, would you mind sharing how this worked out for you?

Thank you!

Check this out: https://forum.qnap.com/viewtopic.php?f=364&t=150607

1 Like

Thank you!
I just found where the flaw was.
The version uploaded onto my sonoff was a lite version and that one doesn’t get discovered automatically, despite its setoption19 feature apparently works.
So, I uploaded the “full” version and it worked.

Thank you!

OMG… thank you! I was just troubleshooting for an hour, being confused why the auto discovery doesn’t work. I also had the lite version and have previously been annoyed that I couldn’t find any infos about which features are missing but thought it would be fine for a Sonoff Basic.

1 Like