Cannot save prefix in HA for MQTT

I’m trying to set up Zigbee2MQTT, almost everything works, except that HA automatically detects/add devices that Z2M already detects.

The problem must be somewhere around the prefixes, because the connection to the MQTT broker (mosquito) works perfectly from both sides (HA and Z2M).

In HA, however, I noticed that even if I change the discovery prefix to anything, after saving it always comes back to “zigbee2mqtt”, as if it is stuck (there is nothing in configuration.yaml about this). This might not be a problem, because then I set it in Z2M to send devices with this prefix, but it still doesn’t recognize them in HA. Where could the problem be?

202673_uovda67rpy3lpdva_mqtt_prefix

I had to remove the integration, then add it again, and it solved the issue.