MQTT and auto discovery

Hi team.

I use MQTT pretty heavily in HA, with a mixture of esphome, tasmota, home brew arduino stuff, and some very custom integrations.

Ive been holding off on enabling mqtt autodiscovery because i havent wanted all my devices (particularly the esphome and tasmota ones) to get duplicated – and ive been onboard since before that was a thing.

So - if i enable auto discovery, what happens to the already configured devices ? Is it smart enough to know that a switch/light/sensor is already configured for that state/command topic ?

TIA!

Are any/all of your devices compatible with auto-discovery? They need to post their own config to a special topic for any of that to work. If you use a client to view that topic, you should be able to see the posts.

One safe method would be to temporarily remove all of your manually configured mqtt devices, enable auto-discovery, restart, see what shows up.

I guess the bigger question is why. If you e already got the manual config installed and working, what’s the point.

My main driver to turn it on is zigbee2mqtt.

Ive started using this and migrating things over from the aqara hub.
The mqtt config is getting … large!

Turn on autodiscovery, set homeassistant: true in the zigbee2mqtt configuration.yaml and let these be autodiscovered. As long as you don’t type setoption19 1 in tasmota, or the equivelant in esphome, nothing will happen with your existing topics.

Thanks @francisp, that makes sense.

Do you know what will happen to the existing z2m entries ? Will they get duped ?
Its not a HUGE deal if i have to cleanup, but would be a non trivial amount of work.

That I don’t know. I think if the have the same name they will not be duped, but I’m not sure.

I think they might get duped with “_2” added to end… But since you can now rename entity_ids for most things, you should be able to adjust once you notice the duplicates.