Scenes API

Note

Modifying scenes works differently to most state modifications. See SceneStateChange for details.

class hueclient.models.scenes.Scene(**kwargs)

Bases: hueclient.monitor.MonitorMixin, repose.resources.Resource

Note that scene state is not available on this resource as scene state is write-only. See SceneStateChange for details.

id

The ID given to the scene by the bridge (alphanumeric, Eg: s123457)

name

An editable name given to the scene

lights

The Light resources effected by this scene

active

Is this scene active?

class hueclient.models.scenes.SceneStateChange(**kwargs)

Bases: repose.resources.Resource

SceneStateChange work differently to LightState and GroupState. SceneStateChange specifies a change in state for a specific scene & light combination.

For example, to change light ID 1 in scene e2eab6bf6-on-0 to on:

change = SceneStateChange(
    scene=Scene.objects.get(id='e2eab6bf6-on-0'),
    light=Light.objects.get(id=1),
)
change.on = True
change.save()
scene

The scene to which this change applies

light

The light to which this scene applies

on

On/Off state of the light. On=true, Off=false

brightness

Brightness of the light. This is a scale from the minimum brightness the light is capable of, 1, to the maximum capable brightness, 254.

hue

The hue value is a wrapping value between 0 and 65535. Both 0 and 65535 are red, 25500 is green and 46920 is blue.

saturation

Saturation of the light. 255 is the most saturated (colored) and 0 is the least saturated (white).

xy

The x and y coordinates of a color in CIE color space.

color_temperature

The Mired Color temperature of the light. 2012 connected lights are capable of 153 (6500K) to 500 (2000K).

transition_time

The duration of the transition from the light’s current state to the new state. This is given as a multiple of 100ms.