We build custom applications 5x faster and cheaper 🚀
Book a Free Consultation
Stuck on an error? Book a 30-minute call with an engineer and get a direct fix + next steps. No pressure, no commitment.
Direct answer
Short answer: Install the OpenHue skill into ClawHub, configure authentication (either Philips Hue Cloud OAuth2 or local Bridge username), store credentials as secure environment variables or ClawHub secrets, and implement token refresh and webhook validation outside the agent if you need persistence or scheduled jobs. The skill itself should perform only stateless API calls to the Hue REST endpoint (local bridge API or Hue Cloud API) and be invoked by OpenClaw runtime triggers; if you need long-lived refresh logic, queues or event receivers, run that as an external service and call the skill via its configured invocation endpoint. Use standard OAuth best practices (state, scopes, HTTPS), validate webhooks, and debug by checking HTTP responses, logs, and token scopes.
Prerequisites
Architecture and responsibilities (what runs where)
High-level integration steps
Concrete OAuth and API examples (generic, real)
OAuth2 authorize URL (Hue Cloud):
Exchange the authorization code for tokens (curl):
# <b>//</b> Exchange authorization code for access + refresh token
curl -X POST "https://api.meethue.com/oauth2/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
-d "grant_type=authorization_code&code=AUTH_CODE&redirect_uri=YOUR_REDIRECT_URI"
Refresh access token (curl):
# <b>//</b> Use stored refresh_token to get a new access_token
curl -X POST "https://api.meethue.com/oauth2/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
-d "grant_type=refresh_token&refresh_token=STORED_REFRESH_TOKEN"
Local Bridge API example (concrete and widely-used):
# <b>//</b> Turn on light id 1 using the local bridge username
curl -X PUT "http://192.168.1.10/api/your-bridge-username/lights/1/state" \
-H "Content-Type: application/json" \
-d '{"on":true}'
Cloud API call pattern (generic):
# <b>//</b> Example pattern to call Hue Cloud API (replace with actual documented resource path)
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
"https://api.meethue.com/route/to/resource" \
-d '{"some":"payload"}'
How to wire this into ClawHub/OpenClaw correctly (practical)
Security and operational best practices
Debugging checklist (when something breaks)
Minimal Node.js example (tokened API call inside a stateless skill)
// <b>//</b> Minimal example: skill reads access token from env and sends a request to Hue Cloud API
const fetch = require('node-fetch');
async function setLightState(lightId, body) {
// <b>//</b> In production, read token from secure secret store or env injected by ClawHub
const ACCESS_TOKEN = process.env.HUE_ACCESS_TOKEN;
if (!ACCESS_TOKEN) throw new Error('No access token available');
const url = `https://api.meethue.com/route/to/lights/${encodeURIComponent(lightId)}/state`;
const res = await fetch(url, {
method: 'PUT',
headers: {
'Authorization': `Bearer ${ACCESS_TOKEN}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(body)
});
if (!res.ok) {
const errText = await res.text();
throw new Error(`Hue API error ${res.status}: ${errText}`);
}
return res.json();
}
// <b>//</b> Example invocation inside the skill runtime
setLightState('1', { on: true })
.then(r => console.log('OK', r))
.catch(e => console.error('ERROR', e.message));
Final operational notes
Speak one‑on‑one with a senior engineer about your no‑code app, migration goals, and budget. In just half an hour you’ll leave with clear, actionable next steps—no strings attached.
1
OpenClaw's clawd failing to find an OpenHue bridge usually means network discovery (mDNS/SSDP) is blocked or the runtime isn't on the same L2 network; you can fix it by validating discovery from the host, enabling multicast/SSDP in the container/runtime, or manually configuring the bridge IP in the skill config and credentials.
Check same LAN, multicast/firewall, and that the OpenClaw runtime has L2 access (containers often need --network host or equivalent). Use host tools (avahi-browse, dns-sd, ssdp-client) to confirm the bridge advertises. Inspect clawd/skill logs for discovery timeouts and errors, and if discovery is impossible, set the bridge IP/username explicitly in the skill config via ClawHub or env vars. Also verify bridge firmware and power.
2
Generate a Hue API username on your Hue Bridge by pressing its link button and POSTing to /api; use that returned username as the Hue token. Put the token into your OpenClaw credential store (preferably as an environment variable) and reference it from claw-config.yaml. Common pattern: export HUE_USERNAME=the-username and reference ${HUE_USERNAME} in claw-config.yaml so agents read it at runtime.
Steps and checks:
curl -X POST http://BRIDGE_IP/api -d '{"devicetype":"openclaw#agent"}'
Response contains "username". Then set env and config:
# claw-config.yaml
credentials:
hue:
api_token: "${HUE_USERNAME}"
3
Most of the time this happens because the Hue adapter either isn’t receiving OpenHue events or it can’t write updates into the ClawDevice registry (auth/ID mapping/permissions). Start by confirming event delivery and adapter logs, then verify the adapter’s credentials and registry write permission, and finally reconcile device IDs between OpenHue and ClawDevice.
4
Direct answer: Resolve duplicate OpenHue device/entity collisions by creating explicit EntityMapping entries in ClawBridge that map each incoming light to a unique entity ID (for example prefix with the bridge serial or MAC) and by using stable source keys (bridge-id + hue-light-id). Persist the mapping, restart the bridge import, and verify via logs so IDs don’t auto-conflict on future syncs.
This prompt helps an AI assistant understand your setup and guide you through the fix step by step, without assuming technical knowledge.
From startups to enterprises and everything in between, see for yourself our incredible impact.
Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We’ll discuss your project and provide a custom quote at no cost.Â