Separate Devices Running MQTT IO Are Recognized as a Single Device in Home Assistant

I appreciate the work of the devs and the community support.

I have a question: I have two separate instances of MQTT IO running right now on two Raspberry Pis (more to come), independent of my HA device, but they get merged into a single device in HA (Mosquitto) with all of the entities under the single device.

I am guessing that I need to change my ha_discovery settings in mqtt-io.conf, but not sure how right now.

Each instance has its own MQTT user, it’s own topic prefix, and a unique name under mqtt.ha_discovery. The device name that shows up in HA is the one that connected most recently.

With MQTT Explorer, I confirmed that the two instances have different unique IDs.

Any idea what I need to change in my configs to get the two to be recognized as separate devices in Home Assistant? Thank you.

I think that I figured this out, in case anyone else is running into the same issue:
It looks like MQTT IO reports two identifiers when it makes its availability report to HA via MQTT: the device name, and, separately, “mqtt-io”. It looks like HA gets confused with multiple devices reporting the same identifier, even if there are unique IDs that accompany the duplicated one.

So, my workaround involves deleting

“mqtt-io”,

from the “identifiers” line in

(python virtual environment location)/lib/python3.11/site-packages/mqtt_io/home_assistant.py

It seems like this could have some unintended consequences, so I’d appreciate the input of anyone with more experience on this.