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

feat(simple_multi_switch): add optional sensors

- compatible Nine&One power strip (3 socket+USB) also has add_ele (not logged),
  current, power, voltage sensors on standard dps. Since no other config covers
  them already, it should be OK to add them here, as this config is for standard
  Tuya dps layout devices and there is no conflict with known devices that use it.

Issue #6121
Jason Rumney 2 месяцев назад
Родитель
Сommit
70b0151b14
1 измененных файлов с 76 добавлено и 0 удалено
  1. 76 0
      custom_components/tuya_local/devices/simple_multi_switch.yaml

+ 76 - 0
custom_components/tuya_local/devices/simple_multi_switch.yaml

@@ -3,6 +3,9 @@ products:
   - id: iHRCXog1Au8bh7XG
     manufacturer: eMylo
     model: US-08e3 2 gang+USB wall outlet
+  - id: higlgjzngsrapyev
+    manufacturer: "Nine&One"
+    model: HYS-02-017
 entities:
   - entity: switch
     translation_key: switch_x
@@ -138,3 +141,76 @@ entities:
           - dps_val: null
             value: false
           - value: true
+  - entity: sensor
+    name: Add electricity
+    category: diagnostic
+    hidden: true
+    dps:
+      - id: 17
+        type: integer
+        optional: true
+        name: sensor
+        unit: kWh
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    class: current
+    hidden: unavailable
+    dps:
+      - id: 18
+        type: integer
+        optional: true
+        name: sensor
+        unit: A
+        class: measurement
+        mapping:
+          - scale: 1000
+      - id: 18
+        type: integer
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
+  - entity: sensor
+    class: power
+    hidden: unavailable
+    dps:
+      - id: 19
+        type: integer
+        optional: true
+        name: sensor
+        unit: W
+        class: measurement
+        mapping:
+          - scale: 10
+      - id: 19
+        type: integer
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
+  - entity: sensor
+    class: voltage
+    hidden: unavailable
+    dps:
+      - id: 20
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 10
+      - id: 20
+        type: integer
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true