Ver código fonte

Add support for DTS238-7 smart meter

Issue #745
Jason Rumney 2 anos atrás
pai
commit
7c73e12f10

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -280,3 +280,4 @@ Further device support has been made with the assistance of users.  Please consi
 - [xgustavoh](https://github.com/xgustavoh) for contributing support for NovaDigital 4-way switches, and single switch which was merged with the Somgom switch.
 - [xgustavoh](https://github.com/xgustavoh) for contributing support for NovaDigital 4-way switches, and single switch which was merged with the Somgom switch.
 - [cramer52](https://github.com/cramer52) for contributing support for Galaxy Projectors.
 - [cramer52](https://github.com/cramer52) for contributing support for Galaxy Projectors.
 - [kajapa](https://github.com/kajapa) for contributing support for Proscenic A8 air purifiers.
 - [kajapa](https://github.com/kajapa) for contributing support for Proscenic A8 air purifiers.
+- [Pagi13](https://github.com/Pagi13) for assisting with support for DTS238-7 smart meters.

+ 1 - 0
DEVICES.md

@@ -202,6 +202,7 @@
 
 
 - CBI Astute smart controller breaker switch
 - CBI Astute smart controller breaker switch
 - Compteur digital electric (single phase)
 - Compteur digital electric (single phase)
+- DTS238-7 3 phase smart meter
 - eMylo EAI-90 smart meter
 - eMylo EAI-90 smart meter
 - PC311-TY 2 phase power clamp meter
 - PC311-TY 2 phase power clamp meter
 - PC321-TY 3 phase power clamp meter
 - PC321-TY 3 phase power clamp meter

+ 119 - 0
custom_components/tuya_local/devices/dts238_7_energy_meter.yaml

@@ -0,0 +1,119 @@
+name: Energy meter
+products:
+  - id: 1rlikmowi2erb6qw
+    name: DTS238-7
+primary_entity:
+  entity: sensor
+  name: Total energy
+  class: energy
+  dps:
+    - id: 1
+      type: integer
+      name: sensor
+      unit: kWh
+      class: measurement
+      mapping:
+        - scale: 100
+    - id: 6
+      type: base64
+      name: phase_a
+      optional: true
+    - id: 7
+      type: base64
+      name: phase_b
+      optional: true
+    - id: 8
+      type: base64
+      name: phase_c
+      optional: true
+    - id: 10
+      type: bitfield
+      name: fault_code
+      optional: true
+      # ov_cr, unbalance_alarm, ov_vol, undervoltage_alarm, miss_phase_alarm, outage_alarm, magnetism_alarm, terminal_alarm, cover_alarm, credit_alarm, no_balance_alarm, battery_alarm, meter_hardware_alarm
+    - id: 17
+      name: alarm_set
+      type: string
+      optional: true
+    - id: 18
+      name: meter_id
+      type: string
+secondary_entities:
+  - entity: sensor
+    name: Total power
+    class: power
+    category: diagnostic
+    dps:
+      - id: 9
+        type: integer
+        name: sensor
+        unit: kW
+        class: measurement
+        scale: 10000
+  - entity: binary_sensor
+    name: Fault
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 10
+        type: bitfield
+        name: sensor
+        optional: true
+        mapping:
+          - dps_val: 0
+            value: false
+          - dps_val: null
+            value: false
+          - value: true
+  - entity: switch
+    name: Prepay
+    category: config
+    icon: "mdi:cash"
+    dps:
+      - id: 12
+        type: boolean
+        name: switch
+  - entity: sensor
+    name: Energy balance
+    category: diagnostic
+    dps:
+      - id: 13
+        type: integer
+        name: sensor
+        unit: kWh
+        class: measurement
+        mapping:
+          - scale: 100
+  - entity: button
+    name: Reset energy
+    category: config
+    class: restart
+    dps:
+      - id: 14
+        type: boolean
+        name: button
+        optional: true
+  - entity: number
+    name: Charge energy
+    category: config
+    icon: "mdi:cash"
+    dps:
+      - id: 15
+        type: integer
+        name: value
+        unit: kWh
+        optional: true
+        range:
+          min: 0
+          max: 5000
+  - entity: switch
+    name: Breaker
+    icon: "mdi:fuse"
+    category: config
+    dps:
+      - id: 16
+        type: boolean
+        name: switch
+
+
+