Can't figure out config for both local and remote MQTT brokers

Hi all. After a couple of hours of browsing the forums and messing with config files, I’m still stuck. Here is the situation:

My installation is HA OS on a Raspberry Pi. I previously configured the MQTT integration to pull data from a separate Raspberry Pi running software called Solar Assistant, which exposes data read via a serial connection to my solar inverter. Solar Assistant includes an MQTT broker, and the HA MQTT integration has to date worked fine accessing data from that broker.

However, I now want to add the ring-mqtt add-on to pull data from my local Ring alarm network. I was able to successfully install Mosquitto and ring-mqtt, and the logs indicate that this part of the system is working properly.

I understand that you cannot have more than one instance of the MQTT client integration, and that the solution to using multiple MQTT sources is configure Mosquitto to bridge the data from the remote broker. So I added the following config file in /share/mosquitto/mosquitto.conf:

connection solar-assistant-bridge
address 192.168.1.65:1883
cleansession true
try_private true
allow_anonymous true
topic # in 0

When I start Mosquitto, I see the following in the log file:

[20:00:19] INFO: Starting mosquitto MQTT broker...
1705464019: Loading config file /share/mosquitto/mosquitto.conf
2024-01-16 20:00:19: Warning: Mosquitto should not be run as root/administrator.
2024-01-16 20:00:19: mosquitto version 2.0.18 starting
2024-01-16 20:00:19: Config loaded from /etc/mosquitto/mosquitto.conf.
2024-01-16 20:00:19: Loading plugin: /usr/share/mosquitto/go-auth.so
2024-01-16 20:00:19:  ├── Username/password checking enabled.
2024-01-16 20:00:19:  ├── TLS-PSK checking enabled.
2024-01-16 20:00:19:  └── Extended authentication not enabled.
2024-01-16 20:00:19: Opening ipv4 listen socket on port 1883.
2024-01-16 20:00:19: Opening ipv6 listen socket on port 1883.
2024-01-16 20:00:19: Opening websockets listen socket on port 1884.
2024-01-16 20:00:19: Connecting bridge solar-assistant-bridge (192.168.1.65:1883)
2024-01-16 20:00:19: mosquitto version 2.0.18 running
2024-01-16 20:00:19: New connection from 172.30.33.2:56124 on port 1883.
2024-01-16 20:00:19: New client connected from 172.30.33.2:56124 as mqttjs_ed7a147c (p2, c1, k60, u'addons').
2024-01-16 20:00:19: New connection from 127.0.0.1:52630 on port 1883.
2024-01-16 20:00:19: Client <unknown> disconnected due to protocol error.
[20:00:21] INFO: Successfully send discovery information to Home Assistant.
[20:00:21] INFO: Successfully send service information to the Supervisor.

This suggests to me that the bridge configuration is being read correctly from the config file, but that’s as far as I get. The MQTT integration cannot find a broker on the HA OS device’s IP address, so I don’t even know if the bridge is fetching data from the remote broker. And of course without a connection to the local broker I can’t get any Ring data either.

Any feedback would be much appreciated!

/afb

Okay, I solved this. I needed to add a local HA user and then configure the MQTT integration with that user. Once I did that, both the remote and local MQTT client data were visible.

1 Like