I've created an image that starts with Homebridge-Raspian-Image then layers on, a Node-Red installation including a dozen Hubitat common Palettes.
In other words, it's a very good place to start if you're new to Hubitat, Node-Red or Homebridge.
[Note: I happened to choose Homebridge-Raspian-Image over HOOBS because I personally have had better luck with that image. It's just a personal preference.]
Upon boot, as with Homebridge-Raspian-Image or HOOBS, there's a wifi-direct SSID that you join with a phone or similar device and select your home's WiFi and password. It takes at least a minute perhaps two, for the SSID to appear... be patient.
SSID--> Homebridge WiFi Setup
After selecting your WiFi and entering your Wifi password, the pair of NodeJS servers will start and you can browse to them as usual:
http://<your rPi IP address>/ <-- Homebridge
http://<your rPi IP address>:1880 <-- Node-Red
Both Homebridge plugins for Hubitat are preloaded. Use either HubConnect or MakerAPI.
The following Node-Red palettes are preloaded:
node-red-contrib-bigtimer
node-red-contrib-boolean-logic-ultimate
node-red-contrib-castv2
node-red-contrib-hubitat
node-red-contrib-noop
node-red-contrib-pushover
node-red-contrib-state-machine
node-red-contrib-stoptimer2
node-red-contrib-string
node-red-contrib-time-range-switch
node-red-contrib-unsafe-function
ttb-node-red-counter
Raspbian-Homebridge-Node-Red Note that this qualifies as the world's ugliest page. I spent no time on it... yet.
How the Image was built
=== Create a Homebridge image and boot to it.
=== Install both Hubitat plugins and update the UI and Homebridge if needed.
If you use HubConnect already, then use the HubConnect version. Otherwise, use the MakerAPI version.
As far as I can tell the two are not significantly different. They both need to perform the same overall tasks. In my head, it's similar to Date format between the US and Europe. The information is the same, the order is different.
The HubConnect version has some additional reporting, consistent with HubConnect, while a MakerAPI version has no where to send such data.
One item I forgot to mention is that this Image can be JUST a Node-Red solution. You don't HAVE to use the Homebridge portion. It can sit there unused and not affect performance.
It's certainly a 'better way' of experimenting with Node-Red. As far as I know, there's no other pre-built rPi image for Node-Red, and certainly none with Hubitat centered pre-installed palettes.
Quick question - I already have Homebridge (RPi image) and I think you told me that I could use the "curl" command in your document (How the image was built) by selecting "Terminal" from the Homebridge menu and then running the command.
On the palletes - is there a reason to install them using npm or can I just install them once I have node-red up by using the "Manage Pallete"?
I didn't really WANT to be pedantic but at the same time, I know that Some People (and they know who they are ) would like to 'bulk load' via npm, or simply feel more comfortable. I'd go with the GUI (Manage Palette) personally. All the 'goodness' is there for reading about the node and then installing, updating, deleting.
Thanks - I already have a version configured and working (connected to Homebridge and Hubitat) on my Mac, but I wanted to use that as a “dev” instance and have a “prod” version on the RPi. I’d installed the palettes using the GUI so I was wondering if there was a reason (permissions, default location etc.) to install via command line. Good to know that I can just use what I’ve done before.
@csteele - I tried the command to install node-red and it did not work. I just copied the command from your instructions - did I miss something? (I'm not Linux literate, so apologies in advance). This is the error message I get.
Thanks for your help UPDATE: Looks like there is an extra forward slash before "<" in the command. I was able to run it without the "/" [bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)] but then got this error:
UPDATE2: I guess when the node-red installation started, it removed Node.js but could not re-install it , and essentially bricked the Homebridge install. All turned out OK as I downloaded the pre-built Homebridge+Node-red image, flashed it to another SD card, restored by Homebridge back up (I did make one just before I started this process ) and it's back up with both running )
Well - one more thing before I call it a "success"!
The pre-built image has v1.0.6 of node-red and my flows are on v1.1.1. How do I update node-red from the Homebridge+Node-Red image? I'm a little reluctant to run the install script as that apparently removes node.js (not sure why since the notes say that if node version is 8.0 or later it should leave it alone).
Will update-node-red do it? I'm assuming that I will have to run "node-red-stop", "update-node-red", "node-red-start" but looking for the correct way. Also, will I need to change to the node-red directory (I could not find the node-red directory at the root level, so not sure if it is a "hidden" directory)?
I thought I had run the upgrade to v1.1.1 myself to test it out on Thursday.. so.. I'm trying it again right now.
It's not done yet BUT it is saying:
Leave existing Node.js - Node v12.18.0 Npm 6.14.5
Ok, it completed... no problem BUT that may be against the SD Card that already got updated. I'll build another image. (This SD Card is the one I used to create the 9 min Node-Red video, so maybe it needs rebuilding.)
This can take 20-30 minutes on the slower Pi versions - please wait.
Stop Node-RED ‚úî
Remove old version of Node-RED ‚úî
Remove old version of Node.js -
Leave existing Node.js - Node v12.18.0 Npm 6.14.5
Clean npm cache -
Install Node-RED core ‚úî 1.1.0
Move global nodes to local -
Install extra Pi nodes -
Npm rebuild existing nodes -
Add shortcut commands ‚úî
Update systemd script ‚úî
Did you run the script from your webpage or was it through npm (sudo npm install -g --unsafe-perm node-red). If from the script, should I stop both HB and NR before running the script?
@csteele - quick question. Have you installed/updated any HB plug-ins after installing node-red? I'm getting a strange error when updating the Homebridge Ring plug-in from the UI. I've posted on HB discourse and reddit but no response so far (the developer of the ring plug-in has never seen this). I have updated the ring plug in before (current version is 9.4.0, was trying to update to 9.4.1), and it has worked. Thanks.
If you watched the video I created for Node-Red, you'll see I did add to the Palette.
Looking at the directory, I see:
drwxr-xr-x 3 pi pi 4096 Jun 14 22:09 node-red-contrib-bigtimer
drwxr-xr-x 4 pi pi 4096 Jun 14 22:09 node-red-contrib-boolean-logic-ultimate
drwxr-xr-x 2 pi pi 4096 Jun 14 22:09 node-red-contrib-castv2
drwxr-xr-x 6 pi pi 4096 Jun 14 22:09 node-red-contrib-hubitat
drwxr-xr-x 3 pi pi 4096 Jun 14 22:09 node-red-contrib-noop
drwxr-xr-x 4 pi pi 4096 Jun 14 22:09 node-red-contrib-pushover
drwxr-xr-x 2 pi pi 4096 Jun 14 22:09 node-red-contrib-state-machine
drwxr-xr-x 4 pi pi 4096 Jun 14 22:09 node-red-contrib-stoptimer2
drwxr-xr-x 3 pi pi 4096 Jun 14 22:09 node-red-contrib-string
drwxr-xr-x 4 pi pi 4096 Jun 14 22:09 node-red-contrib-time-range-switch
drwxr-xr-x 2 pi pi 4096 Jun 14 22:09 node-red-contrib-unsafe-function
Which looks vanilla enough...
Looking at Palette Manager, I see two need updating.. let me start there...
BooleanLogic-Ultimate & Hubitat. Says I need to reboot, but before I do, I'll install something all new...
I installed Stoptimer-Varidelay.. that worked too.. time to restart NR. Even that worked