I had a very hard time getting my Homeassistant Docker instance to connect to my zwavejs2mqtt Docker instance via websockets. I tried using the zwavejs2mqtt container name, “localhost”, and the container IP and it would not connect… it finally worked when I used " ws://127.0.0.1:3000". Does anyone know what that is? Why can’t I connect using the container name?
Is it because I have my docker-compose file incorrect, ie… “network_mode: host” for HA but not for zwavejs2mqtt?
Just curious, I have not knowing why something doesn’t work.
I use basically your same setup (HA Container and zwavejs2mqtt container) and mine worked by putting in the host IP (192.168.1.11) and the correct port number for the zwavejs2mqtt websocket (3002 in my case since I already had something running on port 3000).
that is the address of the local machine thru it’s loopback adapter. Almost every machine has that same local address.
So what you are telling the integration is to look at your host at port 3000 for the websocket.
But if you moved the zwavejs2mqtt to a different host then that would no longer work since it’s no longer on the local host machine.