Jelajahi Sumber

feat (devices): add support for Tongou QCB2-100 3P circuit breaker

Since the report was missing range/scale info, the scales and ranges
have been assumed to be the same as QCB2-WB, which was almost
compatible except for the sensors due to reallocation from single
phase to three-phase. This may not be correct, since this is a
100A model, while the other supported models are 63A.

Issue #2420
Jason Rumney 3 bulan lalu
induk
melakukan
28ffd57c50

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -1112,3 +1112,4 @@ Further device support has been made with the assistance of users. Please consid
 - [amotruk](https://github.com/amotruk) for contributing support for Mini-B Public litter box.
 - [p1x3lmx](https://github.com/p1x3lmx) for assisting with support for Ningbo BF314A camera pet feeder.
 - [sajtdavid](https://github.com/sajtdavid) for contributing support for CO2v1 carbon dioxide sensor.
+- [dermocles9308](https://github.com/dermocles9308) for assisting with support for Tongou QCB2-100 3 phase circuit breaker.

+ 445 - 0
custom_components/tuya_local/devices/tongou_qcb2100_circuitbreaker.yaml

@@ -0,0 +1,445 @@
+name: Circuit breaker
+products:
+  - id: xafxthzm5rxv7qcc
+    manufacturer: Tongou
+    model: QCB2-100 3P
+entities:
+  - entity: sensor
+    name: Leakage current
+    class: current
+    category: diagnostic
+    dps:
+      - id: 15
+        type: integer
+        name: sensor
+        unit: mA
+        class: measurement
+  - entity: switch
+    name: Breaker
+    dps:
+      - id: 16
+        type: boolean
+        name: switch
+      - id: 125
+        type: string
+        optional: true
+        name: firmware_version
+  - entity: number
+    name: Current limit
+    class: current
+    category: config
+    dps:
+      - id: 102
+        type: integer
+        name: value
+        unit: A
+        range:
+          min: 1
+          max: 100
+  - entity: number
+    name: Overvoltage limit
+    class: voltage
+    category: config
+    dps:
+      - id: 103
+        type: integer
+        name: value
+        unit: V
+        range:
+          min: 245
+          max: 295
+  - entity: number
+    name: Undervoltage limit
+    class: voltage
+    category: config
+    dps:
+      - id: 104
+        type: integer
+        name: value
+        unit: V
+        range:
+          min: 145
+          max: 220
+  - entity: number
+    name: Leakage current limit
+    class: current
+    category: config
+    dps:
+      - id: 105
+        type: integer
+        optional: true
+        name: value
+        unit: mA
+        range:
+          min: 10
+          max: 100
+        mapping:
+          - step: 10
+  - entity: number
+    class: temperature
+    name: Temperature limit
+    category: diagnostic
+    dps:
+      - id: 110
+        type: integer
+        name: value
+        unit: C
+        class: measurement
+        mapping:
+          - scale: 10
+        range:
+          min: -400
+          max: 1000
+  - entity: select
+    translation_key: breaker_trigger_action
+    translation_placeholders:
+      trigger: Overvoltage
+    category: config
+    dps:
+      - id: 111
+        type: string
+        name: option
+        mapping:
+          - dps_val: Close
+            value: ignore
+          - dps_val: Alarm
+            value: alarm
+          - dps_val: Trip
+            value: trip_breaker
+  - entity: select
+    translation_key: breaker_trigger_action
+    translation_placeholders:
+      trigger: Undervoltage
+    category: config
+    dps:
+      - id: 112
+        type: string
+        name: option
+        mapping:
+          - dps_val: Close
+            value: ignore
+          - dps_val: Alarm
+            value: alarm
+          - dps_val: Trip
+            value: trip_breaker
+  - entity: select
+    translation_key: breaker_trigger_action
+    translation_placeholders:
+      trigger: Over current
+    category: config
+    dps:
+      - id: 113
+        type: string
+        name: option
+        mapping:
+          - dps_val: Close
+            value: ignore
+          - dps_val: Alarm
+            value: alarm
+          - dps_val: Trip
+            value: trip_breaker
+  - entity: select
+    translation_key: breaker_trigger_action
+    translation_placeholders:
+      trigger: Over power
+    category: config
+    dps:
+      - id: 114
+        type: string
+        name: option
+        mapping:
+          - dps_val: Close
+            value: ignore
+          - dps_val: Alarm
+            value: alarm
+          - dps_val: Trip
+            value: trip_breaker
+  - entity: select
+    translation_key: breaker_trigger_action
+    translation_placeholders:
+      trigger: Over temperature
+    category: config
+    dps:
+      - id: 115
+        type: string
+        name: option
+        mapping:
+          - dps_val: Close
+            value: ignore
+          - dps_val: Alarm
+            value: alarm
+          - dps_val: Trip
+            value: trip_breaker
+  - entity: select
+    translation_key: breaker_trigger_action
+    translation_placeholders:
+      trigger: Earth leakage
+    category: config
+    dps:
+      - id: 116
+        type: string
+        name: option
+        mapping:
+          - dps_val: Close
+            value: ignore
+          - dps_val: Alarm
+            value: alarm
+          - dps_val: Trip
+            value: trip_breaker
+  - entity: number
+    name: Power limit
+    class: power
+    category: config
+    dps:
+      - id: 118
+        type: integer
+        name: value
+        unit: W
+        range:
+          min: 5
+          max: 25000
+        mapping:
+          - step: 10
+  - entity: sensor
+    name: Event
+    category: diagnostic
+    dps:
+      - id: 119
+        type: string
+        name: sensor
+  - entity: switch
+    name: Auto reset
+    category: config
+    dps:
+      - id: 123
+        type: boolean
+        name: switch
+  - entity: button
+    translation_key: factory_reset
+    category: config
+    dps:
+      - id: 126
+        type: boolean
+        optional: true
+        name: button
+  - entity: sensor
+    translation_key: voltage_x
+    translation_placeholders:
+      x: A
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 127
+        type: integer
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    translation_key: voltage_x
+    translation_placeholders:
+      x: B
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 128
+        type: integer
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    translation_key: voltage_x
+    translation_placeholders:
+      x: C
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 129
+        type: integer
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    translation_key: current_x
+    translation_placeholders:
+      x: A
+    class: current
+    category: diagnostic
+    dps:
+      - id: 130
+        type: integer
+        name: sensor
+        unit: A
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    translation_key: current_x
+    translation_placeholders:
+      x: B
+    class: current
+    category: diagnostic
+    dps:
+      - id: 131
+        type: integer
+        name: sensor
+        unit: A
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    translation_key: current_x
+    translation_placeholders:
+      x: C
+    class: current
+    category: diagnostic
+    dps:
+      - id: 132
+        type: integer
+        name: sensor
+        unit: A
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    name: Temperature A
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 133
+        type: integer
+        name: sensor
+        unit: C
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    name: Temperature B
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 134
+        type: integer
+        name: sensor
+        unit: C
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    name: Temperature C
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 135
+        type: integer
+        name: sensor
+        unit: C
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    name: Temperature N
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 136
+        type: integer
+        name: sensor
+        unit: C
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    translation_key: power_x
+    translation_placeholders:
+      x: A
+    class: power
+    category: diagnostic
+    dps:
+      - id: 137
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+  - entity: sensor
+    translation_key: power_x
+    translation_placeholders:
+      x: B
+    class: power
+    category: diagnostic
+    dps:
+      - id: 138
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+  - entity: sensor
+    translation_key: power_x
+    translation_placeholders:
+      x: C
+    class: power
+    category: diagnostic
+    dps:
+      - id: 139
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+  - entity: sensor
+    translation_key: energy_consumed_x
+    translation_placeholders:
+      x: A
+    class: energy
+    category: diagnostic
+    dps:
+      - id: 146
+        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
+    category: diagnostic
+    dps:
+      - id: 147
+        type: integer
+        name: sensor
+        unit: kWh
+        class: total_increasing
+        mapping:
+          - scale: 100
+  - entity: sensor
+    translation_key: energy_consumed_x
+    translation_placeholders:
+      x: C
+    class: energy
+    category: diagnostic
+    dps:
+      - id: 148
+        type: integer
+        name: sensor
+        unit: kWh
+        class: total_increasing
+        mapping:
+          - scale: 100
+  - entity: sensor
+    class: energy
+    category: diagnostic
+    dps:
+      - id: 149
+        type: integer
+        name: sensor
+        unit: kWh
+        class: total_increasing
+        mapping:
+          - scale: 100