Explorar o código

feat(devices): add Oscal Powermax 1800SE

- make many dps optional in 2400Pro config (almost matches, but
  differences in the very high dps ids, assume similar missing dps for
  non-fitted battery packs etc)

Issue #6175
Jason Rumney hai 1 semana
pai
achega
0f9a875085

+ 1 - 1
DEVICES.md

@@ -795,7 +795,7 @@
 - Nine 32A EV charger
 - Nine 32A EV charger
 - Noeifevo Q21W EV charger
 - Noeifevo Q21W EV charger
 - Olight Ostation 2 battery charging station
 - Olight Ostation 2 battery charging station
-- Oscal PowerMax 2400 Pro and 6000 portable power stations
+- Oscal PowerMax 1800SE, 2400 Pro and 6000 portable power stations
 - Parkside PLGS 2012 A1 smart charger for powertools
 - Parkside PLGS 2012 A1 smart charger for powertools
 - SEVR X1 EV charger
 - SEVR X1 EV charger
 - Smart EV Chargers 10A EV charger
 - Smart EV Chargers 10A EV charger

+ 621 - 0
custom_components/tuya_local/devices/oscal_powermax1800se_portablepower.yaml

@@ -0,0 +1,621 @@
+name: Portable power station
+products:
+  - id: sgjrplhxfruooz9t
+    manufacturer: Oscal
+    model: PowerMax 1800SE
+entities:
+  - entity: sensor
+    class: battery
+    dps:
+      - id: 1
+        type: integer
+        name: sensor
+        unit: "%"
+        class: measurement
+      - id: 112
+        type: integer
+        name: power_packs
+  - entity: switch
+    name: AC power
+    dps:
+      - id: 6
+        type: boolean
+        name: switch
+      - id: 102
+        type: string
+        name: sw_version
+      - id: 146
+        type: string
+        name: inverter_version
+      - id: 147
+        type: string
+        name: bms_version
+      - id: 148
+        type: string
+        optional: true
+        name: mppt_version
+  - entity: switch
+    name: DC power
+    dps:
+      - id: 7
+        type: boolean
+        name: switch
+  - entity: select
+    name: Light
+    icon: "mdi:led"
+    dps:
+      - id: 9
+        type: string
+        name: option
+        mapping:
+          - dps_val: "off"
+            value: "Off"
+          - dps_val: bright
+            value: Dim
+          - dps_val: high_bright
+            value: Bright
+          - dps_val: sos
+            value: Emergency
+          - dps_val: breath
+            value: Pulse
+          - dps_val: flash
+            value: Flash
+  - entity: sensor
+    class: temperature
+    name: Battery temperature
+    category: diagnostic
+    dps:
+      - id: 10
+        type: integer
+        name: sensor
+        class: measurement
+      - id: 24
+        type: string
+        name: unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+  - entity: switch
+    translation_key: keytone
+    category: config
+    dps:
+      - id: 12
+        type: boolean
+        optional: true
+        name: switch
+  - entity: switch
+    name: USB
+    dps:
+      - id: 19
+        type: boolean
+        optional: true
+        name: switch
+  - entity: select
+    translation_key: temperature_unit
+    category: config
+    dps:
+      - id: 24
+        type: string
+        name: option
+        mapping:
+          - dps_val: c
+            value: celsius
+          - dps_val: f
+            value: fahrenheit
+  - entity: switch
+    translation_key: sound
+    category: config
+    dps:
+      - id: 25
+        type: boolean
+        name: switch
+  - entity: sensor
+    translation_key: time_remaining
+    category: diagnostic
+    class: duration
+    dps:
+      - id: 108
+        type: integer
+        name: sensor
+        unit: d
+      - id: 37
+        type: integer
+        name: hour
+      - id: 127
+        type: integer
+        name: minute
+  - entity: switch
+    name: Notifications
+    category: config
+    dps:
+      - id: 101
+        type: boolean
+        optional: true
+        name: switch
+  - entity: sensor
+    name: Total input
+    class: power
+    category: diagnostic
+    dps:
+      - id: 103
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+  - entity: sensor
+    name: Total output
+    class: power
+    category: diagnostic
+    dps:
+      - id: 104
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+  - entity: sensor
+    name: AC output
+    class: power
+    category: diagnostic
+    dps:
+      - id: 105
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+  - entity: number
+    name: Charge limit
+    category: config
+    icon: "mdi:battery-charging-90"
+    dps:
+      - id: 106
+        type: integer
+        name: value
+        unit: "%"
+        range:
+          min: 70
+          max: 100
+  - entity: number
+    name: Discharge limit
+    category: config
+    icon: "mdi:battery-20"
+    dps:
+      - id: 107
+        type: integer
+        name: value
+        unit: "%"
+        range:
+          min: 0
+          max: 30
+  - entity: select
+    name: Display timeout
+    icon: "mdi:television-ambient-light"
+    translation_key: timer
+    category: config
+    dps:
+      - id: 109
+        type: string
+        name: option
+        mapping:
+          - dps_val: "1min"
+            value: "1m"
+          - dps_val: "5min"
+            value: "5m"
+          - dps_val: "10min"
+            value: "10m"
+          - dps_val: "30min"
+            value: "30m"
+          - dps_val: "never_close"
+            value: "cancel"
+  - entity: sensor
+    class: enum
+    translation_key: status
+    category: diagnostic
+    dps:
+      - id: 110
+        type: string
+        name: sensor
+        mapping:
+          - dps_val: "0"
+            value: discharging
+          - dps_val: "1"
+            value: standby
+          - dps_val: "2"
+            value: charging
+  - entity: sensor
+    name: AC input
+    class: power
+    category: diagnostic
+    dps:
+      - id: 111
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+  - entity: sensor
+    name: Solar input
+    class: power
+    category: diagnostic
+    dps:
+      - id: 113
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+  - entity: switch
+    name: Bluetooth speaker
+    category: config
+    icon: "mdi:speaker-bluetooth"
+    dps:
+      - id: 114
+        type: boolean
+        optional: true
+        name: switch
+  - entity: switch
+    name: Grid feed-in
+    category: config
+    dps:
+      - id: 115
+        type: boolean
+        optional: true
+        name: switch
+  - entity: sensor
+    name: DC output
+    class: power
+    category: diagnostic
+    dps:
+      - id: 116
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+  - entity: sensor
+    name: USB output
+    class: power
+    category: diagnostic
+    dps:
+      - id: 117
+        type: integer
+        optional: true
+        name: sensor
+        unit: W
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: text
+    name: Emergency message
+    category: config
+    icon: "mdi:dots-horizontal"
+    dps:
+      - id: 118
+        type: string
+        optional: true
+        name: value
+        range:
+          min: 0
+          max: 255
+  - entity: number
+    name: Primary feed-in limit
+    category: config
+    dps:
+      - id: 119
+        type: integer
+        optional: true
+        name: value
+        unit: W
+        range:
+          min: 200
+          max: 800
+        mapping:
+          - step: 200
+  - entity: sensor
+    name: Pack 1
+    class: battery
+    category: diagnostic
+    dps:
+      - id: 120
+        type: integer
+        name: sensor
+        unit: "%"
+        class: measurement
+  - entity: sensor
+    name: Pack 1 temperature
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 121
+        type: integer
+        name: sensor
+        class: measurement
+      - id: 24
+        type: string
+        name: unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+  - entity: sensor
+    name: Pack 1 output
+    class: power
+    category: diagnostic
+    dps:
+      - id: 122
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+  - entity: time
+    translation_key: timer
+    category: config
+    dps:
+      - id: 123
+        type: integer
+        optional: true
+        name: minute
+        range:
+          min: 0
+          max: 1439
+  - entity: sensor
+    name: Pack 2
+    class: battery
+    category: diagnostic
+    dps:
+      - id: 124
+        type: integer
+        optional: true
+        name: sensor
+        unit: "%"
+        class: measurement
+  - entity: sensor
+    name: Pack 2 temperature
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 125
+        type: integer
+        optional: true
+        name: sensor
+        class: measurement
+      - id: 24
+        type: string
+        name: unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+  - entity: sensor
+    name: Pack 2 output
+    class: power
+    category: diagnostic
+    dps:
+      - id: 126
+        type: integer
+        optional: true
+        name: sensor
+        unit: W
+        class: measurement
+  - entity: number
+    name: Slow charge rate
+    icon: "mdi:battery-charging-90"
+    category: config
+    class: power
+    dps:
+      - id: 128
+        type: integer
+        name: value
+        unit: W
+        range:
+          min: 100
+          max: 800
+        mapping:
+          - step: 100
+  - entity: sensor
+    name: Pack 3
+    class: battery
+    category: diagnostic
+    dps:
+      - id: 129
+        type: integer
+        optional: true
+        name: sensor
+        unit: "%"
+        class: measurement
+  - entity: sensor
+    name: Pack 3 temperature
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 130
+        type: integer
+        optional: true
+        name: sensor
+        class: measurement
+      - id: 24
+        type: string
+        name: unit
+        mapping:
+          - dps_val: c
+            value: C
+          - dps_val: f
+            value: F
+  - entity: sensor
+    name: Pack 3 output
+    class: power
+    category: diagnostic
+    dps:
+      - id: 131
+        type: integer
+        optional: true
+        name: sensor
+        unit: W
+        class: measurement
+  - entity: sensor
+    name: Pack 4
+    class: battery
+    category: diagnostic
+    dps:
+      - id: 133
+        type: integer
+        optional: true
+        name: sensor
+        unit: "%"
+        class: measurement
+  - entity: sensor
+    name: Pack 4 temperature
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 134
+        type: integer
+        optional: true
+        name: sensor
+        class: measurement
+      - id: 24
+        type: string
+        name: unit
+        mapping:
+          - dps_val: c
+            value: C
+          - dps_val: f
+            value: F
+  - entity: sensor
+    name: Pack 4 output
+    class: power
+    category: diagnostic
+    dps:
+      - id: 135
+        type: integer
+        optional: true
+        name: sensor
+        unit: W
+        class: measurement
+  - entity: sensor
+    name: Pack 5
+    class: battery
+    category: diagnostic
+    dps:
+      - id: 137
+        type: integer
+        optional: true
+        name: sensor
+        unit: "%"
+        class: measurement
+  - entity: sensor
+    name: Pack 5 temperature
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 138
+        type: integer
+        optional: true
+        name: sensor
+        class: measurement
+      - id: 24
+        type: string
+        name: unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+  - entity: sensor
+    name: Pack 5 output
+    class: power
+    category: diagnostic
+    dps:
+      - id: 141
+        type: integer
+        optional: true
+        name: sensor
+        unit: W
+        class: measurement
+  - entity: select
+    name: AC standby sime
+    class: timer
+    category: config
+    icon: "mdi:timer-outline"
+    dps:
+      - id: 139
+        type: string
+        name: option
+        mapping:
+          - dps_val: never_close
+            value: cancel
+          - dps_val: "30min"
+            value: "30m"
+          - dps_val: "1hour"
+            value: "1h"
+          - dps_val: "2hour"
+            value: "2h"
+          - dps_val: "4hour"
+            value: "4h"
+          - dps_val: "6hour"
+            value: "6h"
+          - dps_val: "12hour"
+            value: "12h"
+          - dps_val: "24hour"
+            value: "24h"
+  - entity: select
+    name: DC standby time
+    class: timer
+    category: config
+    icon: "mdi:timer-outline"
+    dps:
+      - id: 140
+        type: string
+        optional: true
+        name: option
+        mapping:
+          - dps_val: never_close
+            value: cancel
+          - dps_val: "30min"
+            value: "30m"
+          - dps_val: "1hour"
+            value: "1h"
+          - dps_val: "2hour"
+            value: "2h"
+          - dps_val: "4hour"
+            value: "4h"
+          - dps_val: "6hour"
+            value: "6h"
+          - dps_val: "12hour"
+            value: "12h"
+          - dps_val: "24hour"
+            value: "24h"
+  - entity: time
+    name: Grid connection time
+    category: config
+    icon: "mdi:clock-start"
+    dps:
+      - id: 142
+        type: integer
+        optional: true
+        name: hour
+        range:
+          min: 0
+          max: 23
+      - id: 143
+        type: integer
+        optional: true
+        name: minute
+        range:
+          min: 0
+          max: 59
+  - entity: time
+    name: Grid disconnection time
+    category: config
+    icon: "mdi:clock-end"
+    dps:
+      - id: 144
+        type: integer
+        optional: true
+        name: hour
+        range:
+          min: 0
+          max: 23
+      - id: 145
+        type: integer
+        optional: true
+        name: minute
+        range:
+          min: 0
+          max: 59

+ 30 - 0
custom_components/tuya_local/devices/oscal_powermax2400pro_portablepower.yaml

@@ -73,12 +73,14 @@ entities:
     dps:
     dps:
       - id: 12
       - id: 12
         type: boolean
         type: boolean
+        optional: true
         name: switch
         name: switch
   - entity: switch
   - entity: switch
     name: USB
     name: USB
     dps:
     dps:
       - id: 19
       - id: 19
         type: boolean
         type: boolean
+        optional: true
         name: switch
         name: switch
   - entity: select
   - entity: select
     translation_key: temperature_unit
     translation_key: temperature_unit
@@ -120,6 +122,7 @@ entities:
     dps:
     dps:
       - id: 101
       - id: 101
         type: boolean
         type: boolean
+        optional: true
         name: switch
         name: switch
   - entity: sensor
   - entity: sensor
     name: Total input
     name: Total input
@@ -237,6 +240,7 @@ entities:
     dps:
     dps:
       - id: 114
       - id: 114
         type: boolean
         type: boolean
+        optional: true
         name: switch
         name: switch
   - entity: switch
   - entity: switch
     name: Grid feed-in
     name: Grid feed-in
@@ -244,6 +248,7 @@ entities:
     dps:
     dps:
       - id: 115
       - id: 115
         type: boolean
         type: boolean
+        optional: true
         name: switch
         name: switch
   - entity: sensor
   - entity: sensor
     name: DC output
     name: DC output
@@ -262,6 +267,7 @@ entities:
     dps:
     dps:
       - id: 117
       - id: 117
         type: integer
         type: integer
+        optional: true
         name: sensor
         name: sensor
         unit: W
         unit: W
         class: measurement
         class: measurement
@@ -274,6 +280,7 @@ entities:
     dps:
     dps:
       - id: 118
       - id: 118
         type: string
         type: string
+        optional: true
         name: value
         name: value
         range:
         range:
           min: 0
           min: 0
@@ -284,6 +291,7 @@ entities:
     dps:
     dps:
       - id: 119
       - id: 119
         type: integer
         type: integer
+        optional: true
         name: value
         name: value
         unit: W
         unit: W
         range:
         range:
@@ -334,6 +342,7 @@ entities:
     dps:
     dps:
       - id: 124
       - id: 124
         type: integer
         type: integer
+        optional: true
         name: sensor
         name: sensor
         unit: "%"
         unit: "%"
         class: measurement
         class: measurement
@@ -344,6 +353,7 @@ entities:
     dps:
     dps:
       - id: 125
       - id: 125
         type: integer
         type: integer
+        optional: true
         name: sensor
         name: sensor
         class: measurement
         class: measurement
       - id: 24
       - id: 24
@@ -360,6 +370,7 @@ entities:
     dps:
     dps:
       - id: 126
       - id: 126
         type: integer
         type: integer
+        optional: true
         name: sensor
         name: sensor
         unit: W
         unit: W
         class: measurement
         class: measurement
@@ -385,6 +396,7 @@ entities:
     dps:
     dps:
       - id: 129
       - id: 129
         type: integer
         type: integer
+        optional: true
         name: sensor
         name: sensor
         unit: "%"
         unit: "%"
         class: measurement
         class: measurement
@@ -395,6 +407,7 @@ entities:
     dps:
     dps:
       - id: 130
       - id: 130
         type: integer
         type: integer
+        optional: true
         name: sensor
         name: sensor
         class: measurement
         class: measurement
       - id: 24
       - id: 24
@@ -412,6 +425,7 @@ entities:
     dps:
     dps:
       - id: 131
       - id: 131
         type: integer
         type: integer
+        optional: true
         name: sensor
         name: sensor
         unit: W
         unit: W
         class: measurement
         class: measurement
@@ -422,6 +436,7 @@ entities:
     dps:
     dps:
       - id: 133
       - id: 133
         type: integer
         type: integer
+        optional: true
         name: sensor
         name: sensor
         unit: "%"
         unit: "%"
         class: measurement
         class: measurement
@@ -432,6 +447,7 @@ entities:
     dps:
     dps:
       - id: 134
       - id: 134
         type: integer
         type: integer
+        optional: true
         name: sensor
         name: sensor
         class: measurement
         class: measurement
       - id: 24
       - id: 24
@@ -449,6 +465,7 @@ entities:
     dps:
     dps:
       - id: 135
       - id: 135
         type: integer
         type: integer
+        optional: true
         name: sensor
         name: sensor
         unit: W
         unit: W
         class: measurement
         class: measurement
@@ -459,6 +476,7 @@ entities:
     dps:
     dps:
       - id: 137
       - id: 137
         type: integer
         type: integer
+        optional: true
         name: sensor
         name: sensor
         unit: "%"
         unit: "%"
         class: measurement
         class: measurement
@@ -469,6 +487,7 @@ entities:
     dps:
     dps:
       - id: 138
       - id: 138
         type: integer
         type: integer
+        optional: true
         name: sensor
         name: sensor
         class: measurement
         class: measurement
       - id: 24
       - id: 24
@@ -485,6 +504,7 @@ entities:
     dps:
     dps:
       - id: 141
       - id: 141
         type: integer
         type: integer
+        optional: true
         name: sensor
         name: sensor
         unit: W
         unit: W
         class: measurement
         class: measurement
@@ -522,6 +542,7 @@ entities:
     dps:
     dps:
       - id: 140
       - id: 140
         type: string
         type: string
+        optional: true
         name: option
         name: option
         mapping:
         mapping:
           - dps_val: never_close
           - dps_val: never_close
@@ -547,12 +568,14 @@ entities:
     dps:
     dps:
       - id: 143
       - id: 143
         type: integer
         type: integer
+        optional: true
         name: hour
         name: hour
         range:
         range:
           min: 0
           min: 0
           max: 23
           max: 23
       - id: 144
       - id: 144
         type: integer
         type: integer
+        optional: true
         name: minute
         name: minute
         range:
         range:
           min: 0
           min: 0
@@ -564,12 +587,14 @@ entities:
     dps:
     dps:
       - id: 145
       - id: 145
         type: integer
         type: integer
+        optional: true
         name: hour
         name: hour
         range:
         range:
           min: 0
           min: 0
           max: 23
           max: 23
       - id: 146
       - id: 146
         type: integer
         type: integer
+        optional: true
         name: minute
         name: minute
         range:
         range:
           min: 0
           min: 0
@@ -580,6 +605,7 @@ entities:
     dps:
     dps:
       - id: 147
       - id: 147
         type: integer
         type: integer
+        optional: true
         name: value
         name: value
         unit: W
         unit: W
         range:
         range:
@@ -594,12 +620,14 @@ entities:
     dps:
     dps:
       - id: 148
       - id: 148
         type: integer
         type: integer
+        optional: true
         name: hour
         name: hour
         range:
         range:
           min: 0
           min: 0
           max: 23
           max: 23
       - id: 149
       - id: 149
         type: integer
         type: integer
+        optional: true
         name: minute
         name: minute
         range:
         range:
           min: 0
           min: 0
@@ -611,12 +639,14 @@ entities:
     dps:
     dps:
       - id: 150
       - id: 150
         type: integer
         type: integer
+        optional: true
         name: hour
         name: hour
         range:
         range:
           min: 0
           min: 0
           max: 23
           max: 23
       - id: 151
       - id: 151
         type: integer
         type: integer
+        optional: true
         name: minute
         name: minute
         range:
         range:
           min: 0
           min: 0