Skip to main content

See [openhue/openhue-api](https://github.com/openhue/openhue-api)

Project description

OpenHue Python SDK 1.0.0

Welcome to the OpenHue SDK documentation. This guide will help you get started with integrating and using the OpenHue SDK in your project.

Versions

  • API version: v2
  • SDK version: 1.0.0

About the API

See openhue/openhue-api

Table of Contents

Setup & Configuration

Supported Language Versions

This SDK is compatible with the following versions: Python >= 3.7

Installation

To get started with the SDK, we recommend installing using pip:

pip install open-hue-sdk

Authentication

API Key Authentication

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.

Setting the API key

When you initialize the SDK, you can set the API key as follows:

OpenHue(
    api_key="YOUR_API_KEY",
    api_key_header="YOUR_API_KEY_HEADER"
)

If you need to set or update the API key after initializing the SDK, you can use:

sdk.set_api_key("YOUR_API_KEY", "YOUR_API_KEY_HEADER")

Services

The SDK provides various services to interact with the API.

Below is a list of all available services with links to their detailed documentation:
Name
AuthService
ResourceService
DeviceService
DevicePowerService
LightService
LightLevelService
MotionService
GroupedLightService
BridgeService
BridgeHomeService
SceneService
RoomService
ZoneService
TemperatureService

Models

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
PowerupPreset_1 When setting the custom preset the additional properties can be set. For all other presets, no other properties can be included.
PowerupOn_1
PowerupDimming_1
OnMode_1 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.
DimmingMode_1 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
DimmingColor_1
ColorMode_1 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.
ColorColorTemperature_1
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.
PowerupPreset_2 When setting the custom preset the additional properties can be set. For all other presets, no other properties can be included.
PowerupOn_2
PowerupDimming_2
OnMode_2 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.
DimmingMode_2 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.
DimmingColor_2
ColorMode_2 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.
ColorColorTemperature_2
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)
Dynamics_2
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
ActionEffects_1 Basic feature containing effect properties.
ColorPaletteGet
ColorTemperaturePalettePost
ScenePaletteEffects
ColorTemperaturePalettePostColorTemperature
Active
ScenePostType
ActionPost
ActionPostAction The action to be executed on recall
ActionColorTemperature
ActionEffects_2 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)

License

This SDK is licensed under the MIT License.

See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openhue-client-1.0.0.tar.gz (60.2 kB view hashes)

Uploaded Source

Built Distribution

openhue_client-1.0.0-py3-none-any.whl (115.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page