Now let’s do something a bit more fun and start changing some colors. Enter the following command:
Address | http://<bridge ip address>/api/1028d66426293e821ecfd9ef1a0731df/lights/1/state |
---|---|
Body | {"on":true, "sat":254, "bri":254,"hue":10000} |
Method | PUT |
We’re interacting with the same state attributes here, but now we’re modifying a couple more attributes. We’re making sure the light is on by setting the on resource to true. We’re also making sure the saturation (intensity) of the colors and the brightness are at their maximum by setting the sat and bri resources to 254.
Finally, we’re asking the system to set the hue (a measure of color) to 10000 points (Hue runs from 0 to 65,535). Try changing the hue value and keep pressing the PUT button and see the color of your light changing and running through different colors.