Possibility to configure multiple MQTT Servers (more than one)

I would really love to see a way to configure multiple MQTT Servers in the MQTT integration.
Right now, it seems, that the limit is one… which should work for MOST cases, but in some others you might have different systems that have their own built in MQTT server.

I know, that you could configure a bridge, but what is the reason for limiting the configuration to one?

Mosquitto can be configured to bridge messages from other MQTT servers as well.

You can add an external MQTT server on another machine and setup a bridge for selected topics (or all). I did that for a while, just running mosquito on a Pi and bridging in things that HA needed.

Mosquito is tied kind of tightly into HA, so adding another instance would be a bit tough but I’m sure already possible as a different software addon.

Yes, I am aware of the “Bridge” configuration.

anyway - there’s a specific reason for this request - and configuring a bridge would require to be able to change settings on systems that bring their own MQTT implementation (which could be, that it is not always possible).

In my case, my wallbox does have it’s own mqtt server - and I faced issues in the past when using a bridge…

I want to avoid using the Wallbox’ MQTT for other services, such as z2m - and causing unnecessary load on the Wallbox… also, I want to run a test of a new Software package for this wallbox - and right now, this newer Software is running in a dedicated test environment on my Proxmox installation)…

It has - of course - it’s own MQTT and using the same topic by default.
Again, I can change the topic, and use an MQTT Bridge configuration - but just be able to configure another MQTT Server in the integration would make it so much easier.

And there’s still no explanation, WHY it is not possible to configure a second Server.

Now, imagine, I want to integrate something communicating per MQTT, to which I don’t have access to configure it to use a bridge, etc.

+1 on this one. I use MQTT for Shelly (more responsive for my usage, regular entity carries a time delay for triggering) and now got a solar power hub that also uses MQTT. Configuring a bridge that then connects to Home Assistant seems a bit complicated and counter-intuitive, Home Assistant is the Hub for all Integrations, so why do I need to consolidate multiple MQTT servers elsewhere and then source them into Home Assistant. It would be very nice to have this ability directly in the MQTT integration to add a second MQTT server in the connectivity of the integration that will push its entities into Home Assistant.

-1 from me on this.

MQTT with multiple brokers from one device (eg HA) gets messy almost immediately and is very difficult to diagnose as MQTT brokers do not have a mechanism to show who updated a topic/payload. It is far tidier to have one master broker with other devices that might have use of their own broker bridged into that.

Likewise HA having device discovery and updates originating from multiple brokers is also really difficult to diagnose and may have conflicting entries. A single broker avoids this.

1 Like

You don’t need a bridge, simply change your shellies to use the solar power hub’s broker.

Totally agree. I have more than 900 mqtt entities, I don’t look forward to any breaking change by this FR.

image having to change this

  trigger:
  - payload: 'ON'
    platform: mqtt
    topic: sensor/doorbell_sensor

to

  trigger:
  - payload: 'ON'
    platform: mqtt
    topic: sensor/doorbell_sensor
    broker: one

or this

  action:
  - data:
      payload: '14163857'
      topic: home/OpenMQTTGateway/commands/MQTTtoSRFB
    service: mqtt.publish

to

  action:
  - data:
      payload: '14163857'
      topic: home/OpenMQTTGateway/commands/MQTTtoSRFB
    service: mqtt.publish
    broker: two

a nightmare.

1 Like