For the Geeks in the House
Just wanted to give you some insight into the underlying scripting commands that control the LIFX smartbulbs. As you can see, you will have total control over your LIFX smartbulbs for custom applications and hacks on these brightly lit robotic overlords.
We're laying the foundation for an ecosystem of powerful and innovative software to control the lighting in your life. All LIFX library code will be open source. Developers will be able to create their own control apps for personal and commercial use. The actual bulb firmware will be licensed for non-commercial use only.
We've chosen a lightweight, extensible format for the commands implemented by the lightbulbs. These can be augmented by web friendly RESTful APIs.
Over the coming months, source code and documentation will be posted to a public repository as it beds down. If you're not a backer and want to stay in touch - head over to lifx.co to register your interest or check out the tech.lifx.co blog.
Disclaimer: As is the nature of development, all final commands, procedures, bulb enclosures, LED arrays, etc are likely to change. But you can see where we're heading. It's going to be epic.
In the video, we're sending the commands to our demo lamp, which listens to an IP address/port on the LAN and acts as a gateway to the lighting mesh network. Multiple user interface clients can be connected to the demo lamp simultaneously.
Every command has an idenitifier "id", a keyword and some parameters. The id can address all of the lights using "0", an individual light "integer", or a collection of lights "integer, integer, integer, ...".
Commands are either executed immediately, e.g lit, go, stop or can be added to a sequence that can be run later, using the seq keyword. The lights can store a number of different sequences that you can start and stop at any time.
- (id lit rrggbb) // set to a specific color
- (id lit rrggbb time) // set to a specific color for a given time period
- (id lit rrggbb:rrggbb time) // blend between two colours over a time period
- (id seq rrggbb time) // add command to the current sequence
- (id go step_number) // run a sequence from a specific point
- (id stop) // stop the running sequence
(0 lit ffffff) // turn all lights white
(1 lit ff0000:0000ff 20) // light 1: blend from red to blue over 2 seconds
(2,3,4 go 5) // lights 2, 3 and 4: run a sequence from step 5
Police light sequence
(0 seq ff0000 2)
(0 seq 0000ff 2)
(0 seq go 0)
(0 go 0)
Colour blend sequence
(0 seq ff0000:00ff00 20)
(0 seq 00ff00:0000ff 20)
(0 seq 0000ff:ff0000 20)
(0 seq go 0)
(0 go 0)
For the KickStarter video, we had the lights running on a tenth of a second timer, which you'll notice in the above examples, e.g 20 represents 2 seconds. For production, we'll have finer grained timing and a neater way of representing time, e.g 2.0 seconds.
All the best,
Tech Team LIFX