My Sonoff (tasmota) switches show the wrong status after rebooting, some show ON and some OFF, even though they are all ON. The config is all the same for all the switches, as follows, what could be the problem:
- platform: mqtt
name: "Bedside_Lamp"
state_topic: "stat/mainbedsidelamp/POWER"
command_topic: "cmnd/mainbedsidelamp/POWER"
availability_topic: "tele/mainbedsidelamp/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: true
# - platform: command_line
# switches:
# tsakibackup:
# command_on: "/usr/bin/curl -X POST http://192.168.1.133/cm?cmnd=Power%20Toggle"
# command_off: "/usr/bin/curl -X POST http://192.168.1.133/cm?cmnd=Power%20Toggle"
# command_state: "/usr/bin/curl -X GET http://192.168.1.133/cm?cmnd=Power"
# value_template: '{{value_json.POWER == "ON" }}'
# friendly_name: Bedside_Lamp_Backup
- platform: mqtt
name: "EnergyMeter"
state_topic: "stat/efergymeter/POWER"
command_topic: "cmnd/efergymeter/POWER"
availability_topic: "tele/efergymeter/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: true
- platform: mqtt
name: "Lights_UP"
state_topic: "stat/Lights_Ups/POWER"
command_topic: "cmnd/Lights_Ups/POWER"
availability_topic: "tele/Lights_Ups/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: true
- platform: mqtt
name: "Lights_down"
state_topic: "stat/Lights_Downs/POWER"
command_topic: "cmnd/Lights_Downs/POWER"
availability_topic: "tele/Lights_Downs/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: true
- platform: mqtt
name: "Bedside_Plug"
state_topic: "stat/Bedside_Plugs/POWER"
command_topic: "cmnd/Bedside_Plugs/POWER"
availability_topic: "tele/Bedside_Plugs/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: true
- platform: mqtt