Improved Arduino Sketch for ANAVI Light Controller

How often do you get software or firmware updates for a 2-year-old device? Probably not very often. This is not the case for ANAVI Light Controller! We have a major update of its Arduino sketch for you.

ANAVI Light Controller

ANAVI Light Controller open source hardware WiFi device for controlling a 12V RGB LED strip. It was brought to life through a crowdfunding campaign at Crowd in 2018. Now is January 2020, so this makes it ~2 years old! A lot of things have changed during this time. ANAVI Light Controller has been certified by Open Source Hardware Association (OSHA) and it now on sale at our distributors: Crowd Supply, Pi Supply and neven.cz.

Terminals for connecting 12V RGB LED strip to ANAVI Light Controller

Recently we made a major improvements to the default firmware available as an Arduino sketch at GitHub:

  • Support Home Assistant automatic discovery over MQTT
  • Turn on LED D1 on ANAVI Light Controller if the device is not connected to local WiFi network and needs initial configuration
  • Wait for a few seconds while LED D1 is blinking immediately after turning on ANAVI Light Controller to allow reset by keeping SW1 pressed
  • Append the last 5 characters of the machine ID to the WiFi Access Point (AP) to simplify the identification of the ANAVI Light Controller during the initial setup
  • Support MQTT messages with large payload for reporting back the current state of the RGB LED strips on topic stat/dev-id/color
  • Add DEBUG macros, disabled by default, if enabled additional debug information will be printed in the serial monitor
Changing colors of 12V RGB LED strip through Home Assistant using ANAVI Light Controller

You can either compile and upload the new version through Arduino IDE or just grab the binary from GitHub and flash it on your ANAVI Light Controller.

To learn more how ANAVI Light Controller works out the box with the popular open source platform Home Assistant read our previous article. It reveals the exact steps the setup MQTT Broker in Home Assistant and after that to automatically discover ANAVI Light Controller.

ANAVI Light Controller is suitable for low-cost 12V analog (non-addressable) LED strips. If you need a WiFi development board for controlling digital (addressable) LED strips at 5V or 12V have a look at our other open source product ANAVI Miracle Controller.

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

ANAVI Miracle Controller

ANAVI Miracle Controller is an open source hardware Wi-Fi development board powered by the ESP8266 and designed to control two 5 V or 12 V addressable LED strips simultaneously.

ANAVI Miracle Controller supports popular addressable LEDs including Neopixel, WS2811, WS2812B, TM1809, etc. It also has a dedicated slot for a mini OLED I²C display and slots for up to three additional I²C sensor modules. The default firmware is available at GitHub as an Arduino sketch implementing Home Assistant MQTT Light component.

Back in 2018 we created ANAVI Light Controller for low-cost 12V RGB LED strips. Inspired by a lot of people asking for open source hardware dev board for addressable LEDs strips we created ANAVI Miracle Controller.

Last week we launched a crowdfunding campaign for ANAVI Miracle Controller at Crowd Supply. Learn all the details here. We are ready for manufacturing and now we need your support. We hope you help us bring this entirely open source project to life!

You may also like

Connecting ANAVI Gas Detector to Your Wi-Fi

ANAVI Gas Detector is an ESP8266-powered, open source, Wi-Fi dev board for monitoring air quality and detecting dangerous gases. In the previous blog post I have shared the exact steps how to assemble it. Now I will cover the straight-forward process for connecting it to your Wi-Fi network. It is very simple and takes less than a couple of minutes.

Step 1: Turn on ANAVI Gas Detector

When you turn on ANAVI Gas Detector for the first time, it will create its own Wi-Fi Access Point with the name ANAVI Gas Detector followed by a unique five character ID.

These characters are actually the end of the MD5 hash generated from the unique chip ID of the ESP8266 module. To avoid confusion, the same five characters are showed on the mini OLED display included in all kits of ANAVI Gas Detector.

Connect to the Wi-Fi access point created by ANAVI Gas Detector from your smartphone, tablet or personal computer.

Step 2: Captive Portal

Once you have connected to the Wi-Fi access point created by ANAVI Gas Detector, a captive portal will pop-up and guide you to the next steps. Click Configure WiFi as shown in the video.

Step 3: Configure

Select your local Wi-Fi network, enter a password (if it is not open), type in MQTT broker address, port, username and password.

By default, just for demo purposes, ANAVI Gas Detector connects to iot.eclipse.org with port 1883 and no username/password. This is a public MQTT broker just for demonstrations. It is highly recommended to install open source MQTT broker locally and connect ANAVI Gas Detector to it.

Optionally, you can also select a temperature scale. By default it is set to Celsius. Of course, Fahrenheit is also supported. To switch just type in fahrenheit.

Finally, when ready, just click Save. ANAVI Gas Detector will reboot and try to connect first to your Wi-Fi network and after that to the configured MQTT broker. If it experience problems connecting you will be asked to do the configuration again.

That’s it! The whole process requires just these three easy steps and takes less than a couple of minutes. No need to download & install any apps on your smartphone. If you don’t have a smartphone – you can do the configuration from your personal computer or a tablet.

One More Thing…

Once ANAVI Gas Detector is up and running, if you need to change the configurations, just press and hold the RESET button on the board for 10 seconds. Keep the RESET button pressed until the D1 indication LED on the board is blinking.

This way you will wipe out all configuration, reset ANAVI Gas Detector to factory default and you will be asked to connect it again to your Wi-Fi.

For more details please also read our update at Crowd Supply and watch the short video.

You may also like