Skip to content

kkwestt/ESP-MQTT-JSON-WS2812-LEDs-with-web-server-and-WiFiManager

Repository files navigation

ESP MQTT JSON WS2812 LEDs with web server and WiFiManager

This project shows a super easy way to get started using Digital LED strips with Home Assistant, a sick, open-source Home Automation platform that can do just about anything.

The code covered in this repository utilizes Home Assistant's MQTT JSON Light Component and an ESP8266 microcontroller.

Also the code covered in this repository utilizes ESP MQTT JSON Digital LEDs.

Supported Features Include

  • RGB Color Selection
  • Brightness
  • Flash
  • Fade
  • Transitions
  • Effects with Animation Speed
  • Over-the-Air (OTA) Upload from the ArduinoIDE!
  • WiFi Manager for first connection settings
  • Litle web server

Some of the effects incorporate the currrently selected color (sinelon, confetti, juggle, etc) while other effects use pre-defined colors. You can also select custom transition speeds between colors. The transition variable in Home Assistant (HA) also functions to control the animation speed of the currently running animation. The input_slider and automation in the HA configuration example allow you to easily set a transition speed from HA's user interface without needing to use the Services tool.

The default speed for the effects is hard coded and is set when the light is first turned on. When changing between effects, the previously used transition speed will take over. If the effects don't look great, play around with the slider to adjust the transition speed (AKA the effect's animation speed).

OTA Uploading

This code also supports remote uploading to the ESP8266 using Arduino's OTA library. To utilize this, you'll need to first upload the sketch using the traditional USB method. However, if you need to update your code after that, your WIFI-connected ESP chip should show up as an option under Tools -> Port -> Porch at your.ip.address.xxx. More information on OTA uploading can be found here. Note: You cannot access the serial monitor over WIFI at this point.

Web interface

Web interface

Demo Video

Demo Video

Tutorial Video

Tutorial Video

Parts List

  • [Digital RGB WS2812 Leds 5 meter roll]
  • [Sonoff Basic]
  • [220 AC/DC 5v Power Supply 20A 100W]
  • [Just a few wires 6 meters 2 x 1.5mm]

Sonoff Basic Pinout

  • Sonoff Basic AC out connected to AC/DC Power Supply

  • GPIO 14 - LED strip DATA

  • GND - LED strip GND

  • GPIO 4 - Second RED status led (must solder wire from second pin on bicolor led to pin on ESP chip)

  • GPIO 0 - BUTTON pin

  • GPIO 12 - RELAY pin

Wires

Wires

gpio 4 pinout

SAMPLE MQTT PAYLOAD:

  SAMPLE PAYLOAD:
  {
    "brightness": 120,
    "color": {
      "r": 255,
      "g": 100,
      "b": 100
    },
    "flash": 2,
    "transition": 5,
    "state": "ON"
  }

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages