Node RED Docker not connecting to HA, logs empty, no autocomplete

I haven’t been successful trying to get Node RED (node-red-contrib-home-assistant-websocket) to connect to Home Assistant for a while now.

I’m running HA 2022.12.6 and Node RED 3.0.2 with node-red-contrib-home-assistant-websocket 0.47.1.

Running the node-red container in bridge mode with port 1880 forwarded results in not finding the HA instance in the web UI. Adding the server manually nets: “Deploy a valid server config for autocomplete to show results.”

When running it in host mode, the HA instance is found. Adding it still nets the above-mentioned message and no autocomplete results.

Running

sudo docker exec -it nodered bash
ping *homeassistant*
echo < /dev/tcp/*homeassistant*/8123

works both in host mode and in bridge mode.

Configuring the logging output in data/settings.js to

    logging: {
        console: {
            level: "trace",

does not help either.

docker compose logs -f nodered

does not yield any info regarding the home assistant integration.

Docker is running on a single host machine. Using one compose file versus two separate ones does not change the outcome.

compose.yaml for node-red

services:
  nodered:
    container_name: nodered
    image: nodered/node-red:latest
    restart: unless-stopped
    volumes:
      - ./data:/data
    ports:
      - "1880:1880"

compose.yaml for Home Assistant

services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    restart: unless-stopped
    volumes:
      - ./homeassistant:/config
    network_mode: host