Kaynağa Gözat

PC321-TY: swap Owon model from zigbee to Wifi config.

Based on PR #2898 for same product id, the addition of product id
should have been to the WiFi model rather than the Zigbee one.

Add energy production sensor (total_reverse_energy in Tuya) for models
that support bidirectional monitoring.
Jason Rumney 1 yıl önce
ebeveyn
işleme
f877012e89

+ 24 - 0
custom_components/tuya_local/devices/pc321ty_energy_meter.yaml

@@ -4,6 +4,9 @@ products:
     model: PC321-TY
   - id: 9rjjf6rdkca9woju
     model: PC321-TY 80A
+  - id: gqmmtjclqb7reg5p
+    manufacturer: Owon
+    model: PCT321-W-TY 80A
 entities:
   - entity: sensor
     class: energy
@@ -15,6 +18,27 @@ entities:
           - scale: 100
         unit: kWh
         class: total_increasing
+  - entity: sensor
+    translation_key: energy_produced
+    class: energy
+    hidden: unavailable
+    dps:
+      - id: 139
+        type: integer
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
+      - id: 139
+        type: integer
+        optional: true
+        name: sensor
+        unit: kWh
+        class: total_increasing
+        mapping:
+          - scale: 100
   - entity: sensor
     category: diagnostic
     translation_key: voltage_x

+ 0 - 3
custom_components/tuya_local/devices/pc321zty_energy_meter.yaml

@@ -2,9 +2,6 @@ name: Power clamp meter
 products:
   - id: nslr42tt
     model: PC321-Z-TY
-  - id: gqmmtjclqb7reg5p
-    manufacturer: Owon
-    model: PCT321-W-TY 80A
 entities:
   - entity: sensor
     class: energy