Node-RED

As per their website: Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways.

With default install, you can wire up API, mostly.

I installed Node-RED on my VPS using their Docker image: https://hub.docker.com/r/nodered/node-red

If you want to use Ansible to deploy your Node-RED (in my case behind Traefik v2):

  - name: node
    docker_container:
      name: node
      image: 'nodered/node-red:latest'
      networks:
        - name: YOURBRIDGE
      purge_networks: yes
      env:
        TZ: "Europe/Brussels"
      labels:
        ansible: "true"
        traefik.enable: "true"
        traefik.http.routers.node.entrypoints: "https"
        traefik.http.routers.node.rule: "Host(`nodered.example.org`)"
        traefik.http.routers.node.tls: "true"
        traefik.http.routers.node.tls.certresolver: "letsencrypt"
        traefik.http.services.node.loadbalancer.server.port: "1880"
        traefik.http.middlewares.node-auth.basicauth.users: "user:XXXXXXXXXX"
      volumes:
        - "/opt/docker/nodered.example.org/data:/data"

You can find community developed “nodes” (see them as connectors or plugins) here.

This is an example of diagram to interact with my Netatmo thermostat:

This uses four external nodes:

To install an external node from the community, connect to your container and run:

npm install NAME-OF-MODULE

Also make sure to enable projects in Node-RED, this allows you to store flows in Git repositories.

Add in your settings.js:

    editorTheme: {                                                              
        projects: {                                                             
            // To enable the Projects feature, set this value to true           
            enabled: true                                                       
        }                                                                       
    }

Learn more about projects here.




Thanks for reading this post!


If you found an issue in this article, you can create an issue on Github.

If you have a comment or question, please drop me a line below!