Skip to content

LIFX Lights Setup

Jeffrey Gilliam edited this page Sep 14, 2018 · 6 revisions

NOTE: This will not be available until version 1.7 of the SIMRacingApps Server.

LIFX Lights can be purchased from http://lifx.com or on http://amazon.com. I have no affiliation with them and these links do not provide me with any revenue. The unit that I tested with is here, but others that function like it should work as long as the Lifx API is the same.

Cloud Setup

Each light must be configured using their app to connect it to your WiFi. Once you have the light controllable from their app, then go into the settings for the light(s) you want to use in SIMRacingApps and if they are not already in the cloud, select "add them to the cloud".

Once doing that, change the group assigned to them depending on the SRA plugin you are going to use them with. This way a plugin can control more than one light.

  1. For the LIFX-Flags plugin use the group "SRA-flags".
  2. TBD

NOTE: These group names are case sensitive. So type them in exactly like you see here.

SRA Setup

The following entries must be setup in your settings.

LIFX-Flags = Y
LIFX-token = YourToken

To obtain a token:

  1. Go to https://cloud.lifx.com and login to your account.
  2. Click on your name/email in the upper right corner of the screen and select "settings".
  3. Click on "Generate a new Token" and give it the name "SIMRacingApps" and click "Generate".
  4. Copy the token it generates and paste it in the SIMRacingApps settings where is says YourToken
  5. Save your settings and restart the SRA Server.

Optional Settings and Their Default Values

LIFX-flags-brightness = 1.0
LIFX-flags-yellow-blink-seconds = 30
LIFX-flags-testmode = N

# Documentation for these URLs can be found at https://api.developer.lifx.com/docs
# {BRIGHTNESS} is replace in the code by the value of "LIFX-flags-brightness" in your settings
# Take care to make sure the URL is encoded. Meaning special characters are replace with their hex values
# For example a space is represented by %20

LIFX-api-flags-initialize = POST https://api.lifx.com/v1/lights/group:SRA-flags/effects/pulse?color=yellow%20brightness:0&from_color=yellow%20brightness:{BRIGHTNESS}&period=0.5&cycles=3&power_on=true
LIFX-api-flags-off = PUT https://api.lifx.com/v1/lights/group:SRA-flags/state?power=on&color=white&brightness=0&duration=0
LIFX-api-flags-yellow-blinking = POST https://api.lifx.com/v1/lights/group:SRA-flags/effects/pulse?color=yellow%20brightness:0&from_color=yellow%20brightness:{BRIGHTNESS}&period=1.25&cycles=9999&power_on=true
LIFX-api-flags-yellow = PUT https://api.lifx.com/v1/lights/group:SRA-flags/state?power=on&color=yellow&brightness={BRIGHTNESS}&duration=0
LIFX-api-flags-blue = PUT https://api.lifx.com/v1/lights/group:SRA-flags/state?power=on&color=blue&brightness={BRIGHTNESS}&duration=0
LIFX-api-flags-green = PUT https://api.lifx.com/v1/lights/group:SRA-flags/state?power=on&color=green&brightness={BRIGHTNESS}&duration=0
LIFX-api-flags-white = PUT https://api.lifx.com/v1/lights/group:SRA-flags/state?power=on&color=white&brightness={BRIGHTNESS}&duration=0
LIFX-api-flags-red = PUT https://api.lifx.com/v1/lights/group:SRA-flags/state?power=on&color=red&brightness={BRIGHTNESS}&duration=0
You can’t perform that action at this time.