Hi everyone.
This is what happen (sorry my english, I’m from Chile): I can’t connect my Sonoff TH16 as a switch through MQTT, I don’t know what is wrong, is the first time I use MQTT and I don’t know if my configuration is secure.
First: I have this
- https://my-domain.duckdns.org (works good)
- Sonoff TH16 with Tasmota firmware 6.1.1 (OK)
- My Raspberry ip: 192.168.0.22
- MQTT add-on config
{
“plain”: true,
“plain_websockets”: false,
“ssl”: true,
“ssl_websockets”: false,
“anonymous”: false,
“logins”: [
{
“username”: “User-Name-Same-I-Use-On-Tasmota”
“password”: “User-Password-Same-I-Use-On-Tasmota”
}
],
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}
Log of MQTT add-on
1532064812: mosquitto version 1.4.15 (build date 2018-03-04 15:35:59+0000) starting 1532064812: Config loaded from /etc/mosquitto.conf. 1532064812: Opening ipv4 listen socket on port 1883. 1532064812: Opening ipv6 listen socket on port 1883. 1532064812: Opening ipv4 listen socket on port 8883. 1532064812: Opening ipv6 listen socket on port 8883. 1532064812: Warning: Mosquitto should not be run as root/administrator. 1532066613: Saving in-memory database to /data/mosquitto.db. 1532068414: Saving in-memory database to /data/mosquitto.db. 1532068452: New connection from 192.168.0.29 on port 1883. 1532068452: New client connected from 192.168.0.29 as DVES_42976F (c1, k15, u'Pabletee12').
In my configuration.yaml I have this:
mqtt:
broker: https://mydomain.duckdns.org
port: 1883
client_id: DVES_I_Dont_If_this_can_be_showed
keepalive: 60
username: User Name same I use in the add-on of MQTT
password: Password same I use in the add-on of MQTT
protocol: 3.1.1
switch:
- platform: mqtt
name: “Sonoff”
state_topic: “cmnd/sonoff/switch1”
command_topic: “cmnd/sonoff/switch1/set”
availability_topic: “cmnd/sonoff/switch1/available”
payload_on: “ON”
payload_off: “OFF”
optimistic: false
qos: 0
retain: true
My Sonoff config
My Info
The Message in Home screen
I don’t know what to do, I know this wonderful community helps everyone, please, help .