I have Home Assistant installed using docker-compose, together with zwave-js-ui. I have everything working properly, but on restart, sometimes the IP address of the containers change, and HA is unable to connect to zwave. The usual way to deal with this is to use container names instead of IP addresses, but it seems Home Assistant is unable to do that.
Here's my current docker-compose.yaml (simplified a bit to remove some non-zwave device stuff):
Sorry, I understood the OP was asking about hostnames, but I was wondering how you use the above configs and still have mDNS/dns-sd/zeroconf discovery work for devices that advertise on the host network. e.g. an mdns reflector? It's bridge in both cases and that's isolated.
If you can ping (and thus resolve) using the name zwavejs but ws://zwavejs:3000 doesn't work that seems like something else, right? Do the logs show it attempting to connect and failing?
Using the above OP's config I see this, so it's resolving correctly:
homeassistant | 2026-05-29 14:39:16.450 DEBUG (MainThread) [homeassistant.components.zwave_js] Failed to connect to Z-Wave JS server: Cannot connect to host zwavejs:3000 ssl:default [Connect call failed ('172.27.0.2', 3000)]
But in my case port 3000 isn't open because I haven't enabled the websocket (or configured the serial port)
homeassistant:/config# nmap -p 3000,8091 172.27.0.2
Starting Nmap 7.97 ( https://nmap.org ) at 2026-05-29 14:42 +0000
Nmap scan report for zwavejs.ha-net-test_default (172.27.0.2)
Host is up (0.000031s latency).
PORT STATE SERVICE
3000/tcp closed ppp
8091/tcp open jamlink
MAC Address: C6:6D:85:18:06:9F (Unknown)