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

WDYK 2p63 meter: add dps above 101 mark some optional

Original report #659 only had the "standard" dps documented, from the
old API Explorer function.  Issue #1078 gives the full documentation for
what seems to be the same device (photos look the same apart from branding,
dps list seems compatible).

Differences in logs: #1078 device is missing dp 1, but has dp 16.  Making dp 1
optional solves that, and adding the additional 101-106 dps per the #1078
documentation, and 115 and 116 as optional (since neither device reports them)
along with dp 12 (also not reported, and like 115 probably send only).
Jason Rumney 2 лет назад
Родитель
Сommit
f95408b95f
1 измененных файлов с 87 добавлено и 0 удалено
  1. 87 0
      custom_components/tuya_local/devices/wdyk_2p63a_energy_meter.yaml

+ 87 - 0
custom_components/tuya_local/devices/wdyk_2p63a_energy_meter.yaml

@@ -11,6 +11,7 @@ primary_entity:
       name: sensor
       unit: kWh
       class: total_increasing
+      optional: true
       mapping:
         - scale: 100
     - id: 6
@@ -34,6 +35,10 @@ primary_entity:
     - id: 19
       type: string
       name: breaker_number
+    - id: 116
+      type: string
+      name: card_id
+      optional: true
 secondary_entities:
   - entity: binary_sensor
     name: Short circuit
@@ -407,3 +412,85 @@ secondary_entities:
         mapping:
           - mask: "000000000000FFFFFF0000"
             scale: 1000
+  - entity: number
+    name: Overvoltage threshold
+    category: config
+    icon: "mdi:flash-alert"
+    dps:
+      - id: 101
+        type: integer
+        name: value
+        unit: V
+        range:
+          min: 230
+          max: 300
+  - entity: number
+    name: Undervoltage threshold
+    category: config
+    icon: "mdi:flash-alert"
+    dps:
+      - id: 102
+        type: integer
+        name: value
+        unit: V
+        range:
+          min: 90
+          max: 210
+  - entity: number
+    name: Overcurrent alert
+    category: config
+    icon: "mdi:fuse-alert"
+    dps:
+      - id: 103
+        type: integer
+        name: value
+        unit: A
+        range:
+          min: 1
+          max: 63
+  - entity: number
+    name: Leakage current
+    category: config
+    icon: "mdi:"
+    dps:
+      - id: 104
+        type: integer
+        name: value
+        unit: mA
+        range:
+          min: 10
+          max: 100
+  - entity: switch
+    name: Mute alarm
+    icon: "mdi:volume-mute"
+    category: config
+    dps:
+      - id: 105
+        type: boolean
+        name: switch
+  - entity: binary_sensor
+    name: Earth leak
+    class: safety
+    category: diagnostic
+    dps:
+      - id: 106
+        type: boolean
+        name: sensor
+  - entity: button
+    name: Reset total energy
+    class: restart
+    category: config
+    dps:
+      - id: 115
+        type: boolean
+        name: button
+        optional: true
+  - entity: button
+    name: Reset balance energy
+    class: restart
+    category: config
+    dps:
+      - id: 12
+        type: boolean
+        name: button
+        optional: true