This article will get you started with using your Tulip Light Kit in production.
This article assumes that you have a Tulip Light Kit, and that it is already connected to your Gateway. For more information on how to connect your Light Kit reference, “Tulip Light Kit Initial Setup.”
Before you start, log into your Tulip account i.e. your_account.tulip.co, and open the App Builder.
Then, open the app where you would like to use the Light Kit.
Full List of Light Kit Actions
Here are the different ways that you can manipulate the Light Kit in an app.
1- Light Kit Turn On One Bin turns on one bin and turns off all other bins.
2- Light Kit Turn on Another Bin turns on one bin without turning other bins off.
3- Light Kit Off turns off one bin.
4- Light Kit All On turns on all bins.
5- Light Kit All Off turns off all bins.
6- Light Kit- Turn on an array of bins
Note: Use the color selector to change the color of bins when they light up:
Set Up Your First Trigger
Turning on One Bin
Create a new Trigger and give it a name, like "Light Kit Trigger".
Under the “When” section choose the appropriate option. In this example we will use “step is opened”
Then, fill the “If” condition if required. We will not be using this condition in our example
Under the “Then” section for our example these are the options that we’ve used:
- "Run Gateway Function" "Pick-to-light" "Turn on one bin" at "this station"
- bin: "Static value" "integer" "5" color: "green"
This will just turn on the 5th bin and turn it green.
Turning On Multiple Bins
You may want to turn on multiple lights at once. To do this, use the "Turn On Array of Bins" action after creating an array with the bin numbers you would like to illuminate.
Here's how to illuminate bins 3 and 4 with the color pink:
- "Arrays" "Push onto Array" "Static Value" "integer" "4" array: "bin_array"
- "Arrays" "Push onto Array" "Static Value" "integer" "3" array: "bin_array"
- "Run Gateway Function" "Light Kit" "Turn on an array of bins" at: "this station" bin: "bin_array" color: pink
Please note: When you return multiple rows from a SQL connector, the output is formatted as an array full of objects, even if you return individual values. So, if you want to use SQL to determine a list of bins, you must save each individual element in a separate array full of integers.
The “Factory Kit Setup” application comes with a Light Kit unit test step (pictured below). This is a helpful resource when getting started with the Light Kit.
You’ll see the “Factory Kit Setup” among the list of available apps that came with your instance.