Просмотр исходного кода

Add support for Denver SHP-200mk2 dual smartplug

Another variant of dual smartplug, does not quite match the existing
ones.

Issue #3324
Jason Rumney 8 месяцев назад
Родитель
Сommit
2106117534

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -945,3 +945,4 @@ Further device support has been made with the assistance of users. Please consid
 - [dwd1](https://github.com/dwd1) for assisting with support for RH-PD10 peehole doorbell camera.
 - [thd6n75](https://github.com/thd6n75) for contributing support for Korex AX-WF306N kettle.
 - [1B9-MasterChief](https://github.com/1B9-MasterChief) for contributing support for Sonnenkönig Fresco 140/180 air conditioner.
+- [fribse](https://github.com/fribse) for assisting with support for Denver SHP-200mk2 dual smartplug.

+ 1 - 0
DEVICES.md

@@ -525,6 +525,7 @@ the best option.
 - Brilliant quad powerstrip with USB
 - CBI Astute smart controller
 - CE Smart Home LQ-2-W3 AC wall outlet
+- Denver SHP-200mk2 dual smartplug with power monitoring
 - DIGOO DG-SP202 dual smartplug with energy monitoring and timers
 - DIGOO DG-SP01 USB smartplug with night light
 - Dual power monitoring smartplug (Geex)

+ 157 - 0
custom_components/tuya_local/devices/denver_shp200mk2_dualsmartplug.yaml

@@ -0,0 +1,157 @@
+name: Dual smartplug
+products:
+  - id: hhmfhqctaquluc7t
+    manufacturer: Denver
+    model: SHP-200mk2
+entities:
+  - entity: switch
+    translation_key: outlet_x
+    translation_placeholders:
+      x: "1"
+    class: outlet
+    dps:
+      - id: 1
+        type: boolean
+        name: switch
+      - id: 17
+        type: integer
+        name: add_ele
+        optional: true
+      - id: 21
+        type: bitfield
+        name: factory_test
+        optional: true
+      - id: 25
+        type: integer
+        name: ele_calibration
+        optional: true
+      - id: 41
+        type: string
+        name: schedule
+        optional: true
+      - id: 42
+        type: string
+        optional: true
+        name: random_schedule
+  - entity: switch
+    translation_key: outlet_x
+    translation_placeholders:
+      x: "2"
+    class: outlet
+    dps:
+      - id: 2
+        type: boolean
+        name: switch
+  - entity: number
+    category: config
+    translation_key: timer_x
+    translation_placeholders:
+      x: "1"
+    class: duration
+    dps:
+      - id: 9
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: number
+    category: config
+    translation_key: timer_x
+    translation_placeholders:
+      x: "2"
+    class: duration
+    dps:
+      - id: 10
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: sensor
+    class: current
+    category: diagnostic
+    dps:
+      - id: 18
+        type: integer
+        name: sensor
+        unit: mA
+        class: measurement
+      - id: 23
+        type: integer
+        name: calibration
+        optional: true
+  - entity: sensor
+    class: power
+    category: diagnostic
+    dps:
+      - id: 19
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+        mapping:
+          - scale: 10
+      - id: 24
+        type: integer
+        name: calibration
+        optional: true
+  - entity: sensor
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 20
+        type: integer
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 10
+      - id: 22
+        type: integer
+        name: calibration
+        optional: true
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 26
+        type: bitfield
+        name: sensor
+        optional: true
+        persist: false
+        mapping:
+          - dps_val: null
+            value: false
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 26
+        type: bitfield
+        name: fault_code
+        optional: true
+  - entity: select
+    translation_key: initial_state
+    category: config
+    dps:
+      - id: 38
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: "on"
+            value: "on"
+          - dps_val: "off"
+            value: "off"
+          - dps_val: memory
+            value: memory
+          - dps_val: null
+            invalid: true