Log in to see full request history

Sets the state of the lights within the selector. All parameters (except for the selector) are optional. If you don't supply a parameter, the API will leave that value untouched.

For example, if you want to turn the light on to a pale blue at 50% brightness over 5 seconds, you'd send:

// PUT /v1/lights/all/state { "power": "on", "color": "blue saturation:0.5", "brightness": 0.5, "duration": 5 }

Fast mode

The API is designed to ensure consistent transitions for devices from one state to another. For many operations, this involves having an accurate view of the current state of the device before taking any action, so we need to ask it for its state first. Other transitions, in order to be smooth, require intermediate state changes; for example, to switch on and set to blue a light that is off and set to red, we first switch it to blue, wait for that to succeed, then switch it on, to avoid jarring transitions.

As this involves various network hops to the device, this process is slower than many traditional web APIs. There are use-cases where this is unnecessary, for example those in which the client has a pretty good idea of the current state and just wants to send one state change message to the device.

To speed things up for such use-cases, when setting fast=true, we do none of checks described above, and just send the targets the end-state messages. Because we don't wait around for a reply from the device in fast mode, you'll just get 202 Accepted with no body if your request was valid.

Infrared

If you want to set Infrared to maximum brightness and shutdown the visible bands, you would send:

// PUT /v1/lights/all/state { "power": "off", "infrared": 1.0, }
Path Params
string
required

The selector to limit which lights are controlled.

Body Params
string

The power state you want to set on the selector. on or off

string

The color to set the light to.

double

The brightness level from 0.0 to 1.0. Overrides any brightness set in color (if any).

double
Defaults to 1

How long in seconds you want the power action to take. Range: 0.03155760000.0 (100 years)

double

The maximum brightness of the infrared channel from 0.0 to 1.0.

boolean
Defaults to false

Execute the query fast, without initial state checks and wait for no results.

Responses

Language
Credentials
Click Try It! to start a request and see the response here! Or choose an example:
application/json