Skip to content

Matter Sensor: add the ThingsOne Presence Sensor sub-driver - #3278

Open
samjin-sw wants to merge 2 commits into
SmartThingsCommunity:mainfrom
samjin-sw:thingsone-presence-sensor
Open

samjin-sw wants to merge 2 commits into
SmartThingsCommunity:mainfrom
samjin-sw:thingsone-presence-sensor

Conversation

@samjin-sw

Copy link
Copy Markdown

Check all that apply

Type of Change

  • WWST Certification Request
    • If this is your first time contributing code:
      • I have reviewed the README.md file
      • I have reviewed the CODE_OF_CONDUCT.md file
      • I have signed the CLA
    • I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
  • Bug fix
  • New feature
  • Refactor

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have verified my changes by testing with a device or have communicated a plan for testing
  • I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior

Description of Change

Adds the ThingsOne Presence Sensor, model IC60001-PSC01 (VID 0x1241, PID 0x8010), to matter-sensor as the sub-driver thingsone_presence_sensor. This replaces the standalone driver package in #3274, as suggested in review.

The device is a battery-powered (ICD) Matter-over-Thread sensor using standard clusters only: Occupancy Sensing on EP1 (FeatureMap PIR | RAD), Temperature Measurement on EP2, Illuminance Measurement on EP3, Relative Humidity Measurement on EP4 and a battery Power Source on the root endpoint EP0.

  • fingerprints.yml: 4673/32784 -> thingsone-presence-sensor.
  • Profile thingsone-presence-sensor: the capabilities of presence-illuminance-temperature-humidity-battery plus two device settings. It is a separate profile because the stock one is shared with the Aqara FP300.
  • The base driver still handles occupancy and every measurement. The sub-driver, selected through vendor_overrides like aqara_fp400, only:
    • keeps the device on its profile on doConfigure and driverSwitched, so match_profile does not replace it;
    • writes the sensitivity preference to OccupancySensing.PIRUnoccupiedToOccupiedThreshold on EP1, which the firmware uses as its operation mode (1 low power, 2 normal, 3 high power), and the presence hold time preference to OccupancySensing.HoldTime as 10 s plus the setting: the device as shipped clears occupancy 10 s after the last detection (HoldTime 10), and the setting keeps presence that much longer (device HoldTimeLimits 1..300, so the setting's default 0 matches the device as shipped and the setting is capped at 290 s). A setting is written only when the user changes it, then read back; a write that did not take is retried up to three times. Values written by other controllers are left alone, so multi-admin setups do not fight over the attribute;
    • re-reads temperature or humidity when tempOffset or humidityOffset changes, because the device samples them every 600 s and reports only a change beyond 1 °C or 5 %RH.
  • HoldTime handling is skipped on hub libraries that do not define the attribute.

Preferences: stse.presenceHoldTime ("Presence hold time", 0, 5, 10, 15, 30 or 60 s, default 0) was agreed with SmartThings on 2026-10-15 for this device; the driver reads its option keys as seconds ("0" to "60"), and the definition did not resolve through the API yet on that day, so please let us know once it is created; the sensitivity uses the existing stse.sensitivity (1 Low, 2 Mid, 3 High, default 2), which matches the firmware's modes.

Summary of Completed Tests

  • New src/test/test_matter_thingsone_presence_sensor.lua: 17/17 - profile kept on doConfigure and driverSwitched, re-subscription on a profile change, occupancy through the base handler, offset re-reads from the first change, sensitivity writes and HoldTime written as 10 s plus the presence hold time, with read-back, clamping, no write when the clamped value is unchanged (the default 0 included), retry limit and give-up, values from other controllers left alone.
  • All matter-sensor tests: 105/105 locally (lua_libs api 21). luacheck with .github/workflows/.luacheckrc: 0 warnings / 0 errors. validate_fingerprints.py, check_profile_categories.py and check_duplicates.py: pass.
  • Device test plan, once stse.presenceHoldTime exists: on a device through a development channel, onboarding to thingsone-presence-sensor, the subscription, presence hold time 60 s written to HoldTime as 70 with presence cleared about 70 s after the last detection, the sensitivity written, and a value written with chip-tool left alone. Results will be added to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant