MQTT lights not reporting state since upgrade


I have upgraded an ancient Home Assistant to 2024.3.0 - well, I’ve re-built a new HA instance and am re-configuring everything. I have a dozen or so Tasmota switches (Shelly 1 devices for the most part, flashed to Tasmota firmware) that talk to HA over MQTT.

These are also pretty old, they run Tasmota 7.1.2, and if I can avoid the risk of re-flashing them (OTA) that would feel safer.

Before, each light would turn up as a light, without any particular configuration.yaml mqtt stanzas. This was done by having the following configuration in Tasmota:

Topic: A name, e.g. study_ceiling_light
Full topic: %topic%/%prefix%/

And in the console:

SetOption19 1 # HA auto-discovery
SetOption30 1 # Present a switch as a light

With this in place and the new Home Assistant, my lights turn up, but their state is not reporting. So instead of an illuminated/unilluminated light bulb and an on-off slider in the UI, I get a light bulb and two separate buttons for “on” and “off” (lightning bolt icons). And in my automations, I can’t act on whether the light is on or off.

I have seen other topics that explain how to configure lights in configuration.yaml with lots of lines per switch, but given this wasn’t required before, I’m confused about why it might be now with the newer version.

Any idea what I ought to change or tweak?

Reset the configuration

Setoption19 0
Setoption19 1

Unfortunately this did not change anything.

A reasonable if slightly laborious workaround is to not set option 30 (so: SetOption30 0) and now everything appears as a switch. I can then get HA to show the switches as lights. This does retain state.

Ah yes, old Tasmota versions, I had to create custom discovery messages for them to work.

The answers are here:

Basically upgrade to Upgrade to Tasmota >v9.3 to gain HASS Tasmota integration (your version is too old to support Setoption19 0).

Switching from HASS to Tasmota discovery has many advantages, not least support for measurement units and I suspect you’re finding issues as most other folks have upgraded. Newer firmware also upgrades more cleanly due to the space saved by removing HASS Discovery - you just need to do it in stages if you wish to retain Tasmota stored settings.

I’ve upgraded many Tasmota device firmware and had very few failures (typically crap ESP01 boards, not Shelly nor Sonff devices). A fleet of devices can be upgraded with a single command.

If this helps, :heart: this post!

I still have many on Tasmota 6.6.0 , just created a script with new discovery messages.
And for upgrading, be sure to follow the correct path !