Sonoff-Tasmota discovery on Hass.io

Yes, setoption19 On on 4 devices, but only one in entities. Do you have to do this after every power cycle of Hassio?

I tried again. Deleted the entire MQTT section configuration.yaml, updated MQTT add-on from 2.0 to 4.0, reboot Hassio. While rebooting, SetOption 19 On on all Tasmotas (6.3.0). They connect fine to the MQTT broker. I see MQTT discovered in Integrations, that one won’t connect “Unable to connect to the broker.” Lower in integrations MQTT is listed again, that one will connect. Click Enable Discovery or something like that and one of the 4 tasmotas appears as an entity. Went through all 4 again and SetOption19 On just in case and no improvement. Rebooted Hassio, waited some more and no improvement, only the farthest tasmota in entities.

nope. On mine it just picks them up as soon as I setoption19

Okay, I’m going to jump in here because I seem to be having the exact same issue…

I turned off all my MQTT stuff (and removed from configuration.yaml) and started fresh. I’m running hassio for what it’s worth.

  1. I created a new HA user named “mqttuser”

  2. I installed the Mosquitto broker plugin with the default settings:

     {
       "logins": [],
       "anonymous": false,
       "customize": {
         "active": false,
         "folder": "mosquitto"
       },
       "certfile": "fullchain.pem",
       "keyfile": "privkey.pem"
     }
    
  3. I started the plugin

  4. I went to the Integrations page

  5. I tried configuring the “Discovered” MQTT broker (the dialog where it just asks if you want to Enable discovery), which didn’t work (it actually had the same results that the below steps document), so I deleted that and restarted Home Assistant

  6. I clicked MQTT in the “Set up a new integration” section, and filled it in with 127.0.0.1, the credentials for the HA user I created in step 1, and “Enable discovery” turned on

  7. I have my Tasmota device configured to connect to the MQTT broker

  8. I’ve gone to the Tasmota console and user “setoption19 on” to turn on discovery, which results in a bunch of MQTT messages getting sent out:

     22:31:48 CMD: setoption19 on
     22:31:48 MQT: homeassistant/light/thermostat_1/config =  (retained)
     22:31:48 MQT: homeassistant/switch/thermostat_1/config =  (retained)
     22:31:48 MQT: homeassistant/light/thermostat_2/config =  (retained)
     22:31:48 MQT: homeassistant/switch/thermostat_2/config =  (retained)
     22:31:48 MQT: homeassistant/light/thermostat_3/config =  (retained)
     22:31:48 MQT: homeassistant/switch/thermostat_3/config =  (retained)
     22:31:48 MQT: homeassistant/light/thermostat_4/config =  (retained)
     22:31:48 MQT: homeassistant/switch/thermostat_4/config =  (retained)
     22:31:48 MQT: homeassistant/light/thermostat_5/config =  (retained)
     22:31:48 MQT: homeassistant/switch/thermostat_5/config =  (retained)
     22:31:48 MQT: homeassistant/light/thermostat_6/config =  (retained)
     22:31:48 MQT: homeassistant/switch/thermostat_6/config =  (retained)
     22:31:48 MQT: homeassistant/light/thermostat_7/config =  (retained)
     22:31:48 MQT: homeassistant/switch/thermostat_7/config =  (retained)
     22:31:48 MQT: homeassistant/light/thermostat_8/config =  (retained)
     22:31:48 MQT: homeassistant/switch/thermostat_8/config =  (retained)
    

(If it means anything, these messages are always empty when I monitor them… the same set gets sent out every time the device reboots)

  1. The MQTT broker add-in logs show that the device is connecting, presumably to send out it’s regular messages, it sends out a temperature/humidity MQTT message every minute:

     22:43:02 MQT: tele/thermostat/STATE = {"Time":"2018-11-29T22:43:02","Uptime":"0T00:00:14","Vcc":2.984,"Wifi":{"AP":1,"SSId":"Echonet","BSSId":"34:97:F6:5E:88:00","Channel":5,"RSSI":62}}
     22:43:02 MQT: tele/thermostat/SENSOR = {"Time":"2018-11-29T22:43:02","SHT3X-0x45":{"Temperature":82.2,"Humidity":36.7},"TempUnit":"F"}
    

But I never have the sensor or any new entities show up in my dev tool list of entities.

I feel like there must me something I’m missing about how MQTT discovery ties in with the regular MQTT messages… I’ve tried to change the topic on the Tasmota device to various things, but nothing ever shows up, so I figured I’d revert them back to default for this test, and it has the same results, nothing on the Home Assistant side to indicate that discovery is actually happening…

Hmm. Looks exactly right to me.

Configuration > Configure Other gives me this (when I go to web interface)

This then creates a device sonoff12914 (It drops off the hyphen)

image

Just wondering if it’s ‘hiding’?

This should work.

I will say the other day I flashed one of those Sonoff SV’s but I have not wired it up yet and I didn’t see it pop up like the others did immediately I set to option in Tasmota for them. But I was only holding in the 4 pins to program so I wasn’t panicing about it until I solder on some wires with a normal power supply etc.

For what it’s worth, my device isn’t actually a Sonoff, it’s just a wemos mini with an SHT30 attached, flashed with Tasmota following their instructions. I don’t think that should affect anything, just wanted to provide the full context.

I tried searching using the filter and it still wasn’t there. This hassio setup is only ~2 weeks old, so there’s not a lot connected to it yet :wink:

Don’t think sonoff makes a difference… it’s all Tasmota. So you searched for the friendly name and no device? You using the latest Mosquito addon?

Correct, no results for the friendly name. I am running the Mosquito Broker 4 add-on, the log shows "mosquitto version 1.4.15 (build date 2018-03-04 15:35:59+0000) "

Very odd. Mine is setup identically to yours. I even have the same username mqttuser! So you created that user I assume in Home Assistant?

One thing I thought might be tripping me up with the Sonoff SV is it’s still configured as a basic module… I was thinking I might need to select the correct module type for it to be discovered… have you checked that?

We do differ there, mine is set as “18 Generic”, which is what the Tasmota instructions had me choose for this device.

EDIT: Well, I was able to add the sensor manually at least… still not sure why it wasn’t working with auto discover, but maybe I’ll wait until my Sonoff devices arrive so I can try again with a more common device.

What do you put on the configuration.yaml for the temperature reading for SHT30? On the line value template: ‘{{ value_json.SHT3X-0x45.Temnperature }}’, then check config stated incorrect syntax. Anyone know the correct syntax so it will show up on the hassio?

Are you sure

Temnperature

is the correct spelling?

I may be coming back to this. I’m still running Ver 2.0 of the MQTT.org add-on and should update it before I’m forced to. According to https://github.com/arendst/Sonoff-Tasmota/wiki/Home-Assistant, SetOption 19 needs to remain on for the devices to remain in Hassio. I had been turning it off after I saw a conenction in the Tasmota console. Also, I am using the default Tasmota web UI username and password on each device and may change those to match the MQTT username and password.

The Tasmota default user is HomeAssistant right? That’s not going to work with the new addon. I am using a new user I created with the new auth and of course the MQTT user in Tasmota has to match that.

If you turn Option 19 OFF then it turns discovery off and will remove the device from Home Assistant as well.

Hi, please tolerate my noob status and if advised to set up a new topic I will. I just started with Hassio 6 weeks ago with no prior experience except as a consumer of retial home automation products like Hue X100, Wink x 2, Arlo X2, Smartthings, etc…nice to get rid of some hardware! I just flashed a Wemos D1 mini with Tasmota, I see the device in the Tasmo admin GUI, but it does not show as a integration or entity in the HA front end. Is this a module setting? I have not changed much as I need to research and have come up empty on this particular search, and frankly its a lot of information I have learned in last few hours with the flashing. I have MQTT but have never used, have entered my credentials on the D1. It works from a browser and Tasmo admin GUI. Just expecting to see it in Hassio, as I stated.

did you add the MQTT integration and the Mosquitto broker addon?

1 Like

yes I have both of those. The MQTT integration is empty - no devices. The broker add on is running and current.

Do you see the devices connecting to the broker in the log? (at the bottom of the addon - refresh the log)

1 Like

yes, here is the data:
[INFO] found [email protected] on local database
1551318389: New client connected from xxx.xxx.xxx.xxx as DVES_AAC778 (c1, k10, u’[email protected]’).
1551318405: Socket error on client DVES_AAC778, disconnecting.
1551318405: New connection from xxx.xxx.xxx.xxx on port 1883.
[INFO] found [email protected] on local database`

looks good to me lol, its repeated about 500 times, thought that would be too much to post and censor

so the DVES_AAC778 is listed as the MQTT client name, what needs to be there? I found this information in the Tasmo Admin GUI.

what Tasmota Firmware version? Are you using MQTT Discovery?

it is ver 0.6.1. As I do not know what or how to enable MQTT discovery I’ll say no. Is this in configuration.yaml? I just edited my last message, found this:

the DVES_AAC778 is listed as the MQTT client name, what needs to be there? I found this information in the Tasmo Admin GUI.

in case you did not see it. Thanks for your interest in helping me!