Jelajahi Sumber

Parkside charger: make dp 11 an int, dp 1 optional.

Based on user feedback, dp 11 seems to be a fault code (bit field), and
dp 1 is not always sent.  The original report did not include logs, and there
was never feedback from the original reporter.

dp 2 is a fixed string with the model name, so does not make sense to
have as a sensor. Moved to an attribute.

Issue #1387
Jason Rumney 2 tahun lalu
induk
melakukan
8806ea82b3

+ 159 - 151
custom_components/tuya_local/devices/parkside_plgs2012a1_smart_charger.yaml

@@ -1,151 +1,159 @@
-name: Parkside PLGS2012A1 charger
-products:
-  - id: h6pglenun37dzsgo
-primary_entity:
-  entity: switch
-  icon: "mdi:ev-station"
-  dps:
-    - id: 1
-      type: boolean
-      name: switch
-    - id: 11
-      type: string
-      name: unknown_11
-secondary_entities:
-  - entity: number
-    name: Charge current
-    icon: "mdi:current-dc"
-    category: config
-    class: current
-    dps:
-      - id: 3
-        type: integer
-        name: value
-        range:
-          min: 0
-          max: 30000
-        mapping:
-          - step: 100
-            scale: 1000
-        unit: A
-  - entity: number
-    name: Charge voltage
-    icon: "mdi:battery-charging"
-    category: config
-    class: voltage
-    dps:
-      - id: 4
-        type: integer
-        name: value
-        range:
-          min: 0
-          max: 25000
-        mapping:
-          - scale: 1000
-            step: 100
-        unit: V
-  - entity: switch
-    name: Storage
-    category: config
-    dps:
-      - id: 8
-        type: boolean
-        name: switch
-        mapping:
-          - dps_val: true
-            icon: "mdi:battery-60"
-          - dps_val: false
-            icon: "mdi:battery"
-  - entity: switch
-    name: Temperature limiter
-    category: config
-    icon: "mdi:thermometer-alert"
-    dps:
-      - id: 9
-        type: boolean
-        name: switch
-  - entity: sensor
-    class: battery
-    dps:
-      - id: 5
-        type: integer
-        name: sensor
-        unit: "%"
-  - entity: sensor
-    class: temperature
-    category: diagnostic
-    dps:
-      - id: 6
-        type: integer
-        name: sensor
-        unit: C
-        class: measurement
-  - entity: sensor
-    name: Max temperature count
-    icon: "mdi:thermometer-plus"
-    category: diagnostic
-    dps:
-      - id: 10
-        type: integer
-        name: sensor
-  - entity: sensor
-    name: Name
-    icon: "mdi:form-textbox"
-    category: diagnostic
-    dps:
-      - id: 2
-        type: string
-        name: sensor
-  - entity: select
-    name: Charge type
-    icon: "mdi:battery-unknown"
-    category: config
-    dps:
-      - id: 7
-        type: string
-        name: option
-        mapping:
-          - dps_val: ECO
-            value: Eco
-          - dps_val: quick
-            value: Performance
-          - dps_val: standard
-            value: Balanced
-          - dps_val: individual
-            value: Expert
-  - entity: sensor
-    name: Max current
-    class: current
-    category: diagnostic
-    dps:
-      - id: 101
-        type: integer
-        name: sensor
-        unit: A
-        mapping:
-          - scale: 1000
-  - entity: sensor
-    name: Time remaining
-    class: duration
-    icon: "mdi:battery-clock"
-    dps:
-      - id: 102
-        type: integer
-        name: sensor
-        unit: min
-  - entity: binary_sensor
-    name: Almost charged
-    icon: "mdi:battery-charging-90"
-    category: diagnostic
-    dps:
-      - id: 103
-        type: boolean
-        name: sensor
-  - entity: binary_sensor
-    name: Fully charged
-    icon: "mdi:battery-charging-100"
-    category: diagnostic
-    dps:
-      - id: 104
-        type: boolean
-        name: sensor
+name: Parkside PLGS2012A1 charger
+products:
+  - id: h6pglenun37dzsgo
+primary_entity:
+  entity: switch
+  icon: "mdi:ev-station"
+  dps:
+    - id: 1
+      type: boolean
+      name: switch
+      optional: true
+    - id: 2
+      type: string
+      name: model
+    - id: 11
+      type: bitfield
+      name: fault_code
+secondary_entities:
+  - entity: number
+    name: Charge current
+    icon: "mdi:current-dc"
+    category: config
+    class: current
+    dps:
+      - id: 3
+        type: integer
+        name: value
+        range:
+          min: 0
+          max: 30000
+        mapping:
+          - step: 100
+            scale: 1000
+        unit: A
+  - entity: number
+    name: Charge voltage
+    icon: "mdi:battery-charging"
+    category: config
+    class: voltage
+    dps:
+      - id: 4
+        type: integer
+        name: value
+        range:
+          min: 0
+          max: 25000
+        mapping:
+          - scale: 1000
+            step: 100
+        unit: V
+  - entity: switch
+    name: Storage
+    category: config
+    dps:
+      - id: 8
+        type: boolean
+        name: switch
+        mapping:
+          - dps_val: true
+            icon: "mdi:battery-60"
+          - dps_val: false
+            icon: "mdi:battery"
+  - entity: switch
+    name: Temperature limiter
+    category: config
+    icon: "mdi:thermometer-alert"
+    dps:
+      - id: 9
+        type: boolean
+        name: switch
+  - entity: sensor
+    class: battery
+    dps:
+      - id: 5
+        type: integer
+        name: sensor
+        unit: "%"
+  - entity: sensor
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 6
+        type: integer
+        name: sensor
+        unit: C
+        class: measurement
+  - entity: sensor
+    name: Max temperature count
+    icon: "mdi:thermometer-plus"
+    category: diagnostic
+    dps:
+      - id: 10
+        type: integer
+        name: sensor
+  - entity: select
+    name: Charge type
+    icon: "mdi:battery-unknown"
+    category: config
+    dps:
+      - id: 7
+        type: string
+        name: option
+        mapping:
+          - dps_val: ECO
+            value: Eco
+          - dps_val: quick
+            value: Performance
+          - dps_val: standard
+            value: Balanced
+          - dps_val: individual
+            value: Expert
+  - entity: sensor
+    name: Max current
+    class: current
+    category: diagnostic
+    dps:
+      - id: 101
+        type: integer
+        name: sensor
+        unit: A
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    name: Time remaining
+    class: duration
+    icon: "mdi:battery-clock"
+    dps:
+      - id: 102
+        type: integer
+        name: sensor
+        unit: min
+  - entity: binary_sensor
+    name: Almost charged
+    icon: "mdi:battery-charging-90"
+    category: diagnostic
+    dps:
+      - id: 103
+        type: boolean
+        name: sensor
+  - entity: binary_sensor
+    name: Fully charged
+    icon: "mdi:battery-charging-100"
+    category: diagnostic
+    dps:
+      - id: 104
+        type: boolean
+        name: sensor
+  - entity: binary_sensor
+    name: Fault
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 11
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true