NorthernMan54 / node-red-contrib-homebridge-automation

Homebridge and Node-RED Integration
Apache License 2.0
106 stars 18 forks source link

Dockerized node-red cant find homebridge devices #18

Closed dbeltman closed 5 years ago

dbeltman commented 5 years ago

I'm having an issue where i cant find any homebridge devices on my dockerized node-red environment. The plugin works perfectly when installed on a raspberry pi however.

The only thing i am getting from logs is a whole bunch of this:


2019-07-29T20:11:17.149Z hapNodeJSClient Ending Homebridge instance discovery

2019-07-29T20:11:17.149Z hapNodeRed Discovered 0 new evDevices

2019-07-29T20:11:17.149Z hapNodeRed Discovered 0 new ctDevices

2019-07-29T20:25:57.150Z hapNodeJSClient Starting Homebridge instance discovery

2019-07-29T20:26:17.153Z hapNodeJSClient Ending Homebridge instance discovery

2019-07-29T20:26:17.153Z hapNodeRed Discovered 0 new evDevices

2019-07-29T20:26:17.153Z hapNodeRed Discovered 0 new ctDevices

Dockerfile i'm using: https://github.com/dbeltman/node-red-docker/blob/f49f122b3883259f835cffbe4e9bf9780b2c8065/Dockerfile

The base image of that dockerfile (node-red) uses the following as a startup command: npm start -- --userDir /data

Is there something i'm missing? I tried:

I have the feeling it's something network related ( docker not having enough privileges to certain things on the network for example ), but i'm hesitant to just upping the privileges until it works without knowing that exactly i'm enabling.

dbeltman commented 5 years ago

I was right about the networking being the limiting factor.

After setting the node-red container's networking mode to host, it started picking up homebridge devices.

It brought up a new issue, which is that node-red binds to 127.0.0.1 and is thus not accessible via LAN. Nothing to do with this plugin though, and i'll just fix it with a proxy container.

Thanks for the great plugin!