Skip to content

Complete project instructions for making an ESP32 Home Assistant controlled RGB fairy light strand

Notifications You must be signed in to change notification settings

kylehovey/RGB-Fairy-Lights

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RGB Fairy Lights

aurora

This project includes all of the firmware and 3D files to create a driver for the RGB fairy lights sold on Adafruit's store. In order to control this light, you will need to be running Home Assistant on a server at your house along with a MQTT broker and Home Assistant MQTT Integration.

Materials

Tools

  • Soldering Iron
  • Wire Strippers/Cutters
  • Solder
  • Double-Sided Adhesive (keeps ESP32 in place, I used thick double-sided tape)
  • 3D Printer
  • Filament

Printing the Case

I used PLA to print the case. The models are located in the models directory of this project, and you can slice them using whatever software you prefer. I used Cura.

Assembly

  1. Strip the ends of two short wires and solder them to positive and ground on the barrel jack.
  2. Add heat shrink for the barrel jack connection.
  3. Insert the barrel jack into the case and tighten the nut to fasten it in place.
  4. Solder the ground wire to ground on the ESP32
  5. Solder the positive wire to the diode, then the diode to 5V on the ESP32 (make sure the polarity is right, and you may want to trim the diode leads to make it a bit shorter)
  6. Insert the bare wires from the male end of the JST connector into the upper slot on the case (above the USB slot where the ESP32 sits).
  7. Plug in the LED strip to the connector and match up the wires to find out which one is:
  • Ground - Black on the strand
  • Positive Voltage - Red on the strand
  • Data - Green on the strand
  1. Solder positive to positive on the ESP32 (shares the same positive connection with the power jack wire you just added).
  2. Solder ground to ground on the ESP32 (shares the same ground connection with the power jack wire you just added).
  3. Add the double-sided tape to the bottom of the ESP32 and insert the USB C port into the slot in the case, then fold the ESP32 into the walled area in the case (it should be snug).
  4. Snap the lid onto the case.
  5. If using leaded solder, wash your hands and then wipe down the case with a paper towel and throw the towel away afterwards.

Flashing

Follow the instructions to get PlatformIO set up on your system and open this project using it.

  1. Open main.cpp in the src directory and add your wifi network name and password, as well as the IP address of the MQTT broker.
  2. Update the IP address settings to match your subnet/router at home.
  3. You may need to comment out the local_IP and allow the board to get an IP using DHCP, which you will be able to see over the serial monitor. Once you see the IP address, you can uncomment that line and update the IP to the one it received. Alternatively, just comment out this line entirely and always use DHCP (you won't ever need to know the IP address of your light).

Once this is done, connect the ESP32 driver box to your computer via USB C and compile/upload this code to your board.

Adding To Home Assistant

Ensure that you have installed mqtt-cli and run the script src/publish_discovery.sh. This will publish and retain a configuration payload for your device. Ostensibly, this could be sent from the ESP32, but I ran into payload size limitations with the PubSub library I used for MQTT on the ESP32 (and you only need to do this once).

Controlling Your Strand

Now go into Home Assistant and you should see a new device called "Rainbow Fairy Lights". Add it to a dashboard wherever you would like, and control the color/brightness/patterns using Home Assistant's UI. Enjoy!

Known Problems

  • The settable aurora pattern doesn't work yet... I need to find a good formula to convert RGB to hue.

About

Complete project instructions for making an ESP32 Home Assistant controlled RGB fairy light strand

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published