I'm trying to write a basic script which uses the remote API to turn on my lights, then transition them to a certain color. The code for doing so using a custom SDK looks something like this:
group.SetState(hue.State{On: true, Bri: 0, Hue: 4000, TransitionTime: 0})
time.Sleep(1 * time.Second)
group.SetState(hue.State{TransitionTime: 300, Bri: 254, Hue: 11500, Sat: 0})
Where each of the SetState
calls makes a call to the Group command API. Seems simple enough but I'm having a couple of issues:
- Unless I dim the lights then turn them off first (or call the 'Cinema' formula from Hue Labs), when I call this code the lights come on at whatever brightness they were at before, seemingly ignoring the first
setState
call. - The brightness and saturation of the transition are ignored. All it does is transition Hue, though this behavior varies depending on if I include the sleep timer or not.
Any thoughts on what I am doing wrong?
EDIT: It looks like the API isn't even respecting the first statement's brightness setting. If I make the call to set it to 0, nothing happens.