LIFX Developer Zone

Replicating the "Random" effect via HTTP API


#1

Hey everyone!

I’m working on a small project at my company to back-light illuminate a sign we have in our office that shows some progress status throughout the day. I love the “random” effect that’s available for use in the iOS app and would love to use it as a “yay! congrats, we reached our goal”-type of effect.

I can’t come up with any solution using the existing API endpoints for controlling my LIFX Z to achieve this effect - any ideas?
Thanks!


#2

The random effect sends a continuous stream of SetColor messages with a randomized hue value and a duration which matches the frequency of the stream.

It’s a bit more complicated for multi-zone products (like LIFX Z), where you’ll need to calculate multiple color points and the blending between them, but the principal of letting the fade duration smooth out the transitions remains the same.


#3

Yeah, sadly sending a constant stream via a RESTful API seems like a lot of work :’( not even accounting for SetColor calculations