Two Solar Assistant boxes, same "uniq_id" for each sensor, how to fix?

I have been running the Solar Assistant integration via MQTT successfully for years. I have several other MQTT devices running as well, all work fine.

I added a second Solar Assistant box to monitor some other batteries on site.

It looks to me like the two SA boxes are publishing duplicate config messages - each of which set the “uniq_id” of their sensors to the same name. ie

homeassistant/sensor/battery_4_voltage/config {"device":{"ids" ["bt_solar_assistant"],"mdl":"Unknown","mf":"Unknown","name":"Not connected"},"device_class":"voltage","name":"Voltage"," state_class":"measurement","state_topic":"bt_solar_assistant/battery_4/voltage/state","uniq_id":"battery_4_voltage","unit_of_measurement":"V"}

In this case, both SA boxes set the unique ID of their battery #4 voltage sensor to “battery_4_voltage” - ie the “unique ID” isn’t unique lol

So the entity that shows up in HA is sensor.battery_4_voltage.

Any way to fix this without changing things on the Solar Assistant side of things?

The state messages do have a different prefix if that helps - just the sensor ID is duplicated…

Thanks!

I am using the Home Assistant auto discovery option in Solar Assistant.

Just realized that for my other MQTT sensors, I have a file in my packages directory that defines each sensor, including its unique ID - but for the SA ones I am letting it happen automatically.

If I set up a file for Solar Assistant sensors in my package directory, will that over-ride the config messages that the SA boxes are sending via MQTT and allow me to assign a unique name to each sensor?

Experimentally, then answer seems to be “yes” - if I have a packages/*.yaml file for these sensors then I can override any “config” messages coming in via MQTT and assign whatever name I want, which is excellent.