Explorar el Código

feat (smart_multi_plug_4t_4usb): fully support Marmitek Power LI3

- add optional entities for problem, initial state, schedules, inching, current limit
- all but the last are standard dps, so should match other power strips
- current limit is non-standard, so has potential to conflict, but original
  device this was for does not use 101. Range also seems specific to countries
  that use 13A or 15A circuits (not suited to 10A limited sockets for example).

Issue #4155
Jason Rumney hace 1 mes
padre
commit
46afdc9b22
Se han modificado 1 ficheros con 136 adiciones y 8 borrados
  1. 136 8
      custom_components/tuya_local/devices/smart_multi_plug_4t_4usb.yaml

+ 136 - 8
custom_components/tuya_local/devices/smart_multi_plug_4t_4usb.yaml

@@ -2,6 +2,9 @@ name: Quad power strip + 4USB
 products:
   - id: rpnp3rtjjzbktign
     model: "4T+4USB"
+  - id: l7z01thw8rcy5nuu
+    manufacturer: Marmitek
+    model: Power LI3
 entities:
   - entity: switch
     translation_key: outlet_x
@@ -12,14 +15,6 @@ entities:
       - id: 1
         type: boolean
         name: switch
-      - id: 17
-        type: integer
-        name: add_ele
-        optional: true
-      - id: 25
-        type: integer
-        name: ele_calibration
-        optional: true
   - entity: switch
     translation_key: outlet_x
     translation_placeholders:
@@ -140,6 +135,14 @@ entities:
         type: integer
         name: calibration
         optional: true
+      - id: 17
+        type: integer
+        name: add_ele
+        optional: true
+      - id: 25
+        type: integer
+        name: ele_calibration
+        optional: true
   - entity: sensor
     category: diagnostic
     class: voltage
@@ -156,3 +159,128 @@ entities:
         type: integer
         name: calibration
         optional: true
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 26
+        type: bitfield
+        optional: true
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - dps_val: null
+            value: false
+          - value: true
+      - id: 26
+        type: bitfield
+        optional: true
+        name: fault_code
+      - id: 21
+        type: bitfield
+        optional: true
+        name: test_bit
+  - entity: select
+    translation_key: initial_state
+    category: config
+    hidden: unavailable
+    dps:
+      - id: 38
+        type: string
+        optional: true
+        name: option
+        mapping:
+          - conditions:
+              - dps_val: [memory, "off", "on"]
+                mapping:
+                  - dps_val: "off"
+                    value: "off"
+                  - dps_val: "on"
+                    value: "on"
+                  - dps_val: memory
+                    value: memory
+              - dps_val: [power_off, power_on, last]
+                mapping:
+                  - dps_val: power_off
+                    value: "off"
+                  - dps_val: power_on
+                    value: "on"
+                  - dps_val: last
+                    value: memory
+              - dps_val: ["0", "1", "2"]
+                mapping:
+                  - dps_val: "0"
+                    value: "off"
+                  - dps_val: "1"
+                    value: "on"
+                  - dps_val: "2"
+                    value: memory
+              - dps_val: null  # to get value list during initialization
+                mapping:
+                  - dps_val: "off"
+                    value: "off"
+                  - dps_val: "on"
+                    value: "on"
+                  - dps_val: memory
+                    value: memory
+      - id: 38
+        type: string
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
+  - entity: text
+    name: Schedule
+    category: config
+    icon: "mdi:calendar-clock"
+    hidden: true
+    dps:
+      - id: 41
+        type: string
+        optional: true
+        name: value
+  - entity: text
+    name: Randomized schedule
+    category: config
+    icon: "mdi:island"
+    hidden: true
+    dps:
+      - id: 42
+        type: string
+        optional: true
+        name: value
+  - entity: text
+    name: Inching
+    category: config
+    icon: "mdi:toggle-switch"
+    hidden: true
+    dps:
+      - id: 43
+        type: string
+        optional: true
+        name: value
+  - entity: number
+    name: Current limit
+    class: current
+    category: config
+    hidden: unavailable
+    dps:
+      - id: 101
+        type: integer
+        optional: true
+        name: value
+        unit: A
+        range:
+          min: 11
+          max: 17
+      - id: 101
+        type: integer
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true