LIFX Local Control

There are two reasons for the polling

  • in case the devices are changed by some other means, e.g. the LIFX app or HTTP protocol
  • The response from a LightSetState message didn't accurately return the correct values. Particularly when using a duration. A lot of the time it would return the original values!

It currently polls each device once per minute, which is probably good enough. I may make that a setting in the future.

3 Likes

Gotcha, I think I'll get this setup soon. I have a few switches to migrate/install. If I have any hair left after that I'll give this sucker a try.

1 Like

Yay! It's now doing everything I want it to do!

All hail @rob! :bowing_man:

3 Likes

@rob I have two new questions (LOL does it ever end?!?) :wink:

  1. Is it possible to simply toggle on/off over time without changing the original level? In other words, if a light was on at 60% brightness and I then turn it off, is it possible to simply "toggle" it back on to that 60% brightness? By this, I'm actually hoping to use that same 2-second duration I like so much, so basically fade it off and back on to whatever temp and brightness it was before.

  2. When I change a light from 4500K 100% bright to 2500K 10% bright, it does a two-step transition, that is, it first transitions the brightness, and then transitions the temperature. Is it possible to do such transitions all in one step like one can using the LIFX app?

  1. Hmm, not currently, let me think about it. I could possibly store the old values in a state variable.

  2. I wouldn't have expected it to do that, unless you're specifying power: on in your SetState map. I think I may have a fix for that.

Finally home and checking out the new version. Color driver works well, but Day&Dusk doesn't respond to CT or level changes in the driver. On/off works fine. Can anyone confirm?

@luniel I’m curious, why are you using custom commands instead of the usual dimmer option in RM?

@rob I couldnt wait and set this up on my dev hub. Couple of small things in my very brief testing.

  • changing bulb on/off state quickly yields a substantial delay in bulb changing state. I will test more and let you know.
  • turning on debug logs does not seem to send anything to the logs (intentional?..or maybe I havent done anything loggable yet)
  • added the word "loggable" to the Webster dictionary for everyone's convenience.
  • clicking ping yields an error (because there is no ping method declared)
  • setting bulb level does not turn on the bulb. This is a good thing for staging lights but you might want to consider changing this so Lifx bulbs behave like other bulbs in HE. This will probably generate some discussion among your users :wink:

I'm very impressed by the response time so far. Great job sir!

1 Like

It's still an alpha, at least until I've got working drivers for Multizone devices.

And thanks, it's been an interesting experience :smiley:

  • I did play with changing bulb state quickly at one point - I'll be interested in what you find out.
  • yeah, I should really sort out the debug log stuff
  • LOL
  • oh, I'm sure that used to work, must have deleted the method, probably easier to just drop the capability
  • it's kind of intentional, but you make a good point. You can do pretty much everything with SetState though, but that won't work well with apps that expect a dimmer I guess.
    I could maybe add a setting for that so the user can decide.

Is Day&Dusk levels and CT working for you guys?

:+1:

I'm using the lifx color bulb driver btw. It's the only type I have.

Ah, looks like that's broken, I'll get to that tomorrow, clearly something weird happening there.

1 Like

Whew, glad it wasn't just me. For the record, I can control them using the Color driver.

1 Like

Well, aside from those, I've got all my other LIFX bulbs fully automated now. :tada: This is almost as exciting as when I unplugged Smartthings.

My only wish of course is for it to integrate the Groups, to eliminate the ever-so-slight popcorning. (Add the word popcorning right next to loggable) I'm not sure if that's possible though, without talking to the app?

@Townsmcp It's because with the "Turn [on/off] these switches" there's no option to fade it on/off (just instant), and with the "Toggle these dimmers" option you have to set a level, and I don't want to set a level, I just want it to return to whatever level it was before.

Here's a general formula for the behavior I'm after:

GIVEN light1 was at brightness level X before being turned off
  AND light1 is currently off
  AND my preferred fade-on time is N seconds

 WHEN light1 is turned on

 THEN light1 is faded from brightness level 0 to X over N seconds

I'm using X to mean whatever the level was before it was turned off; I don't want to pre-set that. I will pre-set the fade-on time however,

If there's already a way to achieve this, just point me at it and I'll be all over it! :wink:

PS: I also looked to see if there's a way to simply specify power to be "on" or "off" without anything else, but couldn't find that.

Ah ok. Thanks for the explanation. I haven’t used custom commands for anything complex beyond a simple set eco on Nest Thermostat.

As an example, one of your lines is:
[kelvin: 2500, color: "White", level: 10, power: "on", duration: 2]
Is that one custom command? Or multiple commands? If one, do you use string as parameter type and the string being that line above without [] ?

Sorry, also not meaning to sound dumb, and I’m probably not getting your on/off in the second post, but can’t you just use Control Switch for that?
Thanks

@rob

Yes, I'm specifying power: on. The reason is that I'm controlling all the LIFX bulbs in the room with a SmartThings button and want to be able to long-press/hold the button to go from OFF to 2500K@60% or double-click the button go from OFF to 4500K@100%, and in other rooms I want to go from OFF to 10% when it may have been 100% before. If I don't specify power:on then I have to first hold the button to set the 2500K@10% while the light is OFF and only then click the button to turn it ON. I might know to do this, but it's confusing as heck for everyone else.

The scenarios I'm trying to deal with is when the lights may have previously been set to 100% before they were turned off, and then late at night or very early morning while it's still dark I just want to be able to turn the lights on to a low level without it first blinding me or whomever is trying to use the room.

Does this make sense?

Yes, parameter as type string, but the square brackets go into the string parameter as well. Here's a screenshot of one:

image

1 Like

LOL no, you don't sound dumb :grinning: if anything, my posts are unclear :wink:

It's my experience (little as it may be) that "Control Switch" doesn't allow fading on/off over time, it's just instant on/off.