Homeassistant to MQTT Service

hendrik2023

Cadet
Joined
Jul 28, 2023
Messages
3
Hello guys,

(sorry for my partly bad english).

I want to do the following: i have my VM homeassistant (running with the IP 192.168.178.205), i have MQTT running as a "APP" on TrueNAS Scale in another subnet (192.168.90.81). I use metallb as "loadbalancer" here for my apps.
I have two networks, 192.168.178.0/23 and 192.168.90.0/25. My IoT devices are in the second subnet, all others in the first one. So i planned to do mqtt in my iot subnet - works great so far. Homeassistant is in my other network (192.168.178.0/23) because i want to use homekit and homekit does not work well, between two subnets (so far i know). My NAS has three NIC's, 192.168.178.18/23, 192.168.178.220/23 and 192.168.90.21/25. I have done a bridge with the .220 NIC and bindet it with my VM, so now i can ping the host(TrueNAS Scale) from my VM. Of course only in the same subnet, so now i can ping from my VM (homeassistant/192.168.178.205/23) to 192.168.178.18 and 192.168.178.220. But not to 192.168.90.81. So i allowed this in my UDM PRO Firewall settings, i can ping 192.168.90.81 too now. But i can not connect to the mqtt service. (The mosquitto server works, i can connect to it from all other devices).

I dont know if this is the right forum, but how can i solve this problem? What would you do?

(I really dont want my mqtt in the other subnet...)
 

stephon1024

Cadet
Joined
Apr 18, 2023
Messages
5
Whew! There is a lot to unpack here.

My first gut says check the ports that mosquito is using in your VM - then make sure your firewall allows those ports across the sub nets. Just because you can ping the IP address doesn't mean the ports that the MQTT is using are open and allowed. That would be my first guess...

If that doesn't work, it could be an issue with the way you're setting up your MQTT in Home Assistant. I've found the easiest way to setup Mosquito in Home Assistant is actually running Mosquito in a Linux VM - not the actual Home Assistant "integration". Then I just used the generic MQTT integration and pointed it toward the right IP address and port and BAM. Everything worked.

You've got a lot going on in your internal network that adds some interesting complexities to getting an MQTT working - but you should be able to get everything working with the right setup.
 
Top