Arduino code to toggle your Lutron Caseta Smart Lights on and off using a Great Wolf Lodge Magiquest wand.

Control Your Lights with a Magic Wand

Arduino code to toggle your Lutron Caseta Smart Lights on and off using a Great Wolf Lodge Magiquest wand.

What you need

How to do it

The prerequisite to this is that you have your Smart Lights already set up and working. The Caseta instructions are pretty good, so I’ll leave that up to you.

API

  1. Set up an IFTTT account.
  2. Select Maker for this, Caseta for that.
  3. Get your key.
  4. Test out the API to turn the lights on.
  5. Repeat 2-4 for turning the lights off.
See Control your lights with a URL for detailed instructions on setting up the API.

Hardware

  1. Solder the Stackable Headers onto the WiFi Shield.
  2. Place the WiFi Shield on top of the Arduino.
  3. Wire up the IR Receiver to Pin 11, GND and 3.3V (left to right in that order).
  4. Wire up LEDs using Pins 2 and 3 and 3.3V, put a 470 ohm Resistor in-between the 3.3V and the long end of the LED.

Software

  1. Download the Arduino IDE, the ESP8266 Library and the Magiquest IR Library (you have to get kitlaan’s to have the wand work).
  2. In the Arduino IDE /libraries directory, remove the RobotIRremote directory.
  3. Open the Arduino IDE, and add the ESP8266 and Magiquest IR Library .ZIP files to the ID using Sketch -> Include Library -> Add .ZIP Library....
  4. Create a new Sketch and paste in the code.
  5. Change YOUR_WIFI_NETWORK_NAME and YOUR_WIFI_PASSWORD to your own.
  6. Change YOUR_IFTTT_MAKER_LIGHTS_ON_COMMAND, YOUR_IFTTT_MAKER_LIGHTS_OFF_COMMAND and YOUR_IFTTT_MAKER_KEY to the settings you created above.
  7. Upload your Sketch to the hardware.

Now zap your creation with your magic wand and watch the lights turn on and off (you will know that it has worked when the LED switches from red to green).