Hello
I know this has been talked over and over again… but I can’t make it to work. Let me start from the beginning…
I have tow Sonoff switches flashed with Sonota. I run Mosquitto in the Pi through the plugin and it’s bridged with cloudmqtt for Owncloud. That part is working fine, as Owncloud is reporting the location correctly to HA. Anyway, here is that config:
{
"plain": true,
"ssl": false,
"anonymous": false,
"logins": [
{
"username": "Eduardo",
"password": "********"
}
],
"customize": {
"active": true,
"folder": "mosquitto"
},
"certfile": "fullchain.pem",
"keyfile": "privkey.pem"
}
And the cloudmqtt.conf on my share/mosquitto folder
connection cloudmqtt
address m--.cloudmqtt.com:17566
remote_username ********
remote_password ********
clientid ha
try_private false
start_type automatic
topic # in
Then, this is my configuration.yaml regarding the MQTT broker:
# MQTT
mqtt:
broker: 172.26.0.112
port: 1883
username: !secret mosquitto_user
password: !secret mosquitto_password
protocol: 3.1
And in the same file right now (I haven’t created the switch.yaml yet), this is the switch part for the first Sonoff
- platform: mqtt
name: "Sonoff 01"
state_topic: "stat/sonoff01/POWER"
command_topic: "cmnd/sonoff01/POWER"
availability_topic: "tele/sonoff01/LWT"
payload_on: "ON"
payload_off: "OFF"
optimistic: false
qos: 1
retain: true
sonoff01 is what I configured in the switch itself. And by the way, here is the full configuration for the first one.
It appears in States, but with status unavailable. And obviously, it doesn’t work when I try to call any service to that Entity ID.
I think that I have included everything. So… what am I doing wrong? I have tried so many things that, right now, I don’t really know what is right and what is wrong.
Thanks