/LifxAnimator

Command line tool that animates your LIFX lights using sequences you create with an image editor.

Primary LanguageC#The UnlicenseUnlicense

LIFX Animator

Command line tool that animates your LIFX lights using sequences you create with an image editor.

Example recording

This tool uses the LIFX LAN protocol because it's capable of updating a light's color more frequently than the HTTP API.

Sequences

A sequence is described by an RGB image file (transparency byte is ignored). Pixel rows correspond to lights and pixel columns correspond to frames. A frame designates a color for each light. The frame corresponding to the leftmost pixel column is rendered first, then the frame to its right is rendered, and so on. By default, each frame is displayed for 1/10th of a second before the next frame is rendered.

Example 1

This sequence creates a red orb that bounces between four lights. (Note the image is enlarged for display.)

Bouncing orb effect

Example 2

This sequence creates a red orb that explodes with a shimmer effect. (Note the image is enlarged for display.)

Exploding orb effect

Example 3

This is the actual sequence used for the GIF recording at the top of the page.

Bouncing and exploding orb script

Command Line Reference

Example

The following command executes a sequence named sequence1.bmp for 2 lights at 20 fps, repeating until stopped by key press. The top pixel row of the sequence maps to light 192.168.1.89 because of its order.

dotnet LifxAnimator.dll --path "sequence1.bmp" --lights 192.168.1.89 192.168.1.88

Parameters

--path
Path of sequence image. Pixel rows correspond to lights and pixel columns correspond to frames.
--lights
Space-separated, ordered list of IP addresses. The first light maps to the topmost pixel row of the sequence image.
--fps (optional, default=20)
Frames per second. LIFX recommends a max of 20 but the BR30 bulb seems to reliably handle 60.
--repeat-count / --repeat-seconds (optional)
If not specified then repeats until stopped by key press.
--smooth-transitions (optional, default=off)
Smoothly adjust color and brightness when transitioning frames.
--brightness-factor (optional, default=1)
Scales brightness so you don't need sunglasses while testing. Accepts decimal values between 0 and 1.

Download

LIFX Animator requires the .NET Core Runtime, which is available for Windows, Linux, and macOS.

  1. Download .NET Core Runtime
  2. Download LIFX Animator