From 5d9814ac6cacbce4830bbaeed4e16969c49e9435 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sun, 12 Jan 2025 18:12:00 +0900 Subject: [PATCH] Add support for Treatlife mmWave human presence sensor Issue #2684 --- ACKNOWLEDGEMENTS.md | 2 +- DEVICES.md | 1 + .../devices/treatlife_psw_presencesensor.yaml | 86 +++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 custom_components/tuya_local/devices/treatlife_psw_presencesensor.yaml diff --git a/ACKNOWLEDGEMENTS.md b/ACKNOWLEDGEMENTS.md index 910b38b069..c4bf659d80 100644 --- a/ACKNOWLEDGEMENTS.md +++ b/ACKNOWLEDGEMENTS.md @@ -431,7 +431,7 @@ Further device support has been made with the assistance of users. Please consid - [evanfoster](https://github.com/evanfoster) for contributing support for Vivosun DE0003 dehumidifiers. - [sayaivan](https://github.com/sayaivan) for contributing Indonesian translations. - [mhackdo18](https://github.com/mhackdo18) for assisting with support for YP Pet feeder. -- [magomao](https://github.com/magomao) for assisting with support for Vivion air conditioners. +- [magomao](https://github.com/magomao) for assisting with support for Vivion air conditioner and Treatlife human presence sensor. - [palkoarpad85](https://github.com/palkoarpad85) for assisting with support for Klarstein Wonderwall heaters. - [MJW911](https://github.com/MJW911) for assisting with support for SX1 smartplugs. - [ops244](https://github.com/ops244) for assisting with support for Hiper T3 bladeless fans, TTEC Robi Pro vacuums, M515 curtain motors, Haier Nayun gas alarms. diff --git a/DEVICES.md b/DEVICES.md index 070e5fe2b1..f52b2bd1f3 100644 --- a/DEVICES.md +++ b/DEVICES.md @@ -924,6 +924,7 @@ port and password. - Timeguard WFPIR motion light controller - Tontine electric blanket - TOPENS TC196 remote control for gate openers +- Treatlife 24GHz mmWave human presence sensor - Valehaus SYZN119 towel warmer - Weaja WJ-TUYA-S9 gas alarm - WeatherStation Pro diff --git a/custom_components/tuya_local/devices/treatlife_psw_presencesensor.yaml b/custom_components/tuya_local/devices/treatlife_psw_presencesensor.yaml new file mode 100644 index 0000000000..9f4afd9024 --- /dev/null +++ b/custom_components/tuya_local/devices/treatlife_psw_presencesensor.yaml @@ -0,0 +1,86 @@ +name: Human presence sensor +products: + - id: s6hviigqjdrymvj3 + manufacturer: Treatlife + model: PS-W +entities: + - entity: binary_sensor + class: occupancy + dps: + - id: 1 + type: string + name: sensor + mapping: + - dps_val: presence + value: true + - value: false + - entity: number + name: Motion sensitivity + category: config + icon: "mdi:motion-sensor" + dps: + - id: 2 + type: integer + name: value + range: + min: 1 + max: 5 + - entity: number + name: Maximum distance + class: distance + category: config + icon: "mdi:signal-distance-variant" + dps: + - id: 4 + type: integer + name: value + unit: cm + range: + min: 75 + max: 600 + mapping: + - step: 75 + - entity: sensor + class: distance + category: diagnostic + dps: + - id: 9 + type: integer + name: sensor + unit: cm + class: measurement + - entity: sensor + class: illuminance + dps: + - id: 101 + type: integer + name: sensor + unit: lx + class: measurement + - entity: number + name: Still sensitivity + category: config + icon: "mdi:account-clock" + dps: + - id: 102 + type: integer + name: value + range: + min: 1 + max: 5 + - entity: sensor + class: duration + category: diagnostic + dps: + - id: 104 + type: integer + name: sensor + unit: min + class: measurement + - entity: light + translation_key: indicator + category: config + dps: + - id: 105 + type: boolean + name: switch