Node Red Docker on Ubuntu

I have installed Node Red In a Docker and cant get the USB port to talk to the docker for the node-red-contrib-rfxcom node.
Tried /dev/ttyusb0 which works with Homeassistant Docker but not Node Red.

And also the node-red-contrib-home-assistant-ws node wont connect.

Tried
Host: 192.168.85.5
Port: 8123
Password: HAPassword

Any Help Please.

None of that makes any sense… I’m assuming what you are trying to do is use node-red with Home Assistant? First, the USB port is not involved… nor is node-red-contrib-rfxcom.

  1. Open node red
  2. Go to Manage Palette and install node-red-contrib-home-assistant
  3. Go the Home Assistant palette and drag a block (like events:state) into the flow area
  4. double-click it
  5. In the server field, click the pencil
  6. fill in the address of your server (i.e., http://192.168.1.2:8123) and the password you set up in home assistant (if you have one)

I’d also suggest you read something like:

1 Like

Yes thanks For the advice.

I have used Node Red before and it all worked with the my RPI so I know what I am doing as far as setting Node Red up.

It says it can’t connect.

I am using the this with a NUC docker install but not with Hassio. I use the USB port for the RFXCom to control my 433mhz devices.

I am sure there is a way that my NUC will work with this.

I use node-red in docker on a NUC in my setup (with Home Assistant). In the node-red docker run command, are you mapping in your USB device with the --device=/dev/USBDeviceName ?

So I’m still confused… if you have RFXCom working with HA, then you don’t need to talk to it directly from node-red. Just have node-red talk to HA, then HA will control your 433 MHz devices. If you’re trying to use RFX Comm with Node-red directly without using Home-assistant, then this isn’t really the correct forum

Hi Steve.

Had a few problems with setting up Docker_compose.yaml
I didnt put in the homeassistant " network_mode: host " .

I use node-red directly with the RFXComm because it is a lot faster getting responses from my 433mhz door sensors. In HA they took 25 seconds to get detected and in node-red its instent.

Thanks i put this into node-red and it worked…:grinning::grinning:

devices:
- /dev/ttyUSB0

The Home Assistant node-red still wont connect i think its not seeing the HA.

I do really appreciate all your help because i am a noob at this docker thing…

I still am having problems with Appdaemon in docker and Google_Assistant as well.

This is my Docker_compose.yaml

version: '3'
services:

  portainer:
    container_name: portainer
    image: portainer/portainer
    volumes:
      - /home/cameron/docker/portainer_data:/data
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - "9000:9000"
    labels:
      traefik.enable: "true"
      traefik.frontend.rule: "Host:portainer.my_domain.net"
      traefik.port: "9000"

  traefik:
    image: traefik:latest
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /home/cameron/docker/traefik/acme.json:/acme.json
      - /home/cameron/docker/traefik/traefik.toml:/traefik.toml
    network_mode: host
      homeassistant:
        container_name: home-assistant
        restart: always
        image: homeassistant/home-assistant
        devices:
          - /dev/ttyUSB0
        volumes:
          - /home/cameron/homeassistant:/config
          - /etc/localtime:/etc/localtime:ro
          - /home/cameron/hass_media:/media
        depends_on:
          - "mqtt"
          - "nodered"
          - "appdaemon"
        network_mode: host
        labels:
          traefik.backend: "hass"
          traefik.enable: "true"
          traefik.frontend.rule: "Host:hass.my_domain.net"
          traefik.port: "8123"
        ports:
            - "8123:8123"
            - "51826:51826"

      nodered:
        container_name: mynodered
        restart: unless-stopped
        image: nodered/node-red-docker
        user: "root"
        devices: 
          - /dev/ttyUSB0
        volumes:
          - /home/cameron/docker/node_red:/data
          - /etc/localtime:/etc/localtime:ro
        ports:
          - "1880:1880"

     appdaemon:
       container_name: appdaemon
       restart: always
       image: acockburn/appdaemon:latest
       volumes:
          - /home/cameron/docker/appdaemon/conf:/config
          - /etc/localtime:/etc/localtime:ro
       ports:
          - "5050:5050"
          - "5001:5001"
1 Like

For the Home Assistant connection, assuming you are using THIS one, use the same URL you use the access Home Assistant from your phone or computer. For me, with SSL, its https://xxx.duckdns.org:8123

Dont include any slashes at the end.

Hi @gregg098

i had the websockets one installed which did not connnect.

I then tried to install "node-red-contrib-home-assistant 0.3.0 " from within node-red but it said it installed but when i restarted Node-red the nodes went there.

Screenshot%20from%202018-03-19%2020-54-12Screenshot%20from%202018-03-19%2020-53-42

Not sure what to do now.

The new version only works with NodeJS 8.x. Its an easy fix though. In your Docker-Compose file, change

image: nodered/node-red-docker

to

image: nodered/node-red-docker:v8

then docker-compose up -d nodered.

1 Like

Thanks Mate @gregg098 your a Diamond :gem::gem:
I updated my docker_compose.yaml file and it installed. and worked.

Thanks

Slowly getting my HA NUC up and running…

I should mention that the 0.30 Home Assistant nodes look identical to the 0.2.1 nodes, but I did run into some issues. Some flows would work randomly. Others not at all. Others perfectly. I found some notes on the GitHub page about it possibly not being backward compatible, but no solid details. I ended up recreating all of the Home Assistant nodes one by one, deleting the old ones and inserting the new ones into my flows. PITA, but everything works now. I couldn’t tell the difference between the ones I was deleting and the ones I was adding, but there must be some behind the scenes details left out in the upgrade on the old nodes.

I love this forum, having this error working on getting my nuc ready. This was the fix… THanks

same here, this comment saved my drywall from a hole. what i dont understand is people who are posting their docker-compose file do not have this.

It’s because those compose files are from before you needed the v8 tag. Here’s my current one:

version: '3'

services:
  nodered:
    container_name: nodered
    image: nodered/node-red-docker:v8
    volumes:
      - /var/homeserver/nodered:/data
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
    user: '1000'
    network_mode: host
    restart: unless-stopped

Yup. That would make sense. Most people I see are version 2

It has nothing to do with the compose file version … it’s that there was a change to the node red plugin that required using the v8 version of nodered.

Hi there, new to all this. How do I make that change ‘v8 parameter’ in portainer ? I found my docker-compose file but it appears to be unused and has some default config in it but nothing relating to the few containers I have setup (NR, HA)