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

Add wmdl 2c dual channel meter (#4789)

* Add WMDL-2C device

* add more indicators

* Adding class to dps

* Adding more sensors

* remove invalid dps

* add more sensors

* fix identation

* fixing test error with force parameter

* apply many changes from comments

* Applying additional changes

* optional field

* merge with main

* fixing invalid field

* capitalize only first word on entity name

Co-authored-by: Copilot <copilot@github.com>

* change translation keys

Co-authored-by: Copilot <copilot@github.com>

* emove precision parameter

* feat (wmdl_2c_dualchannelmeter): changes before merge

- filename: follow brand_model_type naming convention
- remove unnecessary precision and default attributes
- rename "Current state ..." to "Activity ..."

PR #4789

---------

Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
Mario Medina 2 месяцев назад
Родитель
Сommit
4eb0e4a474
1 измененных файлов с 239 добавлено и 0 удалено
  1. 239 0
      custom_components/tuya_local/devices/wmdl_2c_dualchannelmeter.yaml

+ 239 - 0
custom_components/tuya_local/devices/wmdl_2c_dualchannelmeter.yaml

@@ -0,0 +1,239 @@
+name: Dual channel energy meter
+products:
+  - id: zcmq0kvd01bn6s1n
+    manufacturer: WMDL
+    model: WMDL-2C
+entities:
+  - entity: sensor
+    translation_key: power_x
+    translation_placeholders:
+      x: A
+    class: power
+    dps:
+      - id: 19
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+        force: true
+        mapping:
+          - scale: 10
+  - entity: sensor
+    translation_key: voltage_x
+    translation_placeholders:
+      x: A
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 20
+        type: integer
+        name: sensor
+        unit: V
+        class: measurement
+        force: true
+        mapping:
+          - scale: 10
+  - entity: sensor
+    translation_key: current_x
+    translation_placeholders:
+      x: A
+    class: current
+    category: diagnostic
+    dps:
+      - id: 18
+        type: integer
+        name: sensor
+        unit: A
+        class: measurement
+        force: true
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    translation_key: power_x
+    translation_placeholders:
+      x: B
+    class: power
+    dps:
+      - id: 113
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+        force: true
+        mapping:
+          - scale: 10
+  - entity: sensor
+    translation_key: voltage_x
+    translation_placeholders:
+      x: B
+    class: voltage
+    category: diagnostic
+    hidden: true
+    dps:
+      - id: 114
+        type: integer
+        name: sensor
+        unit: V
+        class: measurement
+        force: true
+        mapping:
+          - scale: 10
+  - entity: sensor
+    translation_key: current_x
+    translation_placeholders:
+      x: B
+    class: current
+    category: diagnostic
+    dps:
+      - id: 112
+        type: integer
+        name: sensor
+        unit: A
+        class: measurement
+        force: true
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    translation_key: energy_consumed
+    class: energy
+    icon: mdi:transmission-tower-import
+    dps:
+      - id: 119
+        type: integer
+        name: sensor
+        unit: kWh
+        class: total_increasing
+        mapping:
+          - scale: 100
+  - entity: sensor
+    translation_key: energy_produced
+    class: energy
+    icon: mdi:transmission-tower-export
+    dps:
+      - id: 121
+        type: integer
+        name: sensor
+        unit: kWh
+        class: total_increasing
+        mapping:
+          - scale: 100
+  - entity: number
+    name: Power limit A
+    category: config
+    class: power
+    dps:
+      - id: 107
+        type: integer
+        name: value
+        unit: W
+        range:
+          min: 0
+          max: 150000
+        mapping:
+          - step: 100
+  - entity: number
+    name: Power limit B
+    category: config
+    class: power
+    dps:
+      - id: 110
+        type: integer
+        name: value
+        unit: W
+        range:
+          min: 0
+          max: 150000
+        mapping:
+          - step: 100
+  - entity: sensor
+    translation_key: energy_consumed_x
+    translation_placeholders:
+      x: A
+    class: energy
+    icon: mdi:transmission-tower-import
+    dps:
+      - id: 17
+        type: integer
+        name: sensor
+        unit: kWh
+        class: total_increasing
+        mapping:
+          - scale: 100
+  - entity: sensor
+    translation_key: energy_produced_x
+    translation_placeholders:
+      x: A
+    class: energy
+    icon: mdi:transmission-tower-export
+    dps:
+      - id: 115
+        type: integer
+        name: sensor
+        unit: kWh
+        class: total_increasing
+        mapping:
+          - scale: 100
+  - entity: sensor
+    translation_key: energy_consumed_x
+    translation_placeholders:
+      x: B
+    class: energy
+    icon: mdi:transmission-tower-import
+    dps:
+      - id: 111
+        type: integer
+        name: sensor
+        unit: kWh
+        class: total_increasing
+        mapping:
+          - scale: 100
+  - entity: sensor
+    translation_key: energy_produced_x
+    translation_placeholders:
+      x: B
+    class: energy
+    icon: mdi:transmission-tower-export
+    dps:
+      - id: 117
+        type: integer
+        name: sensor
+        unit: kWh
+        class: total_increasing
+        mapping:
+          - scale: 100
+  - entity: sensor
+    name: Activity A
+    class: enum
+    icon: mdi:swap-horizontal
+    dps:
+      - id: 105
+        type: string
+        name: sensor
+        mapping:
+          - dps_val: work_p
+            value: importing
+          - dps_val: work_n
+            value: exporting
+          - dps_val: close
+            value: idle
+          - dps_val: produce
+            value: producing
+          - value: unknown
+  - entity: sensor
+    name: Activity B
+    class: enum
+    icon: mdi:swap-horizontal
+    dps:
+      - id: 108
+        type: string
+        name: sensor
+        mapping:
+          - dps_val: work_p
+            value: importing
+          - dps_val: work_n
+            value: exporting
+          - dps_val: close
+            value: idle
+          - dps_val: produce
+            value: producing
+          - value: unknown