LIFX API Completely screwed

I’ve got a program that features LIFX light support which was working fine a couple of days ago, but no longer.

The issues I face are that it appears the HTTP api no longer responds to colour temperature plus the Set States API fails if there is no Content Type in the HTTP header.

Please remember we have apps to support and this can cause emense amounts of confuction for customers when things stop working.

How do we now address bulbs that only support colour temperature? (the kelvin option seems to have been removed from the Set States API).



I don’t know if it is related, but they did change something on the backend. For a year my SmartThings drivers worked 100% and they stopped a few days ago. I had to make changes to my code to get everything working.

1 - I had to remove my sloppy trailing “,” at the end of my group lists.
2 - When setting colors I had to put a space between the hue and saturation settings instead of a “+”

That said, neither the “,” or “+” were part of the documented api, they just worked.


1 Like

I still haven’t managed to get the kelvin colour temperature to work, but normal colour temperature changes I have fixed by adding the content type header.

Unfortunately they missed this setting from the emulator so there is no way to test it. Can someone confirm we can still specify kelvin as an option in colour alongside brightness?

The only documented way to control the kelvin value of the bulb through the HTTP API is to include it in the color field as described on this page.

So for example to set the bulbs to “Ultra Warm” you would set the color field to:

kelvin:2500 saturation: 0

To me it seems like they need to Rollback the latest updates and release the next version of the API in beta.

This way people are more tolerable of things not working and early adopters can actually participate in testing any changes.


1 Like

The API documents under Colour has a kelvin option which I used to modify a group of lights as follows.

NSArray *states = @[
                    @{ @"selector": light_id,
                       @"power": state ? @"on" : @"off",
                       @"saturation" : [NSNumber numberWithFloat:0.0],
                       @"brightness" : [NSNumber  numberWithFloat:brightness],
                       @"kelvin" : [NSNumber  numberWithInt:kelvin]

This is on iOS by the way and I’m calling the Set States endpoint.

It used to work before Friday but no longer works now. Your suggestions please gentlemen?

I’m not too sure how to define the variables in obj c so you will need to swap that section of the line out.

Hi all,

For those who are having the same problem I documented earlier the solution is:

NSDictionary *states =
@{ @"selector": light_id,
   @"power": state ? @"on" : @"off",
   @"color" : @{
           @"kelvin" : [NSNumber  numberWithInt:kelvin],
           @"saturation" : [NSNumber numberWithFloat:0.0],
   @"brightness" : [NSNumber  numberWithFloat:brightness],
   @"duration" : [NSNumber  numberWithInt:0],

For some reason rightly or wrongly the old API allowed us to pass kelvin and saturation values at root level, but it seems not anymore.

1 Like