Switches states in Lovelace not being updated after HA restart

I have a couple of Tasmota enabled switches defined and working great. I can control them anywhere and if I turn them on or off in Lovelace or from the States page, their status is shown correctly as ON or OFF.

However, I have an automation set to turn them on/off and when that fires, the state in Lovelace does not update. The logger shows the switches being turned on.


lights not on
Greenshot 2020-02-10 06.13.06

Could it be that the state of the switches is not being read after the HA restart at 2:00AM?

executing the Automation manually shows the state change right away.

It’s not a show stopper, but it is annoying!
Any tips to have HOME ASSISTANT read Tasmota switch states correctly after a restart?

Jeff

Rob from the Hook Up explains it best:

To summarize:

You need your state topic from Tasmota to be retained. Log into the tasmota device and type

PowerRetain On

Now the states it advertises will be retained so when you reboot, the MQTT server will publish the state topic to your HA client.

I recommend the full video for other important things. Such as, do NOT set the retain flag for the cmnd topic!!

Ok, got it. That was a pain. I have dozens of these. Is this permanent, or will it be retained on power cycle? why on earth is this not the default behavior? Or at least a config flag somewhere either in the Tasmota interface or in HA.

Jeff