Adafruit NeoPixels and Home Assistant

Adafruit NeoPixels are rings, strips and other printed circuit boards with addressable RGB LED strips. It this video tutorial you will learn how to use NeoPixels with the popular open source home automation platform Home Assistant without any coding!

Yes, that’s correct! Let’s get started with Adafruit NeoPixel Ring and NeoPixel Stick in Home Assistant without any coding, just a few simple configurations.

The key for this tutorial is ANAVI Miracle Controller. An ESP8266-powered, open source, Wi-Fi dev board to control two 5V or two 12V LED strips. It supports popular LEDs including Neopixel, WS2811, WS2812B, TM1809, etc. Furthermore ANAVI Miracle Controller has dedicated slots for mini OLED display and up to 3 additional sensor modules. Right now we are running a crowdfunding campaign at Crowd Supply to fund mass production of ANAVI Miracle Controller.

Adafruit NeoPixels work at 5V so set the jumper on ANAVI Miracle Controller to 5V and use an appropriate 5V power supply.

Required Hardware

  • Adafruit NeoPixel Ring
  • Adafruit NeoPixel Stick
  • 6 male to male jumper wires
  • 5V DC power supply
  • ANAVI Miracle Controller
  • Personal computer, for example Raspberry Pi

Step By Step Installation

  • Install Home Assistant through Hass.io on the personal computer (it is recommended to use Raspberry Pi 3 or 4).
  • Install Mosquitto MQTT broker from Hass.io add-on store, configure username and password as well as Access Control Lists (ACL).
  • From Configure > Integrations add new MQTT integration and click Enable discovery. It is mandatory to enable discovery!
  • Solder male to male jumper wires to Adafruit NeoPixel Ring and NeoPixel Stick.
  • Connect NeoPixel Stick DIN to LED1, GND to GND and 5VDC to VOUT on ANAVI Miracle Controller. Connect NeoPixel Ring Data Input to LED2, GND to GND and 5V DC Power to VOUT on ANAVI Miracle Controller.
  • Set the jumper of ANAVI Miracle Controller to 5V and use appropriate power supply to turn on the board.
  • Configure ANAVI Miracle Controller to connect to your local WiFi network, set LED type to NEOPIXEL, number of LEDs for LED1 to 8 and number of LEDs for LED2 to 12.
  • In Home Assistant web interface, a couple of new devices will be automatically added under the names ANAVI Miracle Controller LED1 and ANAVI Miracle Controller LED2. Set different effects and colors for each Adafruit NeoPixels.

How Does It Work?

ANAVI Miracle Controller combines open source hardware with free and open source software. It has been certified by the Open Source Hardware Association under UID BG000050. After initial configuration the default firmware of ANAVI Miracle Controller, available as an Arduino sketch in GitHub, connects to the WiFi network and the MQTT broker. It sends a retained MQTT message with JSON payload containing description of the device. Home Assistant, thanks to the MQTT integration with enabled discovery, automatically receives the message and recognizes the device as MQTT Light component. As a result out of the box ANAVI Miracle Controller appears in the Home Assistant GUI.

You may also like

Control 12V RGB LED Strip from Home Assistant

Home Assistant is a popular open source platform for home automation. It is written in Python programming language and runs perfectly on Raspberry Pi 3 B/B+ or 4 B. Now, with the latest updates of the Arduino sketch for ANAVI Light Controller it is super easy to control 12V RGB LED strip from Home Assistant through your smartphone, tablet or personal computer.

Have a look at the video and follow the steps below to configure ANAVI Light Controller and change colors of 12V RGB LED strips from Home Assistant.

What Is Required?

The following hardware is required:

How to Install?

  • Install Mosquitto from Hass.io add-on store. Set username and password for login to Mosquitto. Set active Access Control Lists (ACL) for the username and launch Mosquitto (it is recommended to install SSH server prior this step).
  • Add MQTT integration in Home Assistant with enabled discovery (from Configuration > Integrations)
  • Attach the 12V RGB LED strip to ANAVI Light Controller
  • Ensure that ANAVI Light Controller has been flashed the latest version of the default Arduino sketch. If it is not, compile it and after that upload it following this video guide.
  • Turn on ANAVI Light Controller, connect to its WiFi Access Point (AP) and configure it through the captive portal. You must provide your WiFi credentials, MQTT server, username and password. After that ANAVI Light Controller will be automatically discovered by Home Assistant over MQTT.
  • Through Home Assistant change colors or effects of ANAVI Light Controller.

How Does It Work?

ANAVI Light Controller is powered by the ESP8266 microcontroller with WiFi. The default Arduino sketch works with the machine to machine protocol MQTT and implements Home Assistant discovery of MQTT Light component.

As soon as ANAVI Light Controller boots, after it has been configured, it connects to the WiFi network, after that to the MQTT broker and sends retained MQTT message with JSON payload that describes the device. Each ANAVI Light Controller has a unique MD5 ID based on the chip ID of ESP8266. The MQTT integration in Home Assistant discovers ANAVI Light Controller based on the received MQTT message. Thanks to the data in the JSON payload Home Assistant automatically configures the device as MQTT Light.

Home Assistant & 12V RGB LED strip attached to ANAVI Light Controller

Home Assistant discovery is a user-friendly way for quickly adding new Internet of Things to the platform. Combined with MQTT and the default firmware for ANAVI Light Controller the process is straight-forward and anyone can do it in a few minutes.

You may also like