English
English
简体中文
日本語
pdf-icon

Unit Mini TVOC/eCO2 Home Assistant Integration

This tutorial will introduce how to use the Unit Mini TVOC/eCO2 gas sensor unit with the AtomS3R main controller and integrate it into Home Assistant to achieve real-time monitoring of TVOC (Total Volatile Organic Compounds) and eCO2 (equivalent carbon dioxide) concentrations in the air.

Preparation

  1. Hardware List
  1. Software and Versions

Create Device

  1. Open the ESPHome Dashboard. If the initial guidance interface appears, click CONTINUE.

  1. Click the green + button in the lower right corner to start creating a new device.

  1. Click New Device Setup to enter the device creation wizard.

  1. Enter the device name and click NEXT.

  1. Select the device type, click ESP32S3.

  1. Click SKIP to skip the encryption key setting.

  1. Click EDIT to enter the YAML configuration page and customize device functions.

Device Configuration

I2C Bus Configuration

Add the I2C component to configure the communication pins between Unit Mini TVOC/eCO2 and AtomS3R.

i2c:
  sda: GPIO2
  scl: GPIO1
  scan: true
Description
The PORT.A interface of AtomS3R corresponds to SDA: GPIO2, SCL: GPIO1. If using other ports, please adjust according to the actual pins.

Sensor Configuration

Add the Sensor component to enable the SGP30 sensor entity.

sensor:
  - platform: sgp30
    address: 0x58
    update_interval: 2s
    store_baseline: true
    # Optional
    # baseline:
    #   eco2_baseline: 0x190 #400
    #   tvoc_baseline: 0x0   #0
    eco2:
      name: "eCO2"
    tvoc:
      name: "TVOC"

Main Parameter Descriptions:

Parameter Value Description
address 0x41 I2C address of Unit Mini TVOC/eCO2.
update_interval 2s Time interval for updating measurement values to Home Assistant.
store_baseline true Whether to enable the baseline value storage function.
baseline Optional Preset baseline values, which can be adjusted according to the environment for accuracy.
eco2 eCO2 entity configuration Configures properties such as the name of the eCO2 sensor entity.
tvoc TVOC entity configuration Configures properties such as the name of the TVOC sensor entity.

Download and Flash Firmware

Compile Firmware

  1. After completing the YAML modification, click SAVE in the upper right corner to save the configuration, then click INSTALL.

  1. Select Manual Download in the pop-up window.

  1. Wait for the firmware compilation to complete, click Download and select Factory format (Previously Modern) to save the firmware locally.

Flash Firmware

  1. Connect AtomS3R to the computer using a USB Type-C cable. Open ESPHome Web and click CONNECT.

  1. In the pop-up serial port selection window, select the correct serial port number.

  1. Click INSTALL.

  1. Select the firmware file downloaded in step 3 and start flashing.

Note
The device must be reset after flashing is complete; otherwise, the firmware may not start normally.

Learn

  1. In Home Assistant, click Settings > Devices & Services in sequence to enter the integration management page.

  1. Find the Unit Mini TVOC/eCO2 device in the Discovered area, click CONFIGURE, and follow the wizard to complete the configuration.

<img src="https://m5

Thought for 0 seconds > **Refining Translation Strategy** > > I'm now prioritizing accurate translation of key phrases and headings. I'm focusing on "Prepare," "Create Device," and "Device Configuration" for headers, and "Hex Key L-Shape" for terminology. I am ensuring that links are correctly translated and comments are added. Further, I am confirming the correct translation of `## 开始使用` to `## Learn`. I've also validated proper spacing and code block formatting. I am ready to start the detailed translation.
stack-doc.oss-cn-shenzhen.aliyuncs.com/727/unit_tovceco2_HA_discover.png" width="400px" />
  1. After the device is added, multiple sensor entities can be seen on the device details page, including eCO2 and TVOC. Click Add to dashboard to add them to the dashboard.

  1. Finally, add these sensor entities to the dashboard to monitor TVOC and eCO2 concentrations in the air in real-time.

On This Page