Home Assistant as growbox controller on a Raspberry Pi 4 2GB, using several different devices and sensors, connected via ESPHome (esp8266-12-e)
- Install Home Assistant as container
docker compose up -d
If you need Docker run for Raspbian/Debian/Ubuntu distros:
sudo bash install-docker.sh
-
Run the steps for ESPHome installation, when completed run step 3
-
Install the ESPHome integration and in the "host" field, put your esp8266 ip address
- Install Python on your PC, you can install a specific version by running:
sudo bash install-python.sh 3.11.0
- Install pip and venv
sudo apt-get install python3-pip python3-venv -y
- Clone repository and activate virtual environment
mkdir -p env
python -m venv env/
- Install ESPHome and other requirements
python -m pip -r requirements.txt
-
Connect esp8266 to your PC using USB cable (buy esp8266 with serial converter integrated)
-
Edit secrets.yaml to reflect your current wifi network
-
Move secrets.yaml and sht20.h (only if you use it, otherwise it's not required) to .esphome directory
mv secrets.yaml sht20.h .esphome
- The first time you flash esp8266, you need to tell esphome some information about your esp8266 device. Right after that, it will validate the configuration, create a binary, upload it, and start logs
cd .esphome && esphome wizard esphome-config.yaml
Next time you'll flash it, you just need to run:
esphome run esphome-config.yaml
- Take note of the ip address printed out in the logs after you run previous command Read all the output and check for sensors errors, if clear come back to Home Assistant installation steps
BME280 Temperature + Humidity + Pressure (i2c bus)
SENSOR | ESP8266 |
---|---|
VIN | 3V3 |
GND | GND |
SCK | SCL |
SDD | SDA |
SHT20 Temperature + Humidity (i2c bus)
SENSOR | ESP8266 |
---|---|
RED | 3V3 |
BLACK | GND |
GREEN | SDA |
YELLOW | SCL |
MH-Z19C NDIR (uart bus - 7pin terminal connection version)
SENSOR | ESP8266 |
---|---|
PIN4 VIN | 5V |
PIN3 GND | GND |
PIN5 RX | TX |
PIN6 TX | RX |
Denkovi USB 8CH relay board
DEVICE | RPI4 |
---|---|
USB | USB |
DEVICE | REQUIRED POWER SOURCES |
---|---|
Denkovi USB 8CH relay board | 12V 1A + 220V |
Esp8266 | 5V 2A |
Raspberry Pi 4 | 5V 2A |
TODO
TODO