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

Unit TMOS PIR Home Assistant Integration

This tutorial will use the Unit TMOS PIR sensor with the AtomS3R controller and integrate it into Home Assistant to achieve real-time monitoring and display of human presence and activity status.

Preparation

  1. Hardware List.
  1. Software & Version.

Create Device

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

  2. Click the green + button in the bottom right corner to start creating a new device.

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

  4. Enter the device name and click NEXT.

  5. Select the device type, click ESP32S3.

  6. Click SKIP to skip the encryption key settings.

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

Device Configuration

External Components Configuration

Add the External Components configuration to the YAML file to load the STHS34PF80 sensor driver.

external_components:
  - source: github://m5stack/esphome-yaml/components
    components: sths34pf80
    refresh: 0s

I2C Bus Configuration

  • Add I2C component to configure the communication pins between Unit TMOS PIR and AtomS3R.
i2c:
  sda: GPIO2
  scl: GPIO1
  scan: true
Note
AtomS3R corresponds to SDA: GPIO2, SCL: GPIO1. If using other interfaces, please adjust according to the actual pins.

Sensor Configuration

  • Add Sensor component to configure presence detection and motion detection functions.
sensor:
  - platform: sths34pf80
    pres_flag:
      name: "TMOS Presence Detected"
    mot_flag:
      name: "TMOS Motion Detected"
    presence_threshold: 200
    presence_hysteresis: 50
    motion_hysteresis: 50
    odr: 8
    update_interval: 1s

Main parameter descriptions:

Parameter Value Description
presence_threshold 200 Presence detection threshold; higher values result in lower sensitivity.
presence_hysteresis 50 Presence detection hysteresis value to prevent frequent status switching.
motion_hysteresis 50 Motion detection hysteresis value.
odr 8 Output Data Rate (Hz), supports 0.25 / 0.5 / 1 / 2 / 4 / 8 / 15 / 30.
update_interval 1s Sensor status update interval in Home Assistant.

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.

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

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

    Note
    Click Unit TMOS to view the complete example configuration. The first build may take some time depending on the performance of the Home Assistant host and the network quality.

Flash Firmware

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

  2. In the pop-up serial port selection window, find and select the corresponding serial port.

  3. Click INSTALL.

  4. Select the firmware file downloaded in step 3 to upload.

Warning
You must reset the device after flashing is complete, otherwise the firmware may not start properly.

Getting Started

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

  2. Find the online Unit TMOS PIR device in the Discovered area, click CONFIGURE, and follow the prompts to complete the addition.

  3. After successful addition, the device page will display two sensor entities, pres_flag (presence detection) and mot_flag (motion detection), and their real-time status.

  4. Finally, add the sensor entities to the dashboard to view the human presence and motion status in real time.

On This Page