The FireBeetle 2 ESP32-C5 is a compact and powerful development board powered by the ESP32-C5 chip, designed specifically for IoT applications requiring efficient and reliable wireless connectivity. Featuring a RISC-V 32-bit single-core processor running at up to 240 MHz, the ESP32-C5 integrates advanced connectivity options, including dual-band Wi-Fi 6 (2.4 GHz and 5 GHz), Bluetooth 5 (LE), and IEEE 802.15.4 (Zigbee 3.0, Thread 1.3). With 384 KB SRAM, 320 KB ROM, and 29 programmable GPIOs, it offers robust performance and flexibility, making it an excellent choice for smart home and industrial IoT projects.
Here, we will guide you through the essential steps required to set up MQTT (Message Queuing Telemetry Transport) within your Home Assistant environment. MQTT is a crucial protocol often used for IoT devices and home automation. By following these steps, you’ll learn the essential steps for configuring MQTT in Home Assistant, enabling efficient communication between your ESP32-C5 and the system for seamless device control and automation.
Home Assistant is a free, open-source platform that acts as a centralized hub for home automation. It enables seamless control and automation of smart home devices from various brands, offering a unified interface without relying on cloud services or an internet connection. This focus on local control ensures enhanced privacy and reliability. With Home Assistant Cloud, users can securely access their system remotely, integrate voice assistants, and maintain full encryption. Designed for interoperability, Home Assistant serves as both a smart home hub and an integration platform, making it a versatile solution for managing diverse IoT devices from a single point.
Hardware
To follow along with this guide, you’ll need the following:
Home Assistant Green: A dedicated Home Assistant hardware device for managing your smart home.
FireBeetle 2 ESP32-C5: It is a low-power IoT development board featuring high performance, multi-protocol wireless connectivity, and smart power management — making it ideal for reliable, flexible, and long-lasting smart home and IoT applications.
DHT11: Accurate temperature & humidity sensor with plug-and-play interface.
The FireBeetle 2 ESP32-C5 is a compact and powerful development board powered by the ESP32-C5 chip, designed specifically for IoT applications requiring efficient and reliable wireless connectivity. Featuring a RISC-V 32-bit single-core processor running at up to 240 MHz, the ESP32-C5 integrates advanced connectivity options, including dual-band Wi-Fi 6 (2.4 GHz and 5 GHz), Bluetooth 5 (LE), and IEEE 802.15.4 (Zigbee 3.0, Thread 1.3). With 384 KB SRAM, 320 KB ROM, and 29 programmable GPIOs, it offers robust performance and flexibility, making it an excellent choice for smart home and industrial IoT projects.
If you want to use a Raspberry Pi to DIY your Home Assistant, you will need the following:
Raspberry Pi Imager: A quick and easy way to install Raspberry Pi OS and other operating systems to a microSD card, ready to use with your Raspberry Pi.
Arduino IDE: It is a versatile, beginner-friendly, open-source electronics prototyping platform. With just a bit of learning, you can quickly start developing your own projects.
Before connecting your ESP32-C5 to Home Assistant via MQTT, you'll need a running instance of Home Assistant. Here, we'll cover two popular methods to get started: a DIY approach using a Raspberry Pi for hands-on experience, and a plug-and-play option with Home Assistant Green for simplicity. For additional installation methods, such as using a virtual machine or other hardware, refer to the official guide: https://www.home-assistant.io/installation/.
DIY with Raspberry Pi
The Raspberry Pi is a compact, affordable single-board computer and one of the most popular choices for hosting Home Assistant. This method is ideal if you're interested in a hands-on DIY project to build skills and customize your setup.
Follow these steps to install Home Assistant Operating System (HAOS) on your Raspberry Pi using the Raspberry Pi Imager tool:
1. Download and install Raspberry Pi Imager from the official Raspberry Pi website.
2. Insert a microSD card into your computer.
3. In the Imager, select "Home Assistant" as the OS, choose your Raspberry Pi model, and write the image to the SD card.
4. Insert the SD card into your Raspberry Pi, power it on, and follow the on-screen setup.
For a detailed walkthrough, including hardware requirements and troubleshooting, check the official tutorial: https://www.home-assistant.io/installation/raspberrypi.
Plug-and-Play with Home Assistant Green
If you prefer a hassle-free start, the Home Assistant Green is an affordable, ready-to-use device designed specifically for Home Assistant. It comes pre-installed with the software, so you can plug it in and get running in minutes—no assembly or OS installation required.
To set it up:
1. Unbox the Home Assistant Green and connect it to power and your network (via Ethernet cable).
2. Access the web interface at homeassistant.local:8123 from a browser on the same network.
3. Complete the initial configuration wizard to create your account and set up your smart home.
For step-by-step instructions, including unboxing and network tips, see the support article: https://support.nabucasa.com/hc/en-us/articles/24737667232413-Getting-started-with-Home-Assistant-Green.
Once Home Assistant is up and running via either method, you can proceed to configure MQTT for your ESP32-C5 integration.
Step 1. Navigate to your Home Assistant web interface.
Tip: To access advanced features, such as MQTT configuration, enable Advanced Mode:
Click on your profile and enable Advanced Mode.
Step 2. In the sidebar, click Settings to open the settings menu, then select Add-ons to access the add-on store.
Step 3. Use the search bar or browse through the available add-ons to find the Mosquitto broker.
Step 4. Click the button to open Mosquitto broker homepage, then click INSTALL to add it.
Step 5. Once installed, click START to launch it.
Step 6. Wait for the service to start, then check the Log tab for any errors. Note that logs don’t refresh automatically—you’ll need to refresh them manually. A successful startup log should look like this:
Step 1. Create a separate account specifically for MQTT access.
Step 2. Click the Settings button, then select People.
Step 3. Click ADD PERSON.
Step 4. Enter a Name, and make sure to check Allow person to login.
Note
Step 5. In the Add User pop-up, type a password, confirm it, and click CREATE.
Step 1. Navigate to Settings -> Devices & Services.
Step 2. On the Integrations page, you should see the MQTT integration.
Step 3. Click CONFIGURE -> SUBMIT -> FINISH. Afterward, you will see MQTT under Configured.
Note:
Please keep the ESP32C5 and Home Assistant on the same LAN
Arduino Preparation
Step 1. Download and install the latest version of Arduino IDE according to your operating system
Step 2. Launch the Arduino application
Step 3. Add the ESP32 board package to your Arduino IDE
Navigate to File > Preferences, and fill "Additional Boards Manager URLs" with the URL below: https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json
Navigate to Tools > Board > Boards Manager..., type the keyword "esp32" in the search box, select the latest v3.3.0-alpha1 branch version of esp32, and install it.
Step 4. Select your board and port
Board:
Navigate to Tools > Board > esp32 and select "ESP32-C5 Dev Module".
Before uploading code, configure your board settings:
Navigate to Tools > Port and select the correct serial port for your board. Make sure the COM number is correct; it does not need to match the chip model.
Step 5. Navigate to Sketch > Include Library > Manage Libraries..., type the keyword "PubSubClient" in the search box, select the latest version of the PubSubClient, and install it.
Step 6. Connect the ESP32-C5 according to the diagram: connect the DHT11 to the expansion board, and connect the ESP32-C5 to your computer via a USB cable.
Step 7. Upload the Esp32C5_to_WiFi_and_MQTT code to your ESP32-C5.
You can find the code here: https://github.com/Skicheng/ESP32/tree/master/esp32/ESP32-C5-Home%20assistant-MQTT
Here, you can see it connecting to Wi-Fi and then to the MQTT broker. Once it shows MQTT connected, it starts sending data.
Now, let’s go back to Home Assistant. In Settings > Add-ons, open the broker and check the logs. You can see the client connecting and attempting to send data to MQTT.
Now we can display the sensor data on the Home Assistant dashboard.
Step 1. Go to the Add-on Store and locate File editor.
Step 2. Click the button to open the File editor homepage, then click INSTALL to add it.
Step 3. Once installed, click START to launch it.
Step 4. Click New File and name itmqtt
.yaml
Step 5. In themqtt
.yaml
file, add the following line:
Plain
Text
yaml
sensor
:
name
: MQTT Demo
unique_id
:
"MQTT_Demo"
state_topic
: esp
32
c
5
/data
Step 6. Click the red icon in the top right corner to save it.
Step 7. Then clickconfiguration
.yaml
Step 8. In theconfiguration
.yaml
file, add the following line, then click the red icon in the top right corner to save it:
Plain
Text
yaml
mqtt:
!include
mqtt.yaml
Step 9. Go to Developer Tools and click CHECK CONFIGURATION.
Step 10. Then click ALL YAML CONFIGURATION, and you should see a green check mark icon.
The sensor data is now successfully showing on the Home Assistant dashboard.
HACS (Home Assistant Community Store) is a community-driven add-on store that offers a wide range of third-party integrations and custom components for Home Assistant. In this guide, we’ll show you how to integrate HACS into Home Assistant and how to install and use the various components it provides to make your smart home system more complete and personalized.
Step 1. Navigate to Settings > Add-ons> Add-on store to find the Terminal & SSH and install it.
If you see the screen below, it means the installation was successful.
Step 2. Enter the following commands in the terminal to download the HACS installation package:
Run the HACS download script.
Plain
Text
Code
wget
-O - https://get.hacs.xyz | bash -
Step 3. Restart Home Assistant
Step 1. In Home Assistant, go to Settings > Devices & Services.
In the bottom right corner, click + Add Integration.
Search for HACS and select it.
Step 2. Acknowledge the statements and select Submit.
Authenticate the integration:
Step 3. Select Authorize HACS. Once you see the confirmation screen, you can close the tab and go back to Home Assistant.
Congrats! You have installed the HACS integration in Home Assistant.
Go back to My Home, and you can easily use HACS to discover, install, and update third-party integrations and custom components, making your Home Assistant dashboard more visually appealing.