Parcourir la source

Add support for SRNE SE Series lithium battery storage (#4119)

* Add SRNE SE-Series battery support

I could perform tests on a SR-SE05B model and confront the results
with the official apps :
- SRNE for Bluetooth connection
- SmartLife for Tuya cloud

This series of equipment include :
- SR-SE05B
- SR-SE10B
- SR-SE15B
- SR-SE15B-Pro
- SR-SE16B-Pro

https://www.srnesolar.com/productdetail/76.html

* Apply some recommendations by Jason Rumney

Will facilitate translations

Also: fix a warning about spacing raised by the YAML linter

* Refactor sensor names and remove precision

Updated sensor names for clarity and removed precision from measurements.

---------

Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
Barijaona Ramaholimihaso il y a 2 mois
Parent
commit
4955b6a3b0

+ 322 - 0
custom_components/tuya_local/devices/srne_energy_storage_battery.yaml

@@ -0,0 +1,322 @@
+name: LiFP battery
+products:
+  - id: l2ak4zqufuarm0j3
+    manufacturer: SRNE
+    model: SR-SE05B
+entities:
+  - entity: sensor
+    class: battery
+    dps:
+      - id: 103
+        type: integer
+        name: sensor
+        unit: "%"
+        class: measurement
+  - entity: sensor
+    class: voltage
+    dps:
+      - id: 102
+        type: integer
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 100
+  - entity: sensor
+    class: current
+    name: Charging current
+    dps:
+      - id: 101
+        type: integer
+        name: sensor
+        unit: A
+        class: measurement
+        mapping:
+          - scale: 100
+  - entity: sensor
+    name: Discharge cycles
+    dps:
+      - id: 108
+        type: integer
+        name: sensor
+        unit: cycles
+        class: total
+  - entity: sensor
+    category: diagnostic
+    class: temperature
+    name: Battery temperature
+    dps:
+      - id: 115
+        type: integer
+        optional: true
+        name: sensor
+        unit: C
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    category: diagnostic
+    class: temperature
+    name: MOS temperature
+    dps:
+      - id: 116
+        type: integer
+        optional: true
+        name: sensor
+        unit: C
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    category: diagnostic
+    class: temperature
+    name: Ambient temperature
+    dps:
+      - id: 119
+        type: integer
+        optional: true
+        name: sensor
+        unit: C
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 1
+    dps:
+      - id: 120
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 2
+    dps:
+      - id: 121
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 3
+    dps:
+      - id: 122
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 4
+    dps:
+      - id: 123
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 5
+    dps:
+      - id: 124
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 6
+    dps:
+      - id: 125
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 7
+    dps:
+      - id: 126
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 8
+    dps:
+      - id: 127
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 9
+    dps:
+      - id: 128
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 10
+    dps:
+      - id: 129
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 11
+    dps:
+      - id: 130
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 12
+    dps:
+      - id: 131
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 13
+    dps:
+      - id: 132
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 14
+    dps:
+      - id: 133
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 15
+    dps:
+      - id: 134
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    translation_key: voltage_x
+    translation_placeholders:
+      x: Cell 16
+    dps:
+      - id: 135
+        type: integer
+        optional: true
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 1000