A nodemcu powering a WS2812B 144 LED strip to create lighting effects under a model rocket powered by Home Assistant
- ESP8266 Development Board
- 1M RGB LED Strip - WS2812B
- Electrolytic Decoupling Capacitors - 1000uF/25V
- Resistor 330 Ohm 1/4 Watt
- 74AHCT125 - Quad Level-Shifter (3V to 5V) - 74AHCT125 - Wasn't used but is recommended
Create a secrets.h file in the same directory as rocket_led.ino and define the following secrets.
/************ WIFI and MQTT Information (CHANGE THESE FOR YOUR SETUP) *************/#defineSTASSID "" // Wifi SSID
#defineSTAPSK "" // Wifi Password
constchar*ssid=STASSID;
constchar*password=STAPSK;
#definemqtt_server ""
#definemqtt_username ""
#definemqtt_password ""
constintmqtt_port=1883;
/**************************** FOR OTA **************************************************/#defineSENSORNAME "led" //change this to whatever you want to call your device
#defineOTApassword "password" //the password you will need to enter to upload remotely via the ArduinoIDE
intOTAport=8266;The LED effects and power is controlled by Home Assistant.
light:
- platform: mqttschema: jsonname: model_rocket_ledstate_topic: "rocket/led"command_topic: "rocket/led/set"rgb: trueeffect: trueeffect_list:
[rocket_take_off,rocket_flight,bpm,candy cane,confetti,cyclon rainbow,dots,fire,glitter,juggle,lightning,noise,police all,police one,rainbow,rainbow with glitter,ripple,sinelon,solid,twinkle,]optimistic: falseqos: 0input_number:
rocket_animation_speed:
name: Rocket Animation Speedinitial: 150min: 1max: 150step: 10For changing the speed of the light effect.
- alias: "Rocket Animation Speed"initial_state: Truehide_entity: Falsetrigger:
- platform: stateentity_id: input_number.rocket_animation_speedaction:
- service: mqtt.publishdata_template:
topic: "rocket/led/set"payload: '{"transition":{{ trigger.to_state.state | int }}}'Based on ESP-MQTT-JSON-Digital-LEDs

