Welcome to the OpenHue SDK documentation. This guide will help you get started with integrating and using the OpenHue SDK in your project.
- API version:
v2
- SDK version:
1.0.0
This SDK is compatible with the following versions: TypeScript >= 4.8.4
To get started with the SDK, we recommend installing using npm
:
npm install open-hue
The OpenHue API uses API keys as a form of authentication. An API key is a unique identifier used to authenticate a user, developer, or a program that is calling the API.
When you initialize the SDK, you can set the API key as follows:
const sdk = new OpenHue({ apiKey: 'YOUR_API_KEY' });
If you need to set or update the API key after initializing the SDK, you can use:
const sdk = new OpenHue();
sdk.apiKey = 'YOUR_API_KEY';
The SDK provides various services to interact with the API.
Below is a list of all available services with links to their detailed documentation:
The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently.
Below is a list of all available models with links to their detailed documentation:
Name | Description |
---|---|
AuthenticateRequest | |
Response | |
GetResourcesOkResponse | |
GetDevicesOkResponse | |
GetDeviceOkResponse | |
DevicePut | |
UpdateDeviceOkResponse | |
DeleteDeviceOkResponse | |
GetDevicePowersOkResponse | |
GetDevicePowerOkResponse | |
GetLightsOkResponse | |
GetLightOkResponse | |
LightPut | |
UpdateLightOkResponse | |
GetLightLevelsOkResponse | |
GetLightLevelOkResponse | |
LightLevelPut | |
UpdateLightLevelOkResponse | |
GetMotionSensorsOkResponse | |
GetMotionSensorOkResponse | |
MotionPut | |
UpdateMotionSensorOkResponse | |
GetGroupedLightsOkResponse | |
GetGroupedLightOkResponse | |
GroupedLightPut | |
UpdateGroupedLightOkResponse | |
GetBridgesOkResponse | |
GetBridgeOkResponse | |
BridgePut | |
UpdateBridgeOkResponse | |
GetBridgeHomesOkResponse | |
GetBridgeHomeOkResponse | |
GetScenesOkResponse | |
ScenePost | |
CreateSceneOkResponse | |
GetSceneOkResponse | |
ScenePut | |
UpdateSceneOkResponse | |
DeleteSceneOkResponse | |
GetRoomsOkResponse | |
RoomPut | |
CreateRoomOkResponse | |
GetRoomOkResponse | |
UpdateRoomOkResponse | |
DeleteRoomOkResponse | |
GetZonesOkResponse | |
CreateZoneOkResponse | |
GetZoneOkResponse | |
UpdateZoneOkResponse | |
DeleteZoneOkResponse | |
GetTemperaturesOkResponse | |
GetTemperatureOkResponse | |
TemperaturePut | |
UpdateTemperatureOkResponse | |
Success | |
ResponseError | |
Error | |
ResourceGet | |
ResourceGetType | Type of the supported resources |
ResourceIdentifier | |
Rtype | The type of the referenced resource |
DeviceGet | |
DeviceGetType | |
ProductData | |
DeviceGetMetadata | |
DeviceGetUsertest | |
ProductArchetype | The default archetype given by manufacturer. Can be changed by user. |
UsertestStatus | |
DevicePutType | |
DevicePutMetadata | |
Identify | |
DevicePutUsertest | |
IdentifyAction | Triggers a visual identification sequence, current implemented as (which can change in the future): Bridge performs Zigbee LED identification cycles for 5 seconds Lights perform one breathe cycle Sensors perform LED identification cycles for 15 seconds |
DevicePowerGet | |
PowerState | |
BatteryState | Status of the power source of a device, only for battery powered devices. - normal – battery level is sufficient - low – battery level low, some features (e.g. software update) might stop working, please change battery soon - critical – battery level critical, device can fail any moment |
LightGet | |
LightGetMetadata | Deprecated, use metadata on device level |
On | |
LightGetDimming | |
LightGetColorTemperature | |
LightGetColor | |
LightGetDynamics | |
LightGetSignaling | Feature containing signaling properties. |
LightGetMode | |
LightGetGradient | |
LightGetEffects | Basic feature containing effect properties. |
LightGetTimedEffects | Basic feature containing timed effect properties. |
LightGetPowerup | Feature containing properties to configure powerup behaviour of a lightsource. |
LightArchetype | Light archetype |
MirekSchema | |
GamutPosition | CIE XY gamut position |
Gamut | Color gamut of color bulb. Some bulbs do not properly return the Gamut information. In this case this is not present. |
GamutType | The gammut types supported by hue – A Gamut of early Philips color-only products – B Limited gamut of first Hue color products – C Richer color gamut of Hue white and color ambiance products – other Color gamut of non-hue products with non-hue gamuts resp w/o gamut |
SupportedDynamicStatus | Current status of the lamp with dynamics. |
SupportedSignals | Indicates which signal is currently active. |
Color | |
SupportedGradientMode | Mode in which the points are currently being deployed. If not provided during PUT/POST it will be defaulted to interpolated_palette |
SupportedEffects | |
SupportedTimedEffects | Current status values the light is in regarding timed effects |
PowerupPreset1 | When setting the custom preset the additional properties can be set. For all other presets, no other properties can be included. |
PowerupOn1 | |
PowerupDimming1 | |
OnMode1 | State to activate after powerup. On will use the value specified in the “on” property. When setting mode “on”, the on property must be included. Toggle will alternate between on and off on each subsequent power toggle. Previous will return to the state it was in before powering off. |
DimmingMode1 | Dimming will set the brightness to the specified value after power up. When setting mode “dimming”, the dimming property must be included. Previous will set brightness to the state it was in before powering off. |
Dimming | |
DimmingColor1 | |
ColorMode1 | State to activate after powerup. Availability of “color_temperature” and “color” modes depend on the capabilities of the lamp. Colortemperature will set the colortemperature to the specified value after power up. When setting color_temperature, the color_temperature property must be included Color will set the color tot he specified value after power up. When setting color mode, the color property must be included Previous will set color to the state it was in before powering off. |
ColorColorTemperature1 | |
DimmingDelta | |
ColorTemperature | |
ColorTemperatureDelta | |
Dynamics | |
Alert | Joined alert control |
Signaling | Feature containing basic signaling properties. |
LightPutMode | |
Gradient | Basic feature containing gradient properties. |
Effects | Basic feature containing effect properties. |
LightPutTimedEffects | Basic feature containing timed effect properties. |
Powerup | Feature containing properties to configure powerup behaviour of a lightsource. |
DimmingDeltaAction | |
ColorTemperatureDeltaAction | |
Signal | - no_signal : No signal is active. Write “no_signal” to stop active signal. - on_off : Toggles between max brightness and Off in fixed color. - on_off_color : Toggles between off and max brightness with color provided. - alternating : Alternates between 2 provided colors. |
PowerupPreset2 | When setting the custom preset the additional properties can be set. For all other presets, no other properties can be included. |
PowerupOn2 | |
PowerupDimming2 | |
OnMode2 | State to activate after powerup. On will use the value specified in the “on” property. When setting mode “on”, the on property must be included. Toggle will alternate between on and off on each subsequent power toggle. Previous will return to the state it was in before powering off. |
DimmingMode2 | Dimming will set the brightness to the specified value after power up. When setting mode “dimming”, the dimming property must be included. Previous will set brightness to the state it was in before powering off. |
DimmingColor2 | |
ColorMode2 | State to activate after powerup. Availability of “color_temperature” and “color” modes depend on the capabilities of the lamp. Colortemperature will set the colortemperature to the specified value after power up. When setting color_temperature, the color_temperature property must be included Color will set the color tot he specified value after power up. When setting color mode, the color property must be included Previous will set color to the state it was in before powering off. |
ColorColorTemperature2 | |
LightLevelGet | |
Light | |
LightLevelReport | |
MotionGet | |
Motion | |
MotionGetSensitivity | |
MotionReport | |
SensitivityStatus | |
MotionPutSensitivity | |
GroupedLightGet | |
GroupedLightGetAlert | Joined alert control |
GroupedLightGetSignaling | Feature containing basic signaling properties. |
GroupedLightPutType | Type of the supported resources (always grouped_light here) |
Dynamics2 | |
BridgeGet | |
BridgeGetType | |
TimeZone | |
BridgePutType | |
BridgeHomeGet | |
BridgeHomeGetType | |
SceneGet | |
SceneGetType | |
ActionGet | |
SceneMetadata | |
ScenePalette | Group of colors that describe the palette of colors to be used when playing dynamics |
SceneGetStatus | |
ActionGetAction | The action to be executed on recall |
ActionEffects1 | Basic feature containing effect properties. |
ColorPaletteGet | |
ColorTemperaturePalettePost | |
ScenePaletteEffects | |
ColorTemperaturePalettePostColorTemperature | |
Active | |
ActionPost | |
ScenePostType | |
ActionPostAction | The action to be executed on recall |
ActionColorTemperature | |
ActionEffects2 | Basic feature containing effect properties. |
ScenePutType | |
SceneRecall | |
SceneRecallAction | When writing active, the actions in the scene are executed on the target. dynamic_palette starts dynamic scene with colors in the Palette object. |
RoomGet | |
RoomGetMetadata | configuration object for a room |
RoomArchetype | Possible archetypes of a room |
RoomPutMetadata | configuration object for a room |
TemperatureGet | |
Temperature | |
TemperatureReport | |
TemperaturePutType | Type of the supported resources (always temperature here) |
This SDK is licensed under the MIT License.
See the LICENSE file for more details.