Lifx setColor -vs- all other setColor

So I recently received my first Lifx device. An 8-zone Strip. Setup was fast and easy. I then started to make an app to make patterns with the 8 zones. I kept getting an error when sending the setColor command.

Using:
value = [hue: hueColor, saturation: saturation, level: onLevel.toInteger()]
ie. value = [hue: 12, saturation: 100, level: 75]
it.setColor(value)
('it' being a zone 1 through 8)

The zone works but the Parent device shows an error with each command.

[this space for rent]

Thanks

@bcopeland

Not 100% sure here, without more data on the values you were passing in - but I'm fairly sure that the error "went away" because the brightness param is being ignored, while the level param was being processed.

I've been dabbling in the LIFX classes and custom drivers a bit, and I'm pretty sure the translation from level to brightness occurs internally - the Hubitat command is still hue, saturation, level

1 Like

example:
setColor([hue:12, saturation:100, level:70])
setColor([hue:12, saturation:100, brightness:70])

I was thinking that it should be processed internally too but all the docs I could find specify brightness. very confusing.

Just ran some more tests and I think you are right. The level changes using level but doesn't using brightness. Just getting that error.

:man_shrugging:
Thanks

1 Like

Could be an issue in the component driver... See in your log that it's repeating the value a lot:. 70707070707070....

Using this color driver that @bcopeland posted to GitHub as a reference, there's multiplication and Math.round() - so it def seems like a string gets passed up from the component to the parent, and multiplied... I just checked some scenes that I captured using my LIFX strip, activating the scene doesn't generate these errors for me...

1 Like

Don't think it's needed here, but if you need to identify a specific device type, you could declare the App input accordingly, e.g.

input(name: 'lifxStrips', type: 'device.LIFXStrip', ...
Based on the driver name (remove all spaces)

3 Likes

@bptworld

Oooh, looking forward to this app.... Would be cool if you could read all the patterns from the lifx app and add those to your library to send to lifx from HE...

Not sure about that, lol. I've actually never even looked at the Lifx app other than to add the device.

I'll probably put out a beta later today. Maybe I can get some help on one issue that I'm stuck on!

1 Like

I'm sure if you're sniffing the network and push one of the color mix buttons the stream of commands will come through

Easy enough to capture all of the individual zone states in a scene, too. I've got a zooz switch (in smart bulb mode) connected to some of my strips, and rules set up, so that I can:

  1. Set a theme from the LIFX app
  2. Double tap button 2, which triggers
    2a. Refresh the strip(s) in Hubitat
    2b. Capture the child devices in a specified scene

Then a double-tap on button 1 will set the captured scene.

1 Like

I was thinking of that too...

Biggest "problem" I have right now is that Hubitat "popcorns" the zones when re-applying the scene. Started working on a custom strip driver to avoid this, but waiting on a fix in 2.3.1

1 Like

Well, still getting an error but maybe someone else can see if it's the Lifx driver or my app. The app works great either way. :grin:

For those that want to try it out, it's in HPM, search for Pattern Controller.

Let me know how it goes.

:eyes:PM Me what you are having trouble with

2 Likes

Fixed it! Thanks to Bryan @bcopeland for heading me in the right direction.

Pattern Controller
1.0.1 - 02/14/22 - Fixed a stubborn error!

1 Like

Download the Hubitat app