Hue bridge pairing questions

Hi all,

I want to write an app that pulls data from the hue api. Can someone give me some example code where I can just press the button on the hue hub to get pair with my app? Is that even possible since I have the hue bride already paired with HE?

I assume you mean "pull data" from things that the Hue API exposes that you can't get to from just accessing the relevant devices in Hubitat? (If not, that sounds much easier. :slight_smile: ) If so, I don't know of any Hubitat example code that does exactly what you're asking for, and the official Hue integration is closed-source, but to get some ideas you could look at third-party SmartThings (not sure if there are any for Hubitat) Hue integrations--for example: SmartThingsPublic/hue-advanced-connect.groovy at Hue-Advanced ยท claytonjn/SmartThingsPublic ยท GitHub. There's really a lot more than you need, but you can look at the parts that are responsible for "registering" the Hue bridge (see below) and sending the GETs/PUTs and whatnot over HTTP according to the Hue API.

Whether your Hue bridge is already "paired" with Hubiat doesn't matter--each app/device/etc. that the Hue bridge authorizes will get a unique ID. On the Hubitat side, that's just stored within the app, so your own app would get a different ID/username than other apps on the Hub, including the official integration.

2 Likes