Controlling Philips Hue with Fibaro Home Center Lite via Node-RED Raw TCP
If you have a home automation setup running on a Fibaro Home Center Lite (HCL) controller, you may have run into a common limitation: native integration with modern smart lighting systems like Philips Hue can be tricky. While full Fibaro gateways (like the HC2 or HC3) support LUA scripting to make direct HTTP API requests, the HCL relies exclusively on Virtual Device buttons sending raw TCP strings across local sockets.
By using Node-RED running on a local server (such as a Raspberry Pi or Docker instance) as a lightweight middleware translator, you can seamlessly connect Fibaro HCL Virtual Devices to your Philips Hue Bridge without writing complex code.
The Architecture Overview
Instead of forcing Fibaro HCL to handle modern HTTP headers and authentication tokens, HCL dumps simple text commands over a raw TCP socket. Node-RED listens for these incoming raw TCP streams, parses the command parameters, and triggers the target light using local Hue APIs.
[ Fibaro HCL Virtual Device ]
│
│ (Raw TCP Stream on Port 1881)
▼
[ Node-RED Raw TCP Listener ]
│
▼
[ Function Router (idx) ]
│ │
(idx=502)│ │(idx=503)
▼ ▼
[ Hue Light 1 ] [ Hue Light 2 ]
Step 1: Setting Up the Node-RED Flow
Node-RED's built-in tcp in node listens on a dedicated port to capture incoming string commands from Fibaro. A downstream Function node evaluates the payload and routes commands to your Hue lights based on the device index (idx) and switch command (On/Off).
Node-RED Flow JSON (Sanitized)
Copy and import the following flow into Node-RED (Menu → Import):
[
{
"id": "fibaro_tcp_in",
"type": "tcp in",
"z": "fibaro_hue_tab",
"name": "Fibaro Raw TCP Listener",
"server": "server",
"host": "",
"port": "1881",
"datamode": "stream",
"datatype": "utf8",
"newline": "",
"topic": "",
"trim": false,
"base64": false,
"tls": "",
"x": 150,
"y": 180,
"wires": [
[
"fibaro_tcp_debug",
"fibaro_tcp_parser"
]
]
},
{
"id": "fibaro_tcp_debug",
"type": "debug",
"z": "fibaro_hue_tab",
"name": "Fibaro TCP Payload Debug",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 480,
"y": 120,
"wires": []
},
{
"id": "fibaro_tcp_parser",
"type": "function",
"z": "fibaro_hue_tab",
"name": "Parse TCP String Router",
"func": "// Convert raw incoming payload to lowercase string\nconst str = String(msg.payload).toLowerCase();\n\n// Determine state command\nconst isOn = str.includes(\"switchcmd=on\");\nconst isOff = str.includes(\"switchcmd=off\");\n\n// Exit if neither command is found\nif (!isOn && !isOff) return null;\n\nconst commandPayload = isOn ? true : false;\n\n// Route by Fibaro Virtual Device idx\nif (str.includes(\"idx=502\")) {\n // Output 1: Light 1\n return [{ payload: commandPayload }, null];\n} else if (str.includes(\"idx=503\")) {\n // Output 2: Light 2\n return [null, { payload: commandPayload }];\n}\n\nreturn null;",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 430,
"y": 180,
"wires": [
[
"hue_light_1"
],
[
"hue_light_2"
]
]
},
{
"id": "hue_light_1",
"type": "hue-light",
"z": "fibaro_hue_tab",
"name": "Target Light 1",
"bridge": "hue_bridge_config",
"lightid": "",
"colormode": "hue",
"x": 650,
"y": 160,
"wires": [
[]
]
},
{
"id": "hue_light_2",
"type": "hue-light",
"z": "fibaro_hue_tab",
"name": "Target Light 2",
"bridge": "hue_bridge_config",
"lightid": "",
"colormode": "hue",
"x": 650,
"y": 200,
"wires": [
[]
]
},
{
"id": "hue_bridge_config",
"type": "hue-bridge",
"name": "Hue Bridge",
"bridge": "<YOUR_HUE_BRIDGE_IP>",
"key": "<YOUR_HUE_API_KEY>",
"worker": 10,
"autoupdates": true,
"disableupdates": false
}
]
Node-RED Configuration Steps
- Double-click the Hue Bridge configuration node and enter your local Hue Bridge IP address.
- Press the physical link button on your Hue Bridge, then pair or enter your generated application token.
- Double-click Target Light 1 and Target Light 2 to select your physical Hue bulbs from the dropdown menu.
Step 2: Configuring the Fibaro HCL Virtual Device
In the Fibaro Home Center Lite web dashboard, create a new Virtual Device:
- Go to Devices → Add or remove device → Virtual device.
- Set the configuration details:
- IP Address: Set to your Node-RED server's local IP address (e.g.,
192.168.x.x). - TCP Port: Set to
1881(matching the port defined in the Node-REDtcp innode).
- IP Address: Set to your Node-RED server's local IP address (e.g.,
- Under the Advanced tab, add or configure two buttons (On and Off).
Button String Format
Because Node-RED acts as a raw TCP socket listener, you can send concise strings directly:
- ON Button String:
idx=502&switchcmd=On0x0D0x0A
- OFF Button String:
idx=502&switchcmd=Off0x0D0x0A
Note: The 0x0D0x0A characters represent standard socket line endings (\r\n). Node-RED reads the string, matches idx=502, checks the command, and updates the light instantly.
Step 3: Scaling for Multiple Lights
To control additional Hue lights without opening extra network ports:
- Create a new Virtual Device in Fibaro with a unique
idxparameter (e.g.,idx=503). - Point the Virtual Device to the same Node-RED IP address and TCP Port (
1881). - In Node-RED, open the Parse TCP String Router Function node and increment the Outputs count (e.g., from
2to3). - Add an
else if (str.includes("idx=503"))clause to route the payload to the new output index, then wire it to your next Hue Light node.
Comments