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

Add support for a 4-way power monitoring powerstrip.

Issue #457

Although the reported issue is for a 3-way + USB device, the dp layout
follows the standard layout for a 4-way (USB is dp 4, not 7 as is
often assigned to USB).  Timer and power monitoring layout is also
consistent with the standard most multi-switch devices seem to follow,
so this makes a better generic 4-way than the existing
"energy_monitoring_powerstrip" config, which uses non-standard dp ids
for the power monitoring, and does not support timers.
Jason Rumney 3 лет назад
Родитель
Сommit
c22f5b6aaa
3 измененных файлов с 148 добавлено и 2 удалено
  1. 1 0
      ACKNOWLEDGEMENTS.md
  2. 2 2
      DEVICES.md
  3. 145 0
      custom_components/tuya_local/devices/quad_powerstrip.yaml

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -196,3 +196,4 @@ Further device support has been made with the assistance of users.  Please consi
 - [fischrobi](https://github.com/fischrobi) for assisting with support for Blitzwolf BW-SH2 humidifiers.
 - [elninosi](https://github.com/elninosi) for assisting with support for LoraTap curtain switches.
 - [mrulke](https://github.com/mrulke) for assisting with support for CCB-11 blind controllers.
+- [Codeazure](https://github.com/Codeazure) for assisting with support for 4-way power monitoring powerstrips (via Kogan 3-way + USB powerstrip).

+ 2 - 2
DEVICES.md

@@ -1,6 +1,5 @@
 # Supported devices
 
-
 ### Heaters
 
 - Andersson GSH heater
@@ -208,7 +207,8 @@
 Other brands may work with the above configurations, or the below are
 generic configurations known to work with multiple brands of device.
 
-- 4 way power monitoring strip
+- 4 way power monitoring strip (2 types)
+  _confirmed as working with Kogan KASPS10A3P3UA 3 socket + USB powerstrip
 - 4 way powerstrip with USB
   _confirmed as working with AOFO ZLD-44EU-W_
 - Generic smartplug with energy monitoring (older models)

+ 145 - 0
custom_components/tuya_local/devices/quad_powerstrip.yaml

@@ -0,0 +1,145 @@
+name: Quad powerstrip
+products:
+  - id: l5gnaxuawkjfquqo
+    name: Kogan KASPS10A3P3UA 3+USB
+primary_entity:
+  entity: switch
+  name: Outlet 1
+  class: outlet
+  dps:
+    - id: 1
+      type: boolean
+      name: switch
+    - id: 17
+      type: integer
+      name: add_ele
+      optional: true
+    - id: 25
+      type: integer
+      name: ele_calibration
+      optional: true
+secondary_entities:
+  - entity: switch
+    name: Outlet 2
+    dps:
+      - id: 2
+        type: boolean
+        name: switch
+  - entity: switch
+    name: Outlet 3
+    dps:
+      - id: 3
+        type: boolean
+        name: switch
+  - entity: switch
+    name: Outlet 4
+    dps:
+      - id: 4
+        type: boolean
+        name: switch
+  - entity: number
+    name: 9
+    category: config
+    icon: "mdi:timer"
+    dps:
+      - id: Timer 1
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: number
+    name: 10
+    category: config
+    icon: "mdi:timer"
+    dps:
+      - id: Timer 2
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: number
+    name: 11
+    category: config
+    icon: "mdi:timer"
+    dps:
+      - id: Timer 3
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: number
+    name: 12
+    category: config
+    icon: "mdi:timer"
+    dps:
+      - id: Timer 4
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: sensor
+    category: diagnostic
+    class: current
+    name: Current
+    dps:
+      - id: 18
+        name: sensor
+        type: integer
+        class: measurement
+        unit: mA
+      - id: 23
+        type: integer
+        name: calibration
+        optional: true
+  - entity: sensor
+    category: diagnostic
+    class: power
+    name: Power
+    dps:
+      - id: 19
+        name: sensor
+        type: integer
+        class: measurement
+        unit: W
+        mapping:
+          - scale: 10
+      - id: 24
+        type: integer
+        name: calibration
+        optional: true
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    name: Voltage
+    dps:
+      - id: 20
+        name: sensor
+        type: integer
+        class: measurement
+        unit: V
+        mapping:
+          - scale: 10
+      - id: 22
+        type: integer
+        name: calibration
+        optional: true