ESP32-C6 and HA
I’ve been playing around with these lately, particularly the Adafruit Feather version. It's pretty simple to setup a decent homemade sensor with reporting by just plugging some components together and piecing together some code. The point of this particular build is to use the Zigbee capabilities on the C6.
I'm not going to write a full tutorial here but I wanted to outline the mechanisms of my setup in case it inspires someone. This setup also pulls together some components that are pretty fun to play around with on their own.
You'll need an ESP32-C6 Feather board, a sensor that has a Stemma QT connector, Home Assistant, and a light that you can control with HA. The light is optional.
Step 1) Plug the sensor into the Feather's Stemma QT connector and connect to a computer to program it. You now have a Zigbee enabled programmable sensor. The hardest part was designing an enclosure. You could easily put it in a small storage container or lego too. Or you could delight your guests and leave a pile of electronics on the table. It makes you look smart.
Step 2) This is probably the hard part for most people. Write your sensor code and enable Zigbee discovery. I put my code together using the quick starts that came with my sensors. Adafruit has excellent documentation for all of their components.
There are hundreds of youtube videos on how to get started in Arduino. It's a neat skill to learn if you'd like to make custom stuff for HA.
Step 3) This step is optional. The Feather has a bright neopixel that you can set and display through a transparent enclosure, or you could just send HA notifications and skip the light.
Connect your sensor to HA with Zigbee and create automations to control the color of a controllable light on your HA setup based on the data received. I used an ESP32 and WLED to connect a small strip of addressable leds to my system. I printed a Minecraft redstone block enclosure to hold it. This is also a cool project and worth doing just to have a notification light for your HA.
And that's it! My applications were CO2 sensors. When the Zigbee data returns a value the light displays green, yellow, or red based on that value. I also have the neopixel on the feather board programmed to display the same color. It shows through the transparent lid on my enclosure. When a certain critical level is reached I send text notifications as alerts.
I’m happy to share my code but it’s specific to the hardware I used: Adafruit ESP32-C6 Feather board, and an Adafruit SCD-40 CO2 sensor. The SCD-40 is pretty expensive, the Adafruit SGP30 is much more reasonable and probably good enough.
5 Comments