ESPHome is an open source firmware for your ESP8266 or ESP32 devices with simple and yet powerful configuration files that allows you to control them remotely through the open source IoT platform Home Assistant and/or other home automation systems.
In this tutorial you will learn how to add a device with ESPHome in Home Assistant. The open source hardware ANAVI Light Controller with 12V RGB LED strip is used for the demonstration.
You can either do this through the command line or alternatively, you can do it through Home Assistant ESPHome add-on.
Depending on the device you may need to edit an existing ESPHome configuration file or to create new from scratch. An example for ANAVI Light Controller is available at GitHub. Remember to set your WiFi credentials and device password in it as well as to enable the API. After flashing ESPHome to the device it is important to write down the address and the port. Both are printed in the serial output after booting the device.
After flashing ESPHome to the device it is important to write down the address and the port. Both are printed in the serial output after booting the device.
Home Assistant Integration
Open the web interface of Home Assistant. From the left side menu select Configuration and after that click Integrations. Click the button in the right lower corner with label Add Integration. From the menu select ESPHome. Enter connection settings for your ESPHome device. Set the address for host and port both of which were obtained on the first step. Click SUBMIT. Enter the password from the ESPHome configuration file. Click FINISH to complete adding the device.
Esptool is a free and open source ESP8266 and ESP32 serial bootloader command-line utility. The source code is available at GitHub under GPLv2 license. It is written in Python therefore it is universal and runs on Microsoft Windows, Mac OS and any GNU/Linux distribution (Ubuntu, Debian, Linux Mint, Fedora, CentOS, OpenSUSE, etc).
As of today esptool works fine with Python 2.7 or Python 3. Python 2 has been deprecated since January 1, 2020 therefore it is recommended to use esptool with Python 3.
The easier way to install the latest stable version of esptool is from pypi via pip. Open a terminal and execute the following command:
pip install esptool
Using write_flash argument esptool flashed pre-compiled binary to devices with ESP8266 or ESP32. Here are the exact steps:
Download an appropriate binary for your ESP8266/ESP32 device.
Connect your device to a computer. For example, for ANAVI Thermometer, ANAVI Gas Detector, ANAVI Light Controller and ANAVI Miracle Controller you must use UART to USB debug cable.
Turn on the device in boot mode. For example, on ANAVI Thermometer, ANAVI Gas Detector, ANAVI Light Controller and ANAVI Miracle Controller, press and hold the RESET button and plug the power supply.
All ANAVI Internet of Things with ESP8266/ESP32 combine free and open source software with open source hardware. The firmware is built using Arduino IDE and a pre-compiled binary file is available at GitHub. Follow the links below to identify your ANAVI device and download appropriate binary for the latest stable firmware:
ANAVI Light Controller is an open source WiFi development board for controlling 12V low-cost analog RGB LED strip. Although it has been designed primary for home automation, recently ANAVI Light Controller was integrated in an industrial environment.
Wing.eu is an innovative French start-up company reinventing the shipping. The company specializes in “first mile” logistics and provides services to e-merchants. Their warehouses in Paris, Marseille, Bordeaux and Lyon package and ship e-commerce orders. Wing.eu can be integrated with all leading e-commerce platforms, including the popular open source solutions PrestaShop, Magento and WooCommerce.
Running around the clock such an innovative logistics business requires excellent organization. To ensure high efficiency of the working process Paul Cancouet, project manager at Wing, implemented the Japanese manufacturing system Andon using ANAVI Light Controller.
Andon is a manufacturing term to alert about a problem in real-time. Pioneered by Toyota after World War II, Andon provides the ability to detect problems affecting manufacturing in real-time and fix them as soon as possible.
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 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.
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.
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
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.
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 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.
ANAVI Light Controller is a certified open source hardware WiFi dev board for controlling a 12 V RGB LED strip. Furthermore it has 3 slots for attaching I2C devices, for example sensors for temperature, humidity barometric pressure, light, mini OLED display, etc.
The hardware required for Jonathan’s project includes a Raspberry Pi, ANAVI Light Controller, 12V RGB LED strip, appropriate power supplyies and appropriate lamp. Jonathan used IKEA Holmo floor standing lamp and placed RGB LED strips around a suitable tube inside it. The software requirements are JAVA 8 or above as well as an MQTT broker, for example the free and open source mosquitto.