Explorar o código

Add support for Zemismart ZMAi-90 smart switch with energy monitor.

Uses a standard smartplug layout, but from the log submitted, the
add_ele dp seems to be acting like a total_forward_energy so it can be
used as a proper meter.

Missing timers, calibration or any extra config options, just the
switch and sensors for energy, current, power, voltage and a fault code.

Issue #2651
Jason Rumney hai 1 ano
pai
achega
566ba23751

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -803,3 +803,4 @@ Further device support has been made with the assistance of users. Please consid
 - [vytux-com](https://github.com/vytux-com) for contributing support for 3A Nue 3 speed fan and light controller.
 - [vytux-com](https://github.com/vytux-com) for contributing support for 3A Nue 3 speed fan and light controller.
 - [nicolas-sora](https://github.com/nicolas-sora) for assisting with support for Wasserstein AquaPal water monitor.
 - [nicolas-sora](https://github.com/nicolas-sora) for assisting with support for Wasserstein AquaPal water monitor.
 - [theqz](https://github.com/theqz) for assisting with support for A03 siren.
 - [theqz](https://github.com/theqz) for assisting with support for A03 siren.
+- [luisolavea](https://github.com/luisolavea) for assisting with support for Zemismart ZMAi-90 energy meter smart switch.

+ 1 - 0
DEVICES.md

@@ -475,6 +475,7 @@
 - Xoca DAC2121C BI energy meter
 - Xoca DAC2121C BI energy meter
 - Yagusmart 3PN 63A 3-phase multi-tariff energy meter
 - Yagusmart 3PN 63A 3-phase multi-tariff energy meter
 - Zemismart SDM01-TW0-12-ZM 3-phase bidirectional energy meter
 - Zemismart SDM01-TW0-12-ZM 3-phase bidirectional energy meter
+- Zemismart ZMAi-90 smart switch energy meter
 - ZM-Wi-Fi smart meter
 - ZM-Wi-Fi smart meter
 
 
 ### Battery Charger
 ### Battery Charger

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

@@ -0,0 +1,76 @@
+name: Energy meter
+products:
+  - id: a6djabzmpbbp62gw
+    manufacturer: Zemismart
+    model: ZMAi-90
+entities:
+  - entity: switch
+    class: switch
+    category: config
+    dps:
+      - id: 1
+        type: boolean
+        name: switch
+  - entity: sensor
+    class: energy
+    category: diagnostic
+    dps:
+      - id: 17
+        type: integer
+        name: sensor
+        unit: kWh
+        class: total_increasing
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    class: current
+    category: diagnostic
+    dps:
+      - id: 18
+        type: integer
+        name: sensor
+        unit: A
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    class: power
+    category: diagnostic
+    dps:
+      - id: 19
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 20
+        type: integer
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 26
+        type: bitfield
+        optional: true
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - dps_val: null
+            value: false
+          - value: true
+      - id: 26
+        type: bitfield
+        optional: true
+        name: fault_code
+