LIFX Local Control

You need to put it in square brackets for it to be treated as a map. Probably inside the string.

Hmmm, it's not working for SetColor - it should work for SetState, but that doesn't currently cope with the colorTemperature.

I'll try to add that tomorrow.

Thanks for confirming I'm not crazy :wink: and thanks for trying to help! :smile:

In the meantime if you can find a suitable colour that matches the colourTemperature you want, then you could use setState with '[brightness: 100, color: "#FFEEEE"]' for example, replace the hex code with a suitable colour.

I had to use "level" instead of "brightness", and in order to turn them on after they've been turned off I had to add 'power: "on"' as well.

So here's what I have:

button pushed = comfy lights = '[level: 60, color: "FFEEEE", power: "on"]'
button held = bright lights = '[level: 100, color: "FFFFFF", power: "on"]'
button double-tapped = lights off = '[level: 1, color: "FFEEEE", power: "off"]'

I added the level 1 to the off setting because going from bright to off to comfy turned the comfy lights on at bright white before setting to comfy. Weird but it seems to work.

Thanks so much for this help in the meantime!!

New version released just now.

This one definitely requires all drivers to be updated along with the app.

Notes:
Split the app's page into multiple pages - discovery is now on its own page which allows for more frequent refreshes.

Discovery improvements - for me it reliably discovers all devices in 2 passes

SetState now takes the following parameters in the map

  • brightness
  • level (same as brightness if a colour is specified)
  • color (or colour). This can be a named colour, an HTML colour specified in hex e.g. #FF77DC or 'random' which will pick a colour from the named colours
  • power - on or off
  • kelvin (or temperature)
  • duration (in seconds, the duration for the transition to the new state, can be a decimal value)

Added new Named Colors page which shows the available named colours. The colors can be sorted by Name, Hue, Level or RGB. There are more named colours now, and a lot more to add in future.

Discovered devices are now shown as links which will take you directly to that device's page in a new browser tab.

Please ignore the 'For experimental Stuff' page, it's currently broken - I'd meant to disable it.

1 Like

Sweet!! I'm going to try it out as soon as possible. :smile:

1 Like

Rob, I've been playing around with this and I found a defect on line 652 of LIFXMasterApp that triggers when trying to use a named color instead of hex. Seems like it's defining a new private foundColor that's not available outside the IF statement. I modified it to the following and now the named color feature works. Hopefully I didn't break something else.

	foundColor = colorList().find { (it.name as String).equalsIgnoreCase(color) }

I'll continue to test out the rest.

Thanks again for all your work! I'm loving it! :smile:

I just found the same thing while testing something else :slight_smile:

And the github master has been updated with the fixed code. Didn't bother to create an alpha release for this. As long as you get the master you'll be fine.

Added your git to the top post :+1: :raised_hands:

1 Like

Here's what I've found after playing around with setState for a few hours:

  1. To use white temperature / kelvin, you have to set the color value to "White" or "#FFFFFF"
    I finally figured out that in order to set true White temperatures in kelvin so that even in the LIFX app it shows the White temperatures wheel instead of the Colors wheel, you have the always set the "color" value to either "White" or "#FFFFFF" and then use your kelvin number. If you set any color value other than "White" or "#FFFFFF" it ignores the kelvin setting and set the color you specified. Not sure if anyone else didn't know this, but hopefully it helps anyone else who might be battling with this as well. Here are the custom commands I'm currently using:
    [kelvin: 2500, color: "White", level: 10, power: "on", duration: 2]
    [kelvin: 2500, color: "White", level: 60, power: "on", duration: 2]
    [kelvin: 2500, color: "White", level: 100, power: "on", duration: 2]
    [kelvin: 4500, color: "White", level: 10, power: "on", duration: 2]
    [kelvin: 4500, color: "White", level: 60, power: "on", duration: 2]
    [kelvin: 4500, color: "White", level: 100, power: "on", duration: 2]

  2. brightness doesn't seem to do anything
    Regardless of whether I'm setting an actual color or setting a white temperature, only setting a level value will actually control the brightness.

  3. duration doesn't seem to do anything
    Basically, I'd like to get a 2-second fade whenever I turn the lights on, off, or switch to a different color/temp. I just cannot seem to get any "fade" to happen, regardless of what I set the duration value to. Is there something I'm doing wrong?

Other than the duration/fade issue mentioned, this is working like a charm.

@rob: Thanks, so much for this!!

1 Like

Okay, clearly I screwed up with setting the temperature and the duration.

But brightness seems to work okay for me.

I think the duration might refer to the duration between color changes, not for level changes? If you're only using "white" in your examples, then you won't see any changes at all unless you specify a different color. Though I see you changed temperature with same effect, so that must be an issue.

Okay, another update, which I hope has fixed the color temperature, brightness and duration issues. Seems to be working okay here, but I'm sure you'll let me know :slight_smile:

You should only need to update the LIFX Master app for this update if you installed yesterday's version.

1 Like

@rob big thank you for getting this off the ground. I think I'm almost ready to jump on board the Lifx Local Train.

@kilowatts, how is the response time of this integration compared to the cloud version I ported from ST?

1 Like

@stephack Robs code is very noticeably quicker - almost instant compared to the 5 second odd delay I encountered on LIFX GOG

1 Like

@stephack you can have both installed running side by side and notice the difference too

Thanks, that's great news. I was just scanning through the code. Are we still reliant on polling to get the bulbs status updates? I was hoping the local implementation would not have that limitation.

If only Hubitat could be a UDP listener for unsolicited/multicast messages...

2 Likes