Hubitat + node red + homebridge

Ok guru’s of the Hubitat community I’ve got a noobish question. We are an apple centric household. So, I now have Hubitat and rpi with homebridge using tonesto app plugin to expose Hubitat devices to homebridge. But from what I understand communication from Hubitat to Homebridge is a one way street. For example I can’t move some devices ( ie Bond fans) to homebridge and still write automations for them in Hubitat?

So if I somehow layer a node red installation on my homebridge rpi and install the correct homebridge plugins on the rpi and the correct apps on Hubitat. I then would then have communication each way between homebridge to Hubitat.

If I am correct or not in this thinking please let me know. And if I am correct could you point me in the right direction with proper homebridge/ node red / Hubitat installation for my rpi.

Unfortunately what I have learned is that there are no good ways to have 2-way communication between Homekit devices and Hubitat. There are 2 cumbersome ways of having the 2-way communication for many (but probably not all) Homekit devices.

Option 1: Create a virtual switch in Hubitat, connect that to Homebridge. Then build rules inside Homekit to synch the virtual switch with what you want to control that is Homekit only. This only really works if you are doing binary on/off type controls.

Option 2: Add even more complexity by introducing Home Assistant into the mix. Setup the Homekit controller integration in HASS. Join the Homekit devices to it (they will think they are joined to an apple device). Then connect HASS via Node Red to Hubitat. Also join HASS to the actual Apple Home. (I have done this at an experimental level, but with so many interacting pieces, I can't promise it will work consistently, though it shows promise).

Good luck.

That's the way I'm doing it! HE<->NR<->HB->HK - edit sorry not entirely correct - HE goes to HB AND NR...

No devices FROM Apple HomeKit but HB works both ways and talks to NR..

"Front Door" is my Ring doorbell in HB btw - detects button press and then plays a chime in HE on my Aeotec Siren v5. - between 6 am - 10 pm...

3 Likes

As others have said, Homebridge/Homekit are not intended to provide 2 way integration. You can kludge your way around that with virtual switches or Home Assistant, but if the device has good Hubitat-native integration, that will almost always get you better results. I do use virtual switches to control a few Homekit-only devices. (Hunter Cavera Fans, Nanoleaf Essentials Bulbs), but generally speaking, if I can control it directly with Hubitat, I do.

2 Likes

I agree with this in principal but I've found a lot of my less technical clients (and even some that are!) are Apple-centric and prefer Apple Home to anything else.

EDIT: I've found I can STILL provide a great Apple experience with HE/HB/NR.

1 Like

I have this setup with no complaints so far. Even have custom homekit devices as certain HE devices suck i.e. thermostats

2 Likes

@KarenAG - echoing what others have said - I have the same setup (HE->HB-HK). Before I started using Node-RED, all my "automations" were done in HE (Hubitat) Rules engine or simple automation. Apple Home was a way to give a better end user experience (turn on lights, open doors etc.) and also enable remote operation, but no automation. Since then, I have duplicated all my automations in Node-RED (they are currently disabled in HE) but still use Apple Home if I need to operate any of the devices while I am away.

The only "automation" that I have in Apple Home is to turn a virtual switch (Hubitat switch) on at night when my Ring Doorbell activates for motion. I then have Node-RED turn on outside lights.

Do you have native Apple Homekit devices that you want to control from either Node-RED or HE?

3 Likes

Them's fightin' words :rofl:

2 Likes

To be fair I did go back and correct that!!!! :grinning_face_with_smiling_eyes:

I have only recently (as of this year) gotten into the cult of Apple having gone from virtually no iGear to having iPads, Homepod Minis and an M1 Macbook Pro... you know for "testing" and to placate my SO. Family still on Android phones though much to the chagrin of my teenage daughter.

Interestingly I was using Homebridge before my Apple purchases. That sequence picture I posted has been active well before then...

2 Likes

Apologies @KarenAG! Was getting a little off track. Here is my installation - you don't need to go with Ubuntu 64 or do the m.2 thing - just the standard Raspberry Pi OS Lite - recommend not installing the GUI as it adds overhead but you can if needed.


For the installation I used an RPi4 with 4 GB Memory. I am using a case called the Argon ONE m.2 and booting off an m.2 sata drive with the sdcard as backup.

My distribution is Ubuntu Server for RPi - 64 Bit.

I installed node-red and homebridge using the installation instructions here:

Node-RED
https://nodered.org/docs/getting-started/raspberrypi

HomeBridge - Note: I skipped "Step 1" since this was done with NR install.

For additional fun I also installed a local VPN called Wireguard using this awesome script:

https://pivpn.io/

Note: If you are into running Docker apps others can chime in on how to do that.

2 Likes

Another plus point is that Homekit's dashboard is miles better than Hubitat's :rofl: :rofl: :rofl:

3 Likes

@erktrek Thank you, Thank you for your links and guidance. Got my pi up and running with node red and homebridge. If ya lived near me I would buy you a beer :beer: or three

2 Likes

@erktrek Been thinking about setting up a local box for this stuff since Docker Desktop on my laptop is pretty flaky and keeps locking up. Do you find the RPi is powerful / stable enough? I was thinking about an Intel NUC, but that's considerably more expensive.

I was also wondering about your flow above with the Ring doorbell going from HB to HE... Is there an advantage to hooking it into HB vs. the Ring integration in HE?

Yes the RPi is plenty powerful - I am running 3 different server apps on mine (Node-RED/HomeBridge/Wireguard and have had no performance issues. In fact the 4 GB model might even be overkill for this purpose but I like the extra memory.

In terms of my reasoning with that sequence.. I prefer to keep the resource usage as low as possible on the HE. This means keeping custom apps to a minimum if possible. On my C-7 I only have Homebridge V2, Package Manager, Z-Wave Mesh details and Maker running. All the rules etc live in NR.

My current resource usage on that hub:
Local apps: 18m 19s busy / 4d 15h 16m 52s total (0.3%)

1 Like

Cool, thanks! Got a recommendation for a RPi4 kit? There's lots out there. Do they all support m.2?

So the RPI accepts booting to a USB3.. which is what I am using in conjunction with this awesome but kinda pricey case:

For the m.2 - WARNING! only m.2 SATA only!!!!

And then just the basic PI is all you need..

If you want to backup to the SD Card try this:

5 Likes

For that kind of price get a second hand Dell Optiplex Micro, More powerful

1 Like

Yep - My only issues there are the larger form factor and greater power draw but otherwise that can work as well. Another thought is an old laptop. Built in power protection.

1 Like

The dell micro is tiny and the power draw over the year is not that much extra cost wise and the pi is so slowwwww :rofl: :rofl:

Good news is PI4's speed is excellent for this purpose fortunately, have been running it for a year or so with no issues.

Because I was curious went on Amazon (US) and looked up - cheapest I could find was this refurbished unit:

https://www.amazon.com/Dell-Optiplex-Desktop-i3-4160T-2-9-Windows/dp/B07XM9DCBM/

Specs seem decent (US centric, sorry)
$195 - i3, 8GB RAM, 128 GB SSD, 11"x9"x2", 200 watts.

vs

New RPI with case:
$139 ARM Cortex-A72, 4 GB RAM, 120 GB M.2 Sata, 4.33" x 3.74" x 1", 6.4 watts

You might do better with an Intel Atom box like this:

https://www.amazon.com/dp/B07QY8LDGX/

But you'd still need a hard drive.