Hassio can't integrate Sonoff

Hi

I’ve been trying to integrate a pow 16 flashed with tasmota.
As a broker I’m using mosquitto and I think it’s working fine:

1556036167: |-- url=http://127.0.0.1:8080/superuser 1556036167: |-- data=username=mqtt_user&password=&topic=&acc=-1&clientid= 1556036167: |-- aclcheck(mqtt_user, tele/%topic%Sonoff/INFO2, 2) SUPERUSER=Y by http 1556036167: |-- Cached [2FCC0FDEC83E8099F41583CDC7288D58468FB27C] for (client id not available,mqtt_user,2) 1556036167: |-- mosquitto_auth_acl_check(…, client id not available, mqtt_user, tele/%topic%Sonoff/INFO3, MOSQ_ACL_WRITE)

anyway the config is this.
in the mosquito hassio page:

{
“logins”: [
{
“username”: “mqtt_user”,
“password”: “mqtt_password”
}
],
“anonymous”: false,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}

on the configuration.yalm

mqtt:
broker: core-mosquitto
username: mqtt_user
password: mqtt_password
discovery: true
discovery_prefix: homeassistant

I have these files:

  1. Create /share/mosquitto/acl.conf with the contents:

acl_file /share/mosquitto/accesscontrollist

  1. Create /share/mosquitto/accesscontrollist with the contents:

user mqtt_user
topic #

on the pow 16

I think the log on hassio mosquitto configuration page says that it has found the device:

and on the console page I also think it is connected:

17:22:34 HTP: Console
17:22:46 HTP: Main Menu
17:22:50 HTP: Configuration
17:22:51 HTP: Configure MQTT
17:24:07 MQT: tele/%topic%Sonoff/STATE = {“Time”:“2019-04-23T17:24:07”,“Uptime”:“0T00:05:23”,“Vcc”:3.500,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“POWER”:“OFF”,“Wifi”:{“AP”:1,“SSId”:“Routerzinho”,“BSSId”:“00:06:91:A9:7D:C0”,“Channel”:1,“RSSI”:80}}
17:24:07 MQT: tele/%topic%Sonoff/SENSOR = {“Time”:“2019-04-23T17:24:07”,“ENERGY”:{“TotalStartTime”:“2019-03-16T17:35:54”,“Total”:0.003,“Yesterday”:0.000,“Today”:0.000,“Period”:0,“Power”:0,“ApparentPower”:0,“ReactivePower”:0,“Factor”:0.00,“Voltage”:0,“Current”:0.000}}
17:28:53 APP: Serial logging disabled
17:29:07 MQT: tele/%topic%Sonoff/STATE = {“Time”:“2019-04-23T17:29:07”,“Uptime”:“0T00:10:23”,“Vcc”:3.500,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“POWER”:“OFF”,“Wifi”:{“AP”:1,“SSId”:“Routerzinho”,“BSSId”:“00:06:91:A9:7D:C0”,“Channel”:1,“RSSI”:80}}
17:29:07 MQT: tele/%topic%Sonoff/SENSOR = {“Time”:“2019-04-23T17:29:07”,“ENERGY”:{“TotalStartTime”:“2019-03-16T17:35:54”,“Total”:0.003,“Yesterday”:0.000,“Today”:0.000,“Period”:0,“Power”:0,“ApparentPower”:0,“ReactivePower”:0,“Factor”:0.00,“Voltage”:0,“Current”:0.000}}
17:34:07 MQT: tele/%topic%Sonoff/STATE = {“Time”:“2019-04-23T17:34:07”,“Uptime”:“0T00:15:23”,“Vcc”:3.485,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“POWER”:“OFF”,“Wifi”:{“AP”:1,“SSId”:“Routerzinho”,“BSSId”:“00:06:91:A9:7D:C0”,“Channel”:1,“RSSI”:76}}
17:34:07 MQT: tele/%topic%Sonoff/SENSOR = {“Time”:“2019-04-23T17:34:07”,“ENERGY”:{“TotalStartTime”:“2019-03-16T17:35:54”,“Total”:0.003,“Yesterday”:0.000,“Today”:0.000,“Period”:0,“Power”:0,“ApparentPower”:0,“ReactivePower”:0,“Factor”:0.00,“Voltage”:0,“Current”:0.000}}

The hassio messages reports that something has been found:

image

but I can’t seem to find any device:

Does anyone know what is missing or wrong?

Thanks in advance

Did you SetOption19 = 1 in the device web console (HA discovery)?

yes, option 19 is set

Are you using the basic.bin?

(warning: this feature is not included in sonoff-basic.bin and sonoff-classic.bin )

It’s the classic
sonoff-classic.bin
Which should I use and why?

Have you checked its not listed under unused entities?

I think it is
image
What can I do with it so I can use it?

Are you sure thats not the upnp integration item and not the sonoff.
in the top right you should have 3 dots, click on it and select unused entities. it will show a list of all entities not on any page. is the sonoff listed there

Not the basic, not the classic, because they don’t include HA discovery. The bottom file of this list is the one you want: Release Sonoff-Tasmota v6.5.0 · arendst/Tasmota · GitHub (i.e. sonoff.bin).
Having said that, I refuse to go above v6.2.1 as I have found the latter builds to be as unstable as fuck (excuse my French).


aidbish

This is what I have


tom_l

I will flash it right now, thank you

What I found with my sonoffs is that they wont send the topics to HA when I set the module first.

What I always do is flash the sonoff, set discovery first (SetOption19 1) before you do anything else.
Then setup mqtt, maybe the friendly name if you wish. And then setup the module, but only AFTER you have set up the discovery.

Also to my knowledge there is no need to change the client name. And if you do not use password/username on your broker you should not touch these settings. (But I figure that you probably do use that).

Also, there is a difference between binaries. There is a core 2.3.0, 2.4.2 and a 2.5.0 version of tasmota. What I have read is that most users experience the least problems with the 2.3.0 version. However that version doesn’t work at all in my network and I use the 2.4.2 variant.

I’ve re-flashed the sonoff

image

but after I flashed it the setting were already there, is that supposed?

Well, after a restart to hassio it finally appeared

image

thank you, I’ve been struggling with this since the beginning of March

1 Like

Yes that’s normal. Program and settings data are in different places so that you can update without having to reconfigure.

:champagne::tada: