Imported from HybridAIOne/hybridclaw (
skills/hue/SKILL.md). Install upstream withnpx skills add HybridAIOne/hybridclaw --skill hue. Copyright stays with the author.
Philips Hue
Use this skill for Philips Hue Bridge lighting inspection and guarded control. The primary path is local HTTPS to the Hue Bridge CLIP v2 API. Use the Hue Remote API only when the operator explicitly needs off-LAN control or local bridge access is unavailable.
Safety Rules
- Use
skills/hue/hue.cjsfor every supported Hue request shape. Do not handcraft CLIP v2 URLs or JSON bodies when the helper supports the action. - Read current light, room, zone, and scene state before changing lights.
- Treat local reads as green, local light/group/scene/behavior changes as amber, off-LAN Remote API calls as amber, and bridge configuration writes as red.
- For amber/red operations, use the helper to build the request shape, explain
the target and expected effect, and stop for explicit operator approval
before sending the emitted
httpRequestthrough the gateway. - Include the target light, grouped light, room, scene, behavior, bridge id, action, and expected physical effect in approval text.
- Never paste the Hue application key, OAuth client secret, or remote token
into chat. The helper emits
secretHeadersor<secret:...>placeholders for gateway-side resolution. - Hue Bridge certificates are self-signed by default. The helper marks local
bridge HTTPS requests with a scoped
allowSelfSignedTlsflag for the gatewayhttp_requestproxy. Do not use a blanket insecure TLS bypass. - If a live call returns
401orunauthorized_user, stop after that first failed call and re-link the bridge with the link-button flow. - In chat sessions, do not diagnose Hue runtime config by running
hybridclaw env list,hybridclaw secret list, or other local CLI commands frombash; those commands can inspect the wrong runtime or fail because of the host Node version. Use gatewayhttp_requesterrors and any/env showor/secret listoutput the operator provides. - If
HUE_BRIDGE_HOSTis configured andHUE_APPLICATION_KEYis missing, say only that the application key is missing. Do not ask the operator to find the bridge IP again. Ask them to press the physical link button, then buildnode skills/hue/hue.cjs --format json bridge link --app-name hybridclaw --instance-name lab, send the emittedhttpRequest, and store the returned Hue credential secret through the helper-emittedcaptureResponseFields. - When linking after the operator presses the bridge button, run
bridge statusfirst. If the live status result reportslinkbutton: true, immediately runbridge linkwithout--host. If it reportslinkbutton: false, tell the operator that the configured bridge did not report an active button press and ask them to press and release the physical link button once, then retry immediately. Iflinkbuttonis absent, do not treat that as proof the button is inactive; modern bridge config responses can omit the field. - When running the link request itself, do not pass
--hostunless the operator explicitly provides a new override URL in the same turn. The default link request must use<env:HUE_BRIDGE_HOST>so the gateway resolves the env-store value. - If the operator shows
/env show HUE_BRIDGE_HOST, treat that value as the current configured bridge URL. If a failed request used any other host, report that the helper was called with the wrong host and retry the same operation with no--hostoverride. - If
HUE_BRIDGE_HOSTis missing, first reuse an exact Hue Bridge URL from current context or workspace memory when one is present. Ask the operator to find the bridge IP only when no exact URL is available. - If a gateway
http_requesterror saysStored secret HUE_APPLICATION_KEY is not set, treatHUE_BRIDGE_HOSTas already resolved for that request. Do not say the bridge host may be missing, do not tell the operator to runhybridclaw env set, and do not repeat the same read calls. Switch directly to the link-button setup path in rule 10. - If a private-host or gateway policy denial blocks a local bridge request, first inspect the current workspace network policy. Managed read-only LAN access already allows GET reads to RFC1918 hosts, and managed read-write LAN access allows the supported methods. If either managed LAN mode covers the attempted Hue request, report that mismatch as a gateway policy-evaluation bug instead of adding another rule. Do not edit policy by hand, do not add broad bridge rules, and do not tell the operator a gateway restart is required; workspace network policy is read per request.
- If a local Hue request fails with a certificate verification or
self-signed TLS error, do not ask for
HUE_BRIDGE_HOSTagain, do not suggest plain HTTP on port 80, and do not invent a URL auth route or workspace policy setting for TLS. Re-run the exact helper-emittedhttpRequestwithallowSelfSignedTls: true; if that field is absent, rebuild the request withskills/hue/hue.cjs.
Command Contract
The helper is deliberately thin: it only turns clean subject/verb arguments
into gateway-ready httpRequest payloads. It does not write env values, edit
network policy, call the gateway, poll the bridge, or store secrets.
Show helper usage:
node skills/hue/hue.cjs --help
Build local CLIP v2 read requests, then pass the emitted httpRequest object
to the gateway http_request tool:
node skills/hue/hue.cjs --format json bridge list
node skills/hue/hue.cjs --format json device list
node skills/hue/hue.cjs --format json light list
node skills/hue/hue.cjs --format json grouped-light list
node skills/hue/hue.cjs --format json room list
node skills/hue/hue.cjs --format json zone list
node skills/hue/hue.cjs --format json scene list
node skills/hue/hue.cjs --format json motion list
node skills/hue/hue.cjs --format json behavior list
node skills/hue/hue.cjs --format json entertainment list
Read a bounded diagnostic eventstream window:
node skills/hue/hue.cjs --format json eventstream read --duration 30s
Prepare guarded write operations:
node skills/hue/hue.cjs --format json light on --id <id>
node skills/hue/hue.cjs --format json light off --id <id>
node skills/hue/hue.cjs --format json light brightness --id <id> --pct 60
node skills/hue/hue.cjs --format json light color --id <id> --xy 0.4317,0.4147
node skills/hue/hue.cjs --format json light color --id <id> --mirek 366
node skills/hue/hue.cjs --format json grouped-light on --id <grouped_light_id>
node skills/hue/hue.cjs --format json grouped-light brightness --id <grouped_light_id> --pct 60
node skills/hue/hue.cjs --format json scene recall --id <scene_id>
node skills/hue/hue.cjs --format json behavior disable --id <behavior_id>
node skills/hue/hue.cjs --format json bridge timezone --id <bridge_id> --timezone Europe/Berlin
The helper marks amber and red operations with requiredGrant. Send the
emitted httpRequest only after the operator approves the described effect.
Link a bridge after pressing the physical link button:
node skills/hue/hue.cjs --format json bridge status
node skills/hue/hue.cjs --format json bridge link \
--app-name hybridclaw \
--instance-name lab
The status command emits a /api/config request shape with
<env:HUE_BRIDGE_HOST> and no secret header. Use it to confirm the configured
bridge reports linkbutton: true before sending the link request. The link
command emits a single /api request shape with <env:HUE_BRIDGE_HOST> and
only a devicetype body. Send that request through the gateway while the
button is active, then store the returned Hue credential secret as
HUE_APPLICATION_KEY through the emitted captureResponseFields. Do not pass
--host for normal chat setup.
Use Remote API reads only when off-LAN access is needed:
node skills/hue/hue.cjs --format json remote oauth-token
node skills/hue/hue.cjs --format json remote bridge list
node skills/hue/hue.cjs --format json remote light list --bridge <id>
node skills/hue/hue.cjs --format json remote room list --bridge <id>
Setup
Store the local bridge URL in the env store, then press the bridge link button,
build the link request, send the emitted httpRequest through the gateway, and
let the gateway capture the returned Hue credential secret as the application
key.
In chat:
/env set HUE_BRIDGE_HOST "https://<bridge-ip>"
node skills/hue/hue.cjs --format json bridge status
node skills/hue/hue.cjs --format json bridge link --app-name hybridclaw --instance-name lab
From a local terminal:
hybridclaw env set HUE_BRIDGE_HOST "https://<bridge-ip>"
node skills/hue/hue.cjs --format json bridge status
node skills/hue/hue.cjs --format json bridge link --app-name hybridclaw --instance-name lab
Managed LAN HTTP access covers local RFC1918 bridge reads according to the workspace policy setting. The helper does not create or modify that setting.
For the Hue Remote API, create a developer app, complete the OAuth flow, then set the resulting values in this order:
- Browser admin: open the active HybridClaw admin URL ending in
/admin/secretsand set theHUE_REMOTE_*secrets. - Browser
/chator TUI fallback:
/secret set HUE_REMOTE_CLIENT_ID "<oauth-client-id>"
/secret set HUE_REMOTE_CLIENT_SECRET "<oauth-client-secret>"
/secret set HUE_REMOTE_REFRESH_TOKEN "<refresh-token>"
node skills/hue/hue.cjs --format json remote oauth-token
/secret set HUE_REMOTE_BRIDGE_ID "<bridge-id>"
- Local console fallback:
hybridclaw secret set HUE_REMOTE_CLIENT_ID "<oauth-client-id>"
hybridclaw secret set HUE_REMOTE_CLIENT_SECRET "<oauth-client-secret>"
hybridclaw secret set HUE_REMOTE_REFRESH_TOKEN "<refresh-token>"
node skills/hue/hue.cjs --format json remote oauth-token
hybridclaw secret set HUE_REMOTE_BRIDGE_ID "<bridge-id>"
Resource Coverage
The helper allowlists the initial CLIP v2 resource set from the OpenHue
OpenAPI contract and Philips Hue CLIP v2 docs: bridge, device, light,
grouped_light, room, zone, scene, motion, temperature,
light_level, button, behavior_instance, and
entertainment_configuration. Arbitrary /clip/v2/resource/<type> passthrough
is rejected.
Result Handling
- Base answers on successful live Hue API results from the current turn.
- For scene recall, expect
recall: { action: "active" }. - For light/group color, use either XY coordinates or mirek color temperature, not both.
- Eventstream output can reveal occupancy. Keep diagnostic reads short and do not create a long-lived subscription from this skill.
- On gateway policy denial for a local bridge, inspect the current workspace network policy first. If managed read-only LAN access covers the GET read, or managed read-write LAN access covers the attempted method, report a gateway policy-evaluation bug and do not add a duplicate bridge rule. If LAN access is off, tell the operator which LAN HTTP access setting is missing. Do not tell the operator to restart the gateway.
- If policy denial persists despite a matching managed LAN setting, report the helper-emitted host, method, and path. Do not substitute Remote API results unless the operator asks for off-LAN fallback.
- On certificate verification or self-signed TLS failures for local Hue HTTPS,
explain that the request must include the helper's
allowSelfSignedTls: truefield and retry once with the helper-emitted request. Do not ask whether the bridge supports plain HTTP, do not ask for the bridge host again, and do not claim a gateway TLS route or workspace policy is required. - On missing Hue configuration, report exactly which configured names are
present and which are missing. If the gateway says
Stored secret HUE_APPLICATION_KEY is not set, do not sayHUE_BRIDGE_HOSTis unknown or missing; the<env:HUE_BRIDGE_HOST>placeholder already resolved far enough to reach secret-header injection. In chat, give only this slash-command recovery path:
Press the Hue bridge link button, then let me run:
node skills/hue/hue.cjs --format json bridge status
node skills/hue/hue.cjs --format json bridge link --app-name hybridclaw --instance-name lab
The emitted `captureResponseFields` rule captures the returned Hue credential
secret into `HUE_APPLICATION_KEY`.
Do not include hybridclaw env set or ask the operator to set
HUE_BRIDGE_HOST again unless the gateway explicitly reports that
HUE_BRIDGE_HOST itself is missing.
- On a live link response from
/apiwith Hue errortype: 101or descriptionlink button not pressed, runbridge statusonce in the current button window. If status reportslinkbutton: true, retrybridge linkimmediately. If status reportslinkbutton: false, explain that the bridge at the configured env-store host is reachable but does not currently report an active button press; ask the operator to press and release the physical button once, then retry the status and link sequence immediately. If status omitslinkbutton, explain that the bridge status endpoint did not expose button state and retry the/apilink request only when the operator confirms the button was just pressed. - On a live link response saying
generateclientkey is not availableor directing the caller toPOST /api/config/connections, rebuild the request with the current helper and retry the emitted/apirequest. The helper must not sendgenerateclientkey; it should send onlydevicetype. - On a live link response from
/api/config/connectionswith Hue errortype: 1, address/connections, or descriptionunauthorized user, do not claim the button window expired. That endpoint requires an existing authorized user on this bridge. Rebuild with the current helper and use the unauthenticated/apilink request withoutgenerateclientkey. - If the operator shows
/env show HUE_BRIDGE_HOSTand it differs from the host used by a failed request, explain that the request used the wrong override and retry with the normal helper command, which emits<env:HUE_BRIDGE_HOST>.