Mqtt broker help

ok you need to add the user homeassistant

user homeassistant
topic readwrite # 

ok I added that in but still no change

Hi,
I’m having the same problem…I installed the Mosquitto Add-on as it is written in the wiki and afterwards added the integration as proposed. But my tuya plug won’t show up, although I used SetOption19 1 in the Tasmota console. :frowning:

This is my Mosquitto config:

{
  "logins": [
    {
      "username": "mqtt_user",
      "password": "xxx"
    }
  ],
  "anonymous": false,
  "customize": {
    "active": true,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

This is my accesscontrollist

user mqtt_user
topic readwrite #
user homeassistant
topic readwrite #

This is the configuration of my Sonoff device (Flashed tuya plug)

This is what I get in the Mosquitto add-on log on start-up:

[14:30:05] INFO: Setup mosquitto configuration
[14:30:05] WARNING: SSL not enabled - No valid certs found!
[14:30:05] INFO: Found local users inside config
[14:30:06] INFO: Initialize Hass.io Add-on services
[14:30:06] INFO: Initialize Home Assistant discovery
[14:30:06] INFO: Start Mosquitto daemon
1568637006: Loading config file /share/mosquitto/acl.conf
1568637006: mosquitto version 1.6.3 starting
1568637006: Config loaded from /etc/mosquitto.conf.
1568637006: Loading plugin: /usr/share/mosquitto/auth-plug.so
1568637006:  ├── Username/password checking enabled.
1568637006:  ├── TLS-PSK checking enabled.
1568637006: |-- *** auth-plug: startup
1568637006:  └── Extended authentication not enabled.
1568637006: Opening ipv4 listen socket on port 1883.
1568637006: Opening ipv6 listen socket on port 1883.
1568637006: Opening websockets listen socket on port 1884.
1568637006: Warning: Mosquitto should not be run as root/administrator.
1568637015: New connection from *IP of the plug* on port 1883.
[INFO] found mqtt_user on local database
1568637016: New client connected from *IP of the plug* as DVES_D47490 (p2, c1, k10, u'mqtt_user').
1568637041: New connection from 172.30.32.1 on port 1883.
[INFO] found homeassistant on local database
1568637043: New client connected from 172.30.32.1 as auto-964AF521-3E98-1421-51EF-4EE022228008 (p2, c1, k60, u'homeassistant').

So obviously the plug is able to connect to the broker, as well as HA.

The output in the Tasmota console is the following:

13:30:15 MQT: Attempting connection...
13:30:17 MQT: Connected
13:30:17 MQT: tele/sonoff/LWT = Online (retained)
13:30:17 MQT: cmnd/sonoff/POWER = 

SetOption19 1 gives me the following:

13:35:06 CMD: SetOption19 1
13:35:06 MQT: stat/sonoff/RESULT = {"SetOption19":"ON"}

The module is configured as “Teckin (52)”

Any ideas would be very much appreciated!!

why is the prefix before the topic?

Shouldn’t the topic be “homeassistant” so that mqtt discovery works?

I don’t see how your issue is the same as the OPs here.

I set the topic in the tasmota config to “homeassistant”, the plug restarted, nothing shows up in “Integrations” and I got this output in the console:

00:00:00 Project sonoff Tuya_Plug1 Version 6.5.0(release-basic)-2_3_0
00:00:00 WIF: Connecting to AP1 *AP* in mode 11N as homeassistant-5264...
00:00:10 WIF: Connect failed with AP timeout
00:00:10 WIF: Connecting to AP1 *AP* in mode 11N as homeassistant-5264...
00:00:20 WIF: Connected
00:00:20 HTP: Web server active on homeassistant-5264 with IP address *plug ip*
14:08:17 MQT: Attempting connection...
14:08:17 MQT: Connected
14:08:17 MQT: tele/homeassistant/LWT = Online (retained)
14:08:17 MQT: cmnd/homeassistant/POWER = 
14:08:18 MQT: tele/homeassistant/INFO1 = {"Module":"Teckin","Version":"6.5.0(release-basic)","FallbackTopic":"cmnd/DVES_D47490_fb/","GroupTopic":"sonoffs"}
14:08:18 MQT: tele/homeassistant/INFO2 = {"WebServerMode":"Admin","Hostname":"homeassistant-5264","IPAddress":"plug I"}
14:08:18 MQT: tele/homeassistant/INFO3 = {"RestartReason":"Software/System restart"}
14:08:18 MQT: stat/homeassistant/RESULT = {"POWER":"OFF"}

For MQTT Discovery to work the topic has to START with homeassistant/

are you running basic tasmota? as your console should resemble this after set option

08:52:08 CMD: SetOption19 On
08:52:08 MQT: sonoff/stat/RESULT = {"SetOption19":"ON"}
08:52:08 MQT: homeassistant/light/50BC48_LI_1/config =  (retained)
08:52:08 MQT: homeassistant/switch/50BC48_RL_1/config = {"name":"Front Porch Floods","cmd_t":"~cmnd/POWER","stat_t":"~tele/STATE","val_tpl":"{{value_json.POWER}}","pl_off":"OFF","pl_on":"ON","avty_t":"~tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","uniq_id":"50BC48_RL_1","device":{"identifiers":["50BC48"]},"~":"sonoff/"} (retained)
08:52:08 MQT: homeassistant/light/50BC48_LI_2/config =  (retained)
08:52:08 MQT: homeassistant/switch/50BC48_RL_2/config =  (retained)
08:52:08 MQT: homeassistant/light/50BC48_LI_3/config =  (retained)
08:52:08 MQT: homeassistant/switch/50BC48_RL_3/config =  (retained)
08:52:08 MQT: homeassistant/light/50BC48_LI_4/config =  (retained)
08:52:08 MQT: homeassistant/switch/50BC48_RL_4/config =  (retained)
08:52:08 MQT: homeassistant/light/50BC48_LI_5/config =  (retained)
08:52:08 MQT: homeassistant/switch/50BC48_RL_5/config =  (retained)
08:52:08 MQT: homeassistant/light/50BC48_LI_6/config =  (retained)
08:52:08 MQT: homeassistant/switch/50BC48_RL_6/config =  (retained)
08:52:08 MQT: homeassistant/light/50BC48_LI_7/config =  (retained)
08:52:08 MQT: homeassistant/switch/50BC48_RL_7/config =  (retained)
08:52:08 MQT: homeassistant/light/50BC48_LI_8/config =  (retained)
08:52:08 MQT: homeassistant/switch/50BC48_RL_8/config =  (retained)
08:52:08 MQT: homeassistant/sensor/50BC48_status/config = {"name":"Front Porch Floods status","stat_t":"~HASS_STATE","avty_t":"~LWT","pl_avail":"Online","pl_not_avail":"Offline","json_attributes_topic":"~HASS_STATE","unit_of_meas":" ","val_tpl":"{{value_json['RSSI']}}","uniq_id":"50BC48_status","device":{"identifiers":["50BC48"],"name":"Front Porch Floods","model":"Sonoff Basic","sw_version":"6.6.0(sonoff)","manufacturer":"Tasmota"},"~":"sonoff/tele/"} (retained)

on the other hand I am just lost what problem is on my end as would have assumed that it should work

So you mean it should look like this?

screen2

Didn’t change anything unfortunately…

@Yonu, I’m running Tasmota 6.5.0

NO, you see the “FULL TOPIC” there?

Set topic to homeassistant

Set full topic to %topic%/%prefix%

when you run the set option command you should see something similar in the console to what i typed out if you goto the information page on tasmota does it say 6.x.x(basic as the basic build doesn’t support home assistant

It says “6.5.0(release-basic)” - so I guess this is the reason why it does not work?
//edit: stupid me - didn’t recognize it that it’s stated even in the wiki…

Just flashed the current sonoff.bin and it showed up in the integrations immediately!

Thanks to all of you.

cool glad that worked for ya now if i could just get mine to behave

Mqtt discovery changes the order like that.

any ideas what else I should check? i loaded a mqtt client on a differnt box and it appears the sonoffs are talking to the broker

but I actually ca’n’t tell if HA is connecting to the broker

ok i just played with mqtt.publish a bit and it looks like HA isn’t talking to mqtt fully where should I begin to diagnose this

Enable MQTT Discovery on the Sonoff again as it will fix it if you screwed with the topic settings.

I’m assuming you have now flashed the full sonoff.bin file and its not still sonoff basic firmware?

Also, how have you configured the broker? If you have entries in configuration.yaml, you can delete the whole mqtt section - it’s not required. You can also delete the broker and add it back and remove the MQTT integration and restart home assistant; then add the integration back again and restart home assistant again.

yes i am running full version as i am using a freesh flashed device for testing I made sure it was not basic. the broker is running I have removed it twice and put it back I have also removed the intergration about 4 times and put it back.