Change Base Topic in Zigbee2MQTT

In newer versions of Zigbee2MQTT, the discovery topic and base topic cannot be the same.

I changed the base topic from “homeassistant,” which was the same, to “zigbee2mqtt.”

The result is that my buttons still work, but devices with states, such as lights, do not.

When using an MQTT explorer, I can see that the messages generated on the Mosquitto MQTT server appear correct: discovery messages are in the “homeassistant” topic, referencing the new base topic “zigbee2mqtt,” where the new state messages, etc., also appear.

However, it seems that Home Assistant is not automatically picking up the updated discovery messages, and it’s reporting the devices as “unavailable.” I suspect I missed a step to prompt Home Assistant to reprocess these messages. Is there a way to do that?

EDIT: I see the change base topic leads to a new entity with a new entity id => is it somehow possible to matche the new entity to the old one so that automations and everything continues working?

EDIT2: If opening every device and then opening the “old sensor”, copying the Name and ID to the “new sensor” in a second browser tab, deleting the old one before saving the changes on the new one it seams to work => but if anybody has a better way to do this please share it with me as I have 75 devices with multiple seonsor to update.

Regards,
Petr

Hi Petr;

Same issue here. I just migrated from an old 8yo server to a new one, and it appears my very old Z2M doesn’t accept my old settings, thus similar, I have 50-60 devices I need to manually change also.

Did you find a work around?

Sorry not really found an alternative to a cup of coffee and going trought the list. But using to browser windows for “old” and “new” did help to make it quite fast.

1 Like

Hi pbel78,

I found a halfway ground;

-re-configured the MQTT integration with the new base and discovery topics separate (homeassistant and zigbee2mqtt respectively), which seemed to capture most sensors.

-used crafty find/replace skills in automations.yaml to replace all automations there were relying solely on mqtt topics/messages.

This was relatively quicker then I thought, and it resolved 95% of issues. Few minor ones were mopped up manually with multiple windows open etc as you said.

Thanks