Explorar el Código

Add support for PJ-1103 power clamp meter.

Issue #336, and some assumptions on scales based on other similar devices.
Jason Rumney hace 3 años
padre
commit
840066683d

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -153,3 +153,4 @@ Further device support has been made with the assistance of users.  Please consi
 - [escoand](https://github.com/escoand) for contributing support for Tellur USB power strip.
 - [BrettEBowman](https://github.com/BrettEBowman) for assistance supporting Treatlife DS02-F fans.
 - [sohail579](https://github.com/sohail579) for assistance supporting Inventor Eva Ion Pro dehumidifiers.
+- [MoosJ80](https://github.com/MoosJ80) for assistance supporting PJ-1103 clamp power meters.

+ 1 - 0
DEVICES.md

@@ -149,6 +149,7 @@
 
 - Compteur digital electric (single phase)
 - PC321-TY 3 phase power clamp meter
+- PJ-1103 power clamp meter
 - SmartMCB SMT006 energy meter
 
 ### Battery Charger

+ 59 - 0
custom_components/tuya_local/devices/pj1103_clamp_meter.yaml

@@ -0,0 +1,59 @@
+name: PJ-1103 clamp power meter
+primary_entity:
+  entity: sensor
+  name: Power
+  class: power
+  dps:
+    - id: 19
+      name: sensor
+      type: integer
+      unit: W
+      class: measurement
+    - id: 52
+      name: maximum
+      type: integer
+    - id: 21
+      type: bitfield
+      name: test
+secondary_entities:
+  - entity: sensor
+    name: Current
+    class: current
+    category: diagnostic
+    dps:
+      - id: 18
+        type: integer
+        name: sensor
+        unit: mA
+        class: measurement
+  - entity: sensor
+    name: Voltage
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 20
+        type: integer
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 10
+      - id: 22
+        type: integer
+        name: calibration
+  - entity: number
+    name: Maximum Standby Power
+    category: config
+    dps:
+      - id: 51
+        type: integer
+        name: value
+        unit: W
+        range:
+          min: 0
+          max: 100
+        mapping:
+          - scale: 10
+
+
+