Sonoff basic(tasmota firmware) - no realtime status after reboot

Hi,

I configured mott like this:

  - platform: mqtt
    name: "sonoff-basic_02"
    state_topic: "stat/sonoff_basic_02/POWER"
    command_topic: "cmnd/sonoff_basic_02/POWER"
    qos: 0
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    optimistic: false

The problem is when I reboot hass I don’t get correct status from device. Status is alway off after reboot has (if I look on device is on).

How to get correct ststus form device after hass restart?

You would need the retain flag to be set to true for the status to remain on the MQTT bridge/broker.
I know you can set this on the HA side (which I assume is for HA commands) but not sure if you can set this on the Tasmota side…

1 Like

Thanks @lolouk44

In hass I add to my configuration:

retain: true

In tasmota firmware I enter command in console:

cmnd/sonoff_basic_02/PowerRetain ON

Now Is working :smile:

1 Like