I’ve previously covered creating a Home Assistant air quality monitor system using a XAIO ESP32-C3 module and ESPHome / Home Assistant to create a 7-in-1 air quality monitor sensor. My previous article though did require a little bit of soldering to get it going.
Today I’m going to show you my latest sensor build which has completely eliminated the soldering. It’s plug and play using ESPHome and Home Assistant. I did this using the Adafruit QT Py module which has a built-in connector for connecting to a I2C (Stemma QT) device like the Grove SEN54 environmental sensor. In addition to eliminating any soldering this also saved me money by not having to buy an expansion board.
Today I’ll show you the updated build for my air quality sensor setup I’ll be using throughout my home. Let’s get started!
This updated build only consists of these two parts:
We simply have the QT Py and the Grove All-in-one environmental sensor from Seeed Studio. We also have a Stemma QT to Grove cable to connect the two.
All you need besides these two components is Home Assistant and ESPHome. This is a plug-and-play setup!
Adding ESPHome to Home Assistant
We are going to assume you have Home Assistant installed as installing Home Assistant is outside the scope of this guide. You can absolutely follow along though and see if it looks like something you’d like to explore. I have it installed as a supervised installation on an Orange Pi 5.
Sign into your Home Assistant instance and go to “Settings” and then “Add-ons”. Next click the “Add-on Store”.
ESPHome has it’s own section like this:
Select ESPHome and then click “Install”. Once the installation is finished you can click “Start” to start the service.
To make things easier choose to add the ESPHome option to your sidebar. That way you’ll see a menu choice specifically for ESPHome going forward.
First head to the ESPHome menu option:
If you don’t see the ESPHome menu option then go back to the “Add-on Store” from the previous step. Select ESPHome and enable “Show in sidebar”.
For setup we need to connect your QT Py to your device running Home Assistant with USB. This is only required for setup. It will communicate wirelessly after you’ve completed setup (if you configure it that way).
You also have the option of connecting it to a different computer but *only* if your Home Assistant instance is configured to run in HTTPS.
Click “New Device” in the bottom right hand menu. Follow the menus to add the device into your ESPHome instance.
Editing YAML Configuration
Click “Edit” on the new sensor/device you created. We are going to change the esphome and esp32 sections to this:
esphome: name: sensors-garage platformio_options: board_build.flash_mode: dio friendly_name: sensors-garage esp32: board: adafruit_qtpy_esp32c3 variant: esp32c3 framework: type: esp-idf
Note that YAML is very sensitive to spacing. The editor will underline errors in red for you which definitely helps to spot them as long as you’re watching for them.
While we are in here you should save your encryption key to your clipboard or keep it handy for reference. We are going to need it in the step to add the device to Home Assistant later.
Install Configuration to Device
Finally you can begin programming the device. Click to “Install”. Select the device type and your USB device again and with any luck:
Above you can see it connected to my WiFi point and that everything ran successfully. That is without ever programming the ESP32. ESPHome did all of the programming for us!
Adding Device to Home Assistant
Now head back to your “Settings” menu for Home Assistant and click “Devices”. You should see your new sensor with the name you specified in the configuration.
Check to see if the sensor is online. With any luck it is like my example above. Now click “Configure”:
It should ask you if you want to add the node to Home Assistant. Select “Submit” and then it will ask you for your encryption key it gave us earlier. If you don’t have this just go back to the ESPHome menu and select “Edit”. You will see the key in plain text under “encryption” and then “key”.
If everything goes well the device should come online and be successfully paired with Home Assistant. From this point forward we will be able to update and push the configuration wirelessly to the device.
Adding Sensor to YAML Configuration
Here’s the full configuration I used for the sensor:
esphome: name: sensors-garage platformio_options: board_build.flash_mode: dio friendly_name: sensors-garage esp32: board: adafruit_qtpy_esp32c3 variant: esp32c3 framework: type: esp-idf # Enable logging logger: # Enable Home Assistant API api: encryption: key: "XXX" ota: password: "XXX" wifi: ssid: !secret wifi_ssid password: !secret wifi_password domain: .jamesachambers.net power_save_mode: none i2c: sda: 5 scl: 6 sensor: - platform: sen5x id: sen54 pm_1_0: name: " PM <1µm Weight concentration" id: pm_1_0 accuracy_decimals: 1 pm_2_5: name: " PM <2.5µm Weight concentration" id: pm_2_5 accuracy_decimals: 1 pm_4_0: name: " PM <4µm Weight concentration" id: pm_4_0 accuracy_decimals: 1 pm_10_0: name: " PM <10µm Weight concentration" id: pm_10_0 accuracy_decimals: 1 temperature: name: "Temperature" accuracy_decimals: 1 humidity: name: "Humidity" accuracy_decimals: 0 voc: name: "VOC" algorithm_tuning: index_offset: 100 learning_time_offset_hours: 12 learning_time_gain_hours: 12 gating_max_duration_minutes: 180 std_initial: 50 gain_factor: 230 temperature_compensation: offset: 0 normalized_offset_slope: 0 time_constant: 0 acceleration_mode: low store_baseline: true address: 0x69 update_interval: 10s
Save and install the configuration to the device.
Now you should have a new entity within Home Assistant that looks like this:
I put them in my garage here:
You can see I put a little mount for the sensor unit to sit on and faced the inlet and outlets away from the wall. This is so I’m getting good airflow and accurate readings.
The other equipment in the picture is my whole house outdoor RGB lighting as well as my sprinkler box. The plug is a Z-Wave enabled smart plug with power monitoring features.
This is the design I will be using for all of my environmental sensors from now on. Although the soldering isn’t a big deal for me now that I have the Pinecil there’s no question that plug-and-play is a much nicer way to work with these. You also save money by not having to buy the expansion board.
This will be a much easier way to get started with these as a beginner. If you already have Home Assistant (and bonus points for already having ESPHome) everything will be configured within there. Even the flashing is done by ESPHome within Home Assistant. It really is as easy as I’ve made it look here.
I highly recommend the open source hardware and software solution for sensors. You don’t need proprietary units for these to have to avoid soldering. There are good ways to do this using a cheap <$10 ESP32 module without making any compromises!