Lost most of my switch entities

Hi all. I’m running three docker containers on a Rasperry Pi 3: one for Home Assistant, one for Zigbee2mqtt and one for Mosquitto. I was using old versions of these components (back from 2021) until last week, when I decided to upgrade everything to the latest version.
So I updated. Home assistant needed some configuration changes (totally expected), which I applied, and now most things work. The problem is that devices that should be toggleable, don’t show as switches anymore.

Specifically:

  • I’ve got a Sonoff BASICZBR3, which shows up in Zigbee2mqtt and I can even toggle it on and off through the z2m frontend. However, this device appears to have only one entity in HA, which corresponds to linkquality. No switch entity.
  • I also have a Blitzwolf SHP-15 smart socket, which is listed as TuYa TS011F_plug_3. Same story: I can toggle it through the z2m frontend, but no switch appears in HA.

Any ideas?

Thanks in advance.

This could be an issue with your mqtt broker not retaining (or publishing retained) messages. See: messages are no longer retained with 2.0.16+ (with a lot of reained topics?) · Issue #2887 · eclipse/mosquitto · GitHub

Try reverting to Mosquitto Broker v2.0.15.

Hi, thanks for your reply. Unfortunately, the problem remains after downgrading mosquitto to v2.0.15.

Use MQTT explorer to see what discovery topics are sent to your broker by Zigbee2Mqtt.

They will be under the homeassistant topic.

Hi, I installed MQTT Explorer and connected to my mosquitto instance.
I found the missing switch, under the homeassistant topic:

Still, Home Assistant does not display the switch in the entities list… I really don’t understand what’s going on :frowning:

Ok, I figured this out! I’m on Home Assistant 2023.6.3, which is not the latest version (somehow the image/tag “homeassistant/raspberrypi3-homeassistant:stable” downloads that version instead of the latest one). So based on that, I had to downgrade Z2M to version 1.32.2, since newer versions require HA 2023.8.0. After downgrading, it works!

I found this information in the following related thread: Zigbee2mqtt and home assistant help - #9 by Tinkerer

Thanks for all the help!

1 Like

For some time now raspberrypi3-homeassistant has been deprecated and you should have been using just homeassistant.

I didn’t know. Thanks for the info!