Hello :)
We are in a phase of building house and after doing investigation on what kind of smart home system we want to have, we decided to go with Home Assistant.
I love the Open Source projects. They not only allow the enthusiasts to build their own devices, they also save the money! With that in mind, I decided to test in our current flat if custom sensors could be the way to go for our new house.
I decided to build:
- 2 temperature and humidity sensors using ESP32-C6 and AHT20 running on 1200mAH Li-Pol battery
- 2 temperature, humidity and CO2 sensors using ESP32-C6 and SCD40
I run (temporarily) HA OS on my 9 year old HP laptop. The zigbee receiver is Sonoff Zigbee 3.0 USB dongle.
How did it go?
Getting the parts
I ordered all of the stuff from Aliexpress. I had everything at home within 2 weeks~. The most of the time I just spent on figuring out what microcontroller I need and what sensors are good fit.
Soldering
Since I am amateur at soldering, my joints were not good. I though they were, but they were not :D ESP32 could not read the temperature and I was looking for issues... I tried so many things like debugging ESPHome flashing software, reading how I2C protocol works, studying how ESP32C6 is built as well as writing to seller regarding malfunction of the sensors (facepalm on me) until I simply used voltmeter just to realize that the sensors are not getting proper 3.3V :D
Anyway, after resoldering the joints with higher temperature, I got correct 3.3V and sensors started to report their values :)
This probably took me 1 week to set up. I worked on this after kids went to bed so 2-3hours/day.
Getting HA OS to run on 9 year old laptop
This was not an issue at all! HA has very good manual page and simply following the instruction to install HA OS using Ubuntu 24 worked like a charm. This was 1 hour of work~
Configuring HA & Zigbee2MQTT
Since it is such a widely used system, it was not an issue to set things up. I remember simply following some Youtube tutorial. I would say I spent 30 minutes on this one.
Flashing the firmware
Since I am a software engineer, I decided to create my own workflow for flashing the firmware. I created the git project https://github.com/iNviNho/myhomesensors where I have:
- 1 yaml file per room
- 1 script for building the firmware
- 1 script for flashing the firmware to the attached USB device
It took me like 1-2 hours to build the workflow while building the yaml files with todays AI was a simple task. The battery devices use deepsleep and one wired device is used as zigbee mesh router.
In total, I think I spent 2-3 hours playing with the setup.
Connectivity
The first week, I struggled with low LQI. The fix for me was to actually put sensors to the reasonable height as I had majority of them like 15 cm from the floor.
Ah, the costs?
- ESP32C6 - 5e/piece * 4
- AHT20 - 1e/piece * 2
- SCD40 - 18e/piece * 2
- Battery 1200mAh - 5e/piece * 2
- Sonoff Zigbee Dongle - 22e/piece * 1
= 90e~
So, that is it what I wanted to share with you :) I have been running the HA in my flat for more than a month now and I am blessed with how it works. I would say the POC was successful and I would build all of my sensors for our new home. I am planning to buy 3D Printer so I will be able to put some nice case on them and plug them into a USB power adapter using some male-to-male USB-C connectors.