Bulb set to 0 brightness will not turn back up

I have a bulb that sometimes gets set a zero brightness, and it (appropriately) turns itself off. However, once I send the bulb another brightness level it does not ramp up to that brightness, it remains ‘off’. If I flick it off and on again at the switch it will come back on at the new brightness level.

In order to get around this I am sending the bulb an ‘off’ and ‘on’ message after I change the brightness, but this isn’t ideal, as I don’t always know if the bulb is ‘off’ due to a zero brightness, and it can result in the bulb turning off and on again when transitioning between birghtnesses.

Is this a bug? I feel like I should be able to tell my bulb to ramp down to zero and back up just by sending it the brightness command.

By the way I am using the maker channel on IFTTT to change the brightness, so that’s possibly confusing the system.

Nevermind, this was just some extensive lag caused by the IFTTT -> LIFX server chatter. Brightness ramps back up fine.

1 Like

Ok I’m going to re-open this one as I am still getting this behaviour after cutting out IFTTT. Here’s the code I am using to fade the bulb to 0 brightness:

// bring the lights down to hot nothing over 30 min
$link = "https://api.lifx.com/v1/lights/all/state";            

$headers = array('Authorization: Bearer ' . $token);

$data = array(
    "color" => "kelvin:2500",
    "brightness" => 0,
    "duration" => 900,
);

$ch = curl_init($link);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
$response = curl_exec($ch);

And here is my fade-up code:

$link = "https://api.lifx.com/v1/lights/all/state";            

$headers = array('Authorization: Bearer ' . $token);

$data = array(
    "color" => "kelvin:9000",
    "brightness"=> 1,
    "duration"=> 300,
);

$ch = curl_init($link);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
$response = curl_exec($ch);

As you can see it’s the same code, with different POSTed data. Both of these snippets return ‘ok’ responses so both of them are going through fine.

I’m going to send a ‘power on’ command to my bulb before ramping the brightness back up and I’ll report back how it goes.

Ok turning my lamp on using the ‘toggle’ API endpoint makes the lamp pop straight up to max brightness - which I don’t want. What I have had to do is use the ‘set state’ endpoint to set a brightness of 0.1, followed by a ‘toggle’ command, followed by my fade-up command. This is three commands in quick succession - am I missing something here? Is there a better way to fade up from 0 brightness?

You can power the light on using the state endpoint by setting the power parameter to on. If the lamp is off, this will fade from off, to the state that you specified. So taking your example:

$link = "https://api.lifx.com/v1/lights/all/state";            

$headers = array('Authorization: Bearer ' . $token);

$data = array(
    "color" => "kelvin:9000",
    "brightness"=> 1,
    "duration"=> 300,
    "power"=> "on",
);

$ch = curl_init($link);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
$response = curl_exec($ch);

Thank you sir. Works perfectly.

I’m going to reopen this one.

Using the above code I am having issues turning my light on reliably. I am getting no errors reported from the cURL call, but the bulb does not turn on. Here’s my API response:

{"results":[{"id":"d073d5109720","label":"Desk","status":"ok"}]}

No error, but the call doesn’t work either.

After further exploration I find that when I list my lights, this lamp is reporting that it is on, and with a brightness of 1, which is incorrect - the bulb is either off, or has a brightness of 0, or both. When I open the LIFX app on my phone and check the bulb it is also reporting that the bulb is on with a brightness of 1.

@daniel_hall can you check my API call logs again and see where it went screwy? I am posting this as of 12-Mar-2016 22:40:21 UTC

What type of bulb do you have? You might need to talk to support about an RMA…

It’s a white 800. I think the problem came from crosstalk between IFTTT, the LIFX app and my own API calls, no need to return the bulb, I have just added more checks in the system to mitigate the chance of it happening again.

1 Like