I’ve been searching forums now for just over a week and trying things but I just can’t seem to get my Tasmota (5.9.1) flashed Sonoff basic to connect to MQTT.
I have installed the Mosquitto addon.
In Console on my Sonoff I get this constant error message:
02:56:45 MQT: Attempting connection...
02:56:52 MQT: Connect failed to http://192.168.86.229:1883, rc -2. Retry in 10 sec
Hassio is installed on Raspberry Pi 3+ which is sitting on reserved IP address of 192.168.86.229
My mosquitto settings:
{
“logins”: [
{
“username”: “username”,
“password”: “password”
}
],
“anonymous”: false,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}
Mosquitto Log:
[INFO] Setup mosquitto configuration
[WARN] SSL not enabled - No valid certs found!
[INFO] Found local users inside config
[INFO] Initialize Hass.io Add-on services
[INFO] Initialize Home Assistant discovery
[INFO] Start Mosquitto daemon
1542677990: mosquitto version 1.4.15 (build date 2018-03-04 15:35:59+0000) starting
1542677990: Config loaded from /etc/mosquitto.conf.
1542677990: *** auth-plug: startup
1542677990: ** Configured order: http
1542677990: Opening ipv4 listen socket on port 1883.
1542677990: Opening ipv6 listen socket on port 1883.
1542677990: Opening websockets listen socket on port 1884.
1542677990: Warning: Mosquitto should not be run as root/administrator.
1542677990: New connection from 172.30.32.1 on port 1883.
1542677991: Socket error on client <unknown>, disconnecting.
1542677991: New connection from 172.30.32.1 on port 1883.
[INFO] found homeassistant on local database
1542677991: New client connected from 172.30.32.1 as home-assistant (c1, k60, u’homeassistant’).
1542678049: Client home-assistant disconnected.
1542678064: New connection from 172.30.32.1 on port 1883.
[INFO] found homeassistant on local database
1542678064: New client connected from 172.30.32.1 as cee54a69-6ed7-4387-8446-273a80861fe2 (c1, k60, u’homeassistant’).
1542679791: Saving in-memory database to /data/mosquitto.db.
My MQTT settings on Sonoff:
My config yaml file:
mqtt:
broker: localhost
discovery: true
username: username
password: password
switch:
- platform: mqtt
name: "Sonoff power"
state_topic: "stat/sonoff1/POWER"
command_topic: "cmnd/sonoff1/POWER"
availability_topic: "tele/sonoff1/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: false
I originally followed drzzz’s youtube tutorial and since then I have tried lots of peoples different settings but nothing has changed in the sonoff console.