The LIFX bulbs have a robust API and developer support. In order to use them in your own projects, follow these steps.

Set up bulb with LIFX app

Screw the bulb into a light socket and power it on.

Follow the instructions that came with the bulb for using with the LIFX mobile app for iOS and Android. This process will get your bulb connected to your WiFi, and allow you to control the bulb directly from your mobile device.

During the setup, name your bulb Lamp so that it will be the same name used in our CircuitPython code.

LIFX Cloud API Access Token

Next, you'll sign in to the LIFX Cloud. (You'll use the same account credentials you set up with the mobile app.)

In the account settings page, click on Generate New Token to create your HTTP API access token, which will be used in the secrets.py file on your FunHouse in order to communicate with the bulb. You can read about it here in the LIFX Developer Zone.

Write down this token in a secure place, you'll need it later.

If you ever need to reset your bulb to factory settings, turn the switch on and off five times in a row!

Test the Connection

Now that you have your token, you can try out a quick test from a command line terminal. Copy and paste the following, substituting the YOUR_APP_TOKEN for your unique token instead:

curl -H 'Authorization: Bearer YOUR_APP_TOKEN' -X POST 'https://api.lifx.com/v1/lights/label:Lamp/toggle'

Press enter and your light will toggle off or on each time you repeat the command, and the light will report its status.

This guide was first published on Apr 28, 2021. It was last updated on Mar 28, 2024.

This page (LIFX Bulb Setup) was last updated on Mar 08, 2024.

Text editor powered by tinymce.