I am running Home Assistant 0.82.0 in a docker container. I have a separate mosquitto server running successfully. My MQTT configuration is:
mqtt:
broker: 192.168.1.100
port: 1883
client_id: hass
username: mosquitto
password: "PASSWORD"
I have some sonoff switches running the tasmota custom firmware. I have set up the switches as close to default as possible. My switch configuration in HA is:
- platform: mqtt
name: "Sonoff Switch 1"
state_topiic: "stat/SONOFF_01/POWER"
command_topic: "cmnd/SONOFF_01/POWER"
availability_topic: "tele/SONOFF_01/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
state_on: "ON"
state_off: "OFF"
payload_available: 'Online'
payload_not_available: 'Offline'
retain: false
I can use HA to turn the switch on and off, and this works correctly. It also correctly updates the state in the HA GUI. However, when I turn the switch on and off using the hardware button, the state does not update in HA. I can subscribe the to the MQTT topic via the command line, and I see the same messages both ways. So why doesn’t HA see the status?