From 168b7231fc66478d5b1779eb9c0cd1fb73316b29 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sun, 12 Jan 2025 11:58:51 +0900 Subject: [PATCH] Add support for C30W gas leak detector Issue #2676 --- ACKNOWLEDGEMENTS.md | 2 +- DEVICES.md | 1 + .../tuya_local/devices/c30w_gassensor.yaml | 113 ++++++++++++++++++ 3 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 custom_components/tuya_local/devices/c30w_gassensor.yaml diff --git a/ACKNOWLEDGEMENTS.md b/ACKNOWLEDGEMENTS.md index 6245a0bba8..320cf84cf7 100644 --- a/ACKNOWLEDGEMENTS.md +++ b/ACKNOWLEDGEMENTS.md @@ -806,4 +806,4 @@ Further device support has been made with the assistance of users. Please consid - [luisolavea](https://github.com/luisolavea) for assisting with support for Zemismart ZMAi-90 energy meter smart switch. - [City-Zero](https://github.com/City-Zero) for contributing support for airx H8 humidifier. - [rackxp](https://github.com/rackxp) for assisting with support for Brilliant Smart twin flood lights with motion detection. - +- [toxacj](https://github.com/toxacj) for assisting with support for C30W gas leak detector. diff --git a/DEVICES.md b/DEVICES.md index d1a3b9c417..b3feee4c6f 100644 --- a/DEVICES.md +++ b/DEVICES.md @@ -884,6 +884,7 @@ port and password. - Bresser Smart 7-in-1 weather station - Bresser Smart Thermo-hygrometer - CO2-Box air quality monitor +- C30W gas leak detector - CT20W PIR motion detector - EM3390TF weather station (tested with Viflykoo branded device, probably identical to the same model number branded as Uzoli, Jely and others) - Emax EM3378 Weather Station (selling as Hiper P1 and other rebrands) diff --git a/custom_components/tuya_local/devices/c30w_gassensor.yaml b/custom_components/tuya_local/devices/c30w_gassensor.yaml new file mode 100644 index 0000000000..1e8c83331e --- /dev/null +++ b/custom_components/tuya_local/devices/c30w_gassensor.yaml @@ -0,0 +1,113 @@ +name: Gas leak detector +products: + - id: 4iqe2hsfyd86kwwc + model: C30W +entities: + - entity: binary_sensor + class: gas + dps: + - id: 2 + type: string + name: sensor + mapping: + - dps_val: alarm + value: true + - value: false + - id: 1 + type: string + name: checking_result + - entity: number + name: Alarm duration + class: duration + category: config + dps: + - id: 3 + type: integer + name: value + unit: s + range: + min: 0 + max: 3600 + - entity: sensor + name: Gas level + class: volatile_organic_compounds_parts + dps: + - id: 5 + type: integer + name: sensor + unit: ppm + class: measurement + - entity: button + name: Self test + category: config + dps: + - id: 9 + type: boolean + name: button + - entity: binary_sensor + class: problem + category: diagnostic + dps: + - id: 9 + type: boolean + name: sensor + - entity: switch + name: Alarm + icon: "mdi:bullhorn" + category: config + dps: + - id: 14 + type: boolean + name: switch + - entity: number + name: Gas alarm threshold + category: config + class: volatile_organic_compounds_parts + dps: + - id: 101 + type: integer + name: value + unit: ppm + range: + min: 10 + max: 100 + - entity: sensor + class: temperature + dps: + - id: 102 + type: integer + name: sensor + unit: C + class: measurement + - entity: number + name: Temperature alarm threshold + category: config + class: temperature + dps: + - id: 103 + type: integer + name: value + unit: C + range: + min: -40 + max: 300 + - entity: switch + name: Temperature alarm + icon: "mdi:bullhorn" + category: config + dps: + - id: 104 + type: string + name: switch + mapping: + - dps_val: upperalarm + value: true + - dps_val: cancel + value: false + - entity: light + translation_key: backlight + category: config + dps: + - id: 105 + type: boolean + name: switch