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.

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

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

Click New Device Setup to enter the device creation wizard.

Enter the device name and click NEXT.

Select the device type, click ESP32S3.

Click SKIP to skip the encryption key settings.

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

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:
sda: GPIO2
scl: GPIO1
scan: true 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. |
After completing the YAML modification, click SAVE in the upper right corner to save the configuration, then click INSTALL.

Select Manual Download in the pop-up window.

Wait for the firmware compilation to finish, click Download and select Factory format (Previously Modern) to save the firmware locally.
Connect AtomS3R to the computer via a USB Type-C cable. Open ESPHome Web and click CONNECT.

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

Click INSTALL.

Select the firmware file downloaded in step 3 to upload.

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

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

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.

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