ComfyUI Node

Niutonian: Hue Setup

The boring node that makes the whole Hue pack work

By Niutonian·Created 4 months ago·Updated 3 months ago· 0
Niutonian: Hue Setup
    • result
    bridge_ipauto
    action

    Every node in the Niutonian_Comfyui_Philips_Hue pack is useless until you've run this one once. Niutonian: Hue Setup is the key ceremony that turns your ComfyUI into a legitimate Hue bridge client: it finds your bridge, registers you with it, saves the API key, and lists your lights. You'll use it for about ten minutes, then never think about it again - until you change networks or get a new bulb and suddenly remember how much it matters.

    Why this node exists at all

    Philips Hue doesn't hand out API keys over the counter. To get one you have to physically press the round button on top of the Hue Bridge, and then immediately make a registration request - that's the "push button pairing" model that keeps random devices from claiming control of your lights. This node automates that whole dance so you don't have to write curl commands at your bridge. The key gets stored in hue_config.json inside the pack folder, and every other node in the pack reads it from there when you leave api_key blank.

    What the actions do

    The node has just two inputs: bridge_ip (default auto) and an action dropdown. Pick an action, queue the prompt, read the result output. That's the entire UI, and honestly that's the right call for a setup tool.

    • auto_scan - finds bridges on your network. It checks Philips' cloud discovery endpoint (discovery.meethue.com), then SSDP multicast, then falls back to a subnet sweep. Output looks like 192.168.1.100 (meethue).
    • register_new - the button-press step. Press the bridge's physical button, run this within ~30 seconds, and the node POSTs your devicetype to the bridge and saves the returned key to hue_config.json.
    • check_connection - verifies the saved key and reports how many lights the bridge sees.
    • list_lights - lists each light with its numeric ID, on/off state, and capabilities like color_xy, hue_sat, white_temperature, brightness. This is where you learn your strip is light 1 and your dimmable desk lamp is 2. Write those IDs down; every other node asks for them.
    • test_flash - flashes all lights on the bridge. It's the fastest end-to-end sanity check you have: if the flash works, your IP, key, and network path are all correct, and any remaining problems are about the light itself.

    The setup flow

    Run it in this order and you'll be done in five minutes:

    bridge_ip = auto      action = auto_scan
    bridge_ip = 192.168.1.100   action = register_new   # press the button first
    bridge_ip = 192.168.1.100   action = list_lights
    bridge_ip = 192.168.1.100   action = test_flash
    

    Installing it

    ComfyUI Manager search "Niutonian", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Niutonian/Niutonian_Comfyui_Philips_Hue
    

    Restart ComfyUI. No extra Python packages, no models - the whole pack uses only the standard library plus numpy, which ComfyUI already has.

    Common issues

    • "Press the Hue bridge button" - that's error type 101 from the bridge itself. You genuinely have to press it, and you have about 30 seconds. Run register_new again with the button held down and it'll take.
    • auto_scan finds multiple bridges - stop using auto; type the exact IP of the bridge that controls your strip into bridge_ip.
    • list_lights says no API key - you skipped register_new, or the button-press timing lapsed. Redo it.
    • test_flash does nothing - the bridge IP is wrong or the lights are unreachable in the Hue app itself. Verify the app can control them first.

    One security note: hue_config.json is the master key to every light in your house. It's in the pack's .gitignore, so don't fight that - never commit it, and don't share it.

    CategoryNiutonian/Philips Hue

    Inputs (2)

    NameTypeDefaultDescription
    bridge_ipSTRINGauto
    actionCOMBO5 options: auto_scan, check_connection, register_new, list_lights, test_flash

    Outputs (1)

    NameTypeDescription
    resultSTRING