MQTT Show status on restart

Hi, I have Mosquitto broker V1.0 running on HASSIO V061.1

I have some Sonoff units with custom firmware.

When I restart HA, it does not show the current status

my switch code is

- platform: mqtt
  name: "Sonoff_3"
  command_topic: "cmnd/sonoff_3/power"
  state_topic: "stat/sonoff_3/POWER"
  qos: 1
  payload_on: "ON"
  payload_off: "OFF"
  retain: true

Is this possible, see lots of posts but can seem to find a solution.

Thanks in advance

Take a look here:

1 Like

Many thanks, for the reply.

That did the trick “PowerRetain 1”

Regards Dave

1 Like

Haha, it worked also for me.
And no need of mentioning “retain: whatever” in the config.