Need some help with MQTT Broker-Setup

Hi there,

Since I don’t have much experience with MQTT yet, I do need some help with the Setup - or better - with a specific case here in my Network.

First, I already had an installation running for some months… but - I had some issues with it… which I could not solve.

So let’s try to explain the Situation:

  1. I am running a Wallbox which does have a Mosquitto MQTT Broker installed.
  2. In HomeAssistant, I do have an Integration, which does provide Sensors for that Wallbox - but it requires the MQTT integration to collect the Data.

Now, the setup “recommends” to use another MQTT Broker - which does work as a bridge…
So basically, the “Bridged Broker” is receiving the Messages from the Broker running on the Wallbox.

With this setup, I had some issues … everytime, when either HomeAssistant OR the wallbox rebooted, I received old data from the Broker.
As far as I could get, this old data came from the “bridged broker” - which was running as Addon in HomeAssistant - and it was probably due to “retaining” and persistence of messages.

Unfortunately, I could not get this issue solved…

Due to other reasons, I’ve decided to do a clean installation of HomeAssistant - moving certain applications which run as Addons to their own Virtual environment - out of HA.
Until now, I do not have a new MQTT Broker installed - instead, I connected the MQTT Broker integration from HA directly to the Broker on my Wallbox.

My initial issue - with getting the old Data seems to be resolved with this setup - BUT:
I cannot configure any other MQTT Broker, because the Integration can only be installed one time - and can only handle one connection.

So, I would need to use the Broker on the Wallbox, if I want to add other devices that use MQTT for Communication…

Or - and here am I now:

  • Install another Broker on a Virtual Environment
  • Configure the Broker on the Wallbox as “Bridge”
  • and Connect HomeAssistant to the Broker running in the VM…

What’s your setup if you have multiple “brokers” in your network?
Which one do you configure as Bridge - and do you run it as Addon in HomeAssistant or strictly seperated?

I think you need to re-evaluate why you need two brokers…

Is there a specific reason you are setting up a broker on the wallbox instead of connecting to a different broker?

the broker on the wallbox is there by default…
And I don’t want to use this one “as default” broker for everything.

So - right now, I’ve setup a broker on my VM - and have already connected some of the clients to it.
Working fine…

Now, I am trying to set the Broker of my Wallbox into “bridge mode”… I’ve set up the server of the remote broker… set the prefix… etc.
It seems that the Wallbox is connected, but I don’t get any messages to the topic I’ve set up on the Wallbox…

Perhaps I am reading the wrong info.

The wallbox is a car charger right?

It doesn’t need a broker setup on it. It just needs to connect to a broker. It could connect to the same single broker you are using for home assistant atleast that is my admittedly very quick reading of the situation.

Yes, it is a car charger.
The Software already comes with an Mosquitto Broker by default…
There’s no way to disable it - as far as I know.

That’s exactly one of my main issues I do have :smiley:

No bridge is required. Instead, add the following to the configuration (for example in /etc/mosquitto/conf.d/openwb.conf):

sorry - maybe I am not that clear…

  1. I am already using this integration… (The whole setup was already working - with some issues…)
  • The OpenWB Wallbox DOES run its own broker.
    OK, so far?
  1. in my first setup, I followed a documentation which I found…
    It explained, the best option would be, to use a SECOND broker - and configure this second broker as a Bridge (client) - which does then connect to the broker on the Wallbox.
    → The Configuration example in your linked git - is exactly from this documentation.

This was working - but as explained, with a major issue:
On every reboot, I had some old data in HomeAssistant.
Tracing this back, it came from the Broker that was acting as a bridge.

  1. I know, that I can run the Broker on the Wallbox as a Bridge, too - which should then connect to a remote broker.
    This is, what I am trying to set up right now.

My first post was more or less to describe why I am considering this kind of setup.

There is no “mosquitto/conf.d/openwb.conf” → because the wallbox does not allow SSH access to the subsystem.
This config example does come from a Broker, running as a bridge.

You were pretty clear.
I just wasn’t sure if you can’t just connect the wallbox directly to an external broker.
Perhaps it isn’t possible as you say. I’ve never set one up.

This thread has a link to a nice example/explanation of a bridge setup.

This link specifically.

That should be on you main broker(the bridge) not the wallbox broker.
It shouldn’t really matter if you set that up in a separate VM/container/addon

I don’t particularly see an issue with having the broker(a single broker total) on your Wallbox either. Except perhaps if it is a wifi connection. It depends how much data you would be sending though I guess.

Right now, I came up with a “workaround” - because it is not my preferred solution…
I am using “only” the broker on the Charger - and sending the messages from other clients to it, too…

I am not sure, if this is increasing the load on the EV charger - and… since it has a simple purpose (to charge my car - and not replace my server) - I don’t want this to be the solution in the end…

Right now, I am also waiting for a reply on the support / community forum from that charger… maybe, I am just missing a simple config - like some tls encryption or stuff like this.

Thanks again for your effort - and support & sorry if I might sound a bit rude… that wasn’t my intension :slight_smile:

Ah and by the way:
I had this kind of setup already (running the bridge-broker) - but back then, it was an HA Addon - and caused other issues with each reboot of HA… therefore, I didn’t want to use the “server” broker as a bridge (because I could configure the broker on the charger as a bridge - should be pretty much the same - but I could use my broker also for other connections)