I am in the process of migrating from Domoticz to HA.
Domoticz is installed on the RPi along with the MQTT server. Most devices work with Domoticz via MQTT.
I installed HA in docker on QNAP NAS. It works and automatically detected the MQTT broker on the RPi.
I installed the MQTT broker via CLI in the same docker where HA is located.
The logs and verbose mode show that the MQTT client from RPi logs into the broker on the NAS HA container.
QNAP NAS container broker logs:
home-assistant:/# mosquitto -v -c /etc/mosquitto/mosquitto.conf 1695292082: mosquitto version 2.0.15 starting 1695292082: Config loaded from /etc/mosquitto/mosquitto.conf. 1695292082: Opening ipv4 listen socket on port 1883. 1695292082: mosquitto version 2.0.15 running 1695292083: New connection from 127.0.0.1:50478 on port 1883. 1695292083: New client connected from 127.0.0.1:50478 as auto-67B9EC2F-572E-4C26-FBC8-77C0F9FA4BED (p2, c1, k60). 1695292083: No will message specified. 1695292083: Sending CONNACK to auto-67B9EC2F-572E-4C26-FBC8-77C0F9FA4BED (0, 0) 1695292083: Received SUBSCRIBE from auto-67B9EC2F-572E-4C26-FBC8-77C0F9FA4BED 1695292083: test/test (QoS 0) 1695292083: auto-67B9EC2F-572E-4C26-FBC8-77C0F9FA4BED 0 test/test 1695292083: Sending SUBACK to auto-67B9EC2F-572E-4C26-FBC8-77C0F9FA4BED 1695292095: New connection from 192.168.0.25:57162 on port 1883. 1695292095: New client connected from 192.168.0.25:57162 as mosqpub/503-NanoPi-NEO (p1, c1, k60). 1695292095: No will message specified. 1695292095: Sending CONNACK to mosqpub/503-NanoPi-NEO (0, 0) 1695292095: Received PUBLISH from mosqpub/503-NanoPi-NEO (d0, q0, r0, m0, 'test/test', ... (9 bytes)) 1695292095: Sending PUBLISH to auto-67B9EC2F-572E-4C26-FBC8-77C0F9FA4BED (d0, q0, r0, m0, 'test/test', ... (9 bytes)) 1695292095: Received DISCONNECT from mosqpub/503-NanoPi-NEO 1695292095: Client mosqpub/503-NanoPi-NEO disconnected.
Publish from RPi to QNAP NAS
root@NanoPi-NEO:/home/pi/domoticz# mosquitto_pub -h ha -t "test/test" -m "testujemy"
Logs from the broker on the NAS
home-assistant:/mosquitto# mosquitto_sub -v -t "test/test" test/test testujemy
I don’t know how to make HA see MQTT in its own container and download information from it for communication with devices. Any help? “Uncle Google” didn’t tell me anything interesting.