Selaa lähdekoodia

feat (devices): support for Atorch DT20HBW battery monitor

Issue #3868
Jason Rumney 8 kuukautta sitten
vanhempi
commit
54990578e2

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -1089,3 +1089,4 @@ Further device support has been made with the assistance of users. Please consid
 - [Macrisu](https://github.com/Macrisu) for assisting with support for Ipengen GO-E31-15A EV charger.
 - [davidmurdoch](https://github.com/davidmurdoch) for contributing support for Elegrp DTR10 dimmer light switch.
 - [nitedani](https://github.com/nitedani) for contributing support for Fisher F-ERVQ-B150CO2-I heat recovery ventilator.
+- [kbeanio](https://github.com/kbeanio) for assisting with support for Atorch DT20HBW battery monitor.

+ 1 - 0
DEVICES.md

@@ -499,6 +499,7 @@
 - Atorch S1BW,S1WP energy monitoring switches with display
 - Atorch AT2PL energy monitoring breaker switch (also working for GR2PWS)
 - Atorch AT4PW energy monitor
+- Atorch DT20HBW DC battery monitor
 - Aulifants SMES200 energy monitoring breaker switch
 - Avidsen Soria 400W solar inverter
 - CBI Astute smart controller breaker switch

+ 327 - 0
custom_components/tuya_local/devices/atorch_dt20_energymeter.yaml

@@ -0,0 +1,327 @@
+name: Energy meter
+products:
+  - id: 1xgihnuztyo12pqv
+    manufacturer: Atorch
+    model: DT20HBW
+entities:
+  - entity: sensor
+    class: current
+    dps:
+      - id: 18
+        name: sensor
+        type: integer
+        class: measurement
+        unit: A
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    class: power
+    dps:
+      - id: 19
+        name: sensor
+        type: integer
+        class: measurement
+        unit: W
+        mapping:
+          - scale: 100
+  - entity: sensor
+    class: voltage
+    dps:
+      - id: 20
+        name: sensor
+        type: integer
+        class: measurement
+        unit: V
+        mapping:
+          - scale: 100
+  - entity: switch
+    category: config
+    name: Relay control
+    dps:
+      - id: 102
+        type: boolean
+        name: switch
+  - entity: sensor
+    class: battery
+    dps:
+      - id: 103
+        name: sensor
+        type: integer
+        class: measurement
+        unit: "%"
+        mapping:
+          - scale: 10
+  - entity: number
+    category: config
+    name: Overvoltage threshold
+    class: voltage
+    dps:
+      - id: 104
+        type: integer
+        name: value
+        unit: V
+        range:
+          min: 1
+          max: 2750
+        mapping:
+          - scale: 10
+  - entity: number
+    category: config
+    name: Overcurrent threshold
+    class: current
+    dps:
+      - id: 105
+        type: integer
+        name: value
+        unit: A
+        range:
+          min: 1
+          max: 1000
+        mapping:
+          - scale: 10
+  - entity: number
+    category: config
+    name: Overpower threshold
+    class: power
+    dps:
+      - id: 106
+        type: integer
+        name: value
+        unit: W
+        range:
+          min: 1
+          max: 27500
+  - entity: select
+    category: config
+    translation_key: language
+    dps:
+      - id: 107
+        type: string
+        name: option
+        mapping:
+          - dps_val: chinese
+            value: chinese
+          - dps_val: english
+            value: english
+  - entity: light
+    category: config
+    translation_key: display
+    dps:
+      - id: 108
+        type: integer
+        name: brightness
+        range:
+          min: 1
+          max: 9
+  - entity: light
+    category: config
+    name: Standby display
+    translation_key: display
+    dps:
+      - id: 109
+        type: integer
+        name: brightness
+        range:
+          min: 0
+          max: 9
+  - entity: number
+    category: config
+    class: duration
+    name: Display timeout
+    icon: "mdi:sun-clock"
+    dps:
+      - id: 110
+        type: integer
+        name: value
+        unit: s
+        range:
+          min: 3
+          max: 99
+  - entity: switch
+    name: Real-time data
+    category: config
+    dps:
+      - id: 101
+        type: boolean
+        name: switch
+  - entity: button
+    name: Reset data
+    category: config
+    class: restart
+    dps:
+      - id: 113
+        type: boolean
+        name: button
+        optional: true
+  - entity: button
+    name: Reset Wi-Fi
+    category: config
+    class: restart
+    hidden: true
+    dps:
+      - id: 114
+        type: boolean
+        name: button
+        optional: true
+  - entity: button
+    translation_key: factory_reset
+    category: config
+    hidden: true
+    dps:
+      - id: 115
+        type: boolean
+        name: button
+        optional: true
+  - entity: button
+    name: Exit settings
+    category: config
+    icon: "mdi:exit-run"
+    dps:
+      - id: 116
+        type: boolean
+        name: button
+        optional: true
+  - entity: select
+    name: Display control
+    icon: "mdi:menu"
+    category: config
+    dps:
+      - id: 118
+        type: string
+        name: option
+        mapping:
+          - dps_val: front
+            value: Measurement
+          - dps_val: back
+            value: Settings
+  - entity: number
+    category: config
+    name: Mini measure Amp
+    icon: "mdi:resize-bottom-right"
+    dps:
+      - id: 121
+        type: integer
+        name: value
+        unit: mA
+        range:
+          min: 2
+          max: 99
+  - entity: sensor
+    class: energy
+    dps:
+      - id: 123
+        name: sensor
+        type: integer
+        class: total_increasing
+        unit: kWh
+        mapping:
+          - scale: 1000
+  - entity: number
+    category: config
+    name: Data refresh interval
+    class: duration
+    icon: "mdi:timer-refresh-outline"
+    dps:
+      - id: 125
+        type: integer
+        name: value
+        unit: s
+        range:
+          min: 1
+          max: 90
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 132
+        type: string
+        optional: true
+        name: sensor
+        mapping:
+          - dps_val: null
+            value: false
+          - dps_val: ""
+            value: false
+          - value: true
+      - id: 132
+        type: string
+        optional: true
+        name: description
+        mapping:
+          - dps_val: null
+            value: ok
+          - dps_val: ""
+            value: ok
+          - dps_val: ovp
+            value: Overvoltage
+          - dps_val: opp
+            value: Overpower
+          - dps_val: lvp
+            value: Undervoltage
+          - dps_val: otp
+            value: Overtemp
+  - entity: sensor
+    name: Total charge
+    dps:
+      - id: 133
+        name: sensor
+        type: integer
+        class: total
+        unit: Ah
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    name: Resistance
+    icon: "mdi:omega"
+    dps:
+      - id: 134
+        name: sensor
+        type: integer
+        class: measurement
+        unit: Ω
+        mapping:
+          - scale: 100
+  - entity: sensor
+    category: diagnostic
+    class: temperature
+    dps:
+      - id: 122
+        name: sensor
+        type: integer
+        class: measurement
+        unit: C
+        mapping:
+          - scale: 10
+  - entity: sensor
+    name: CPU temperature
+    category: diagnostic
+    class: temperature
+    dps:
+      - id: 135
+        name: sensor
+        type: integer
+        class: measurement
+        unit: C
+  - entity: select
+    name: Shunt size
+    category: config
+    icon: "mdi:resize"
+    dps:
+      - id: 136
+        type: string
+        name: option
+        mapping:
+          - dps_val: 30A
+            value: "30 amp"
+          - dps_val: 100A
+            value: "100 amp"
+          - dps_val: 200A
+            value: "200 amp"
+          - dps_val: 300A
+            value: "300 amp"
+          - dps_val: 400A
+            value: "400 amp"
+          - dps_val: 500A
+            value: "500 amp"
+          - dps_val: 600A
+            value: "1000 amp"