Hey there,
I have a few Sonoff Devices flashed with Tasmota 5.14 and android-core 2.3.0 and they worked fine. I have added them to HA as switches/lights via MQTT (using mosquitto). Today I realized that one of my Sonoffs would turn itself off right after I had turned it on via HA. I think I had restarted HA prior to the issue. So I did some research and thought it could be caused by a bugged retained message. So I cleared the retained messages, which fixed the problem but weirdly caused a new issue: HA does not read any states of my MQTT switches/lights anymore. They are always shown as off, switching them does send the payload “on”, but the switch will jump back to off anyway.
I can send mqtt messages from HA and they are received normally. HA is also subscribed to other topics (zigbee2mqtt) which states are received correctly by HA.
Here is my config:
mqtt:
broker: core-mosquitto
username: Redacted
password: !secret mqtt_pass
discovery: true
discovery_prefix: homeassistant
light:
- platform: mqtt
name: Schlafzimmer
state_topic: "stat/LichtSchlafzimmer/POWER1"
command_topic: "cmnd/LichtSchlafzimmer/POWER1"
availability_topic: "tele/LichtSchlafzimmer/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: false
switch:
- platform: mqtt
name: "Bildschirm"
state_topic: "stat/Bildschirm/POWER1"
command_topic: "cmnd/Bildschirm/POWER1"
availability_topic: "tele/Bildschirm/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: false
I also have the PowerRetain option enabled on the devices. As I said, I did not really change anything (except for restarting Hass.io and adding another Sonoff)
Any help/Ideas?