Просмотр исходного кода

Add EA dual zone car fridge (#6290)

Replaces the car fridge half of #6283, reworked after review: one device
per PR, and only dps with real data are included.

**Device:** EA dual zone car fridge, product `iyqhndov8rdzqrlq`.

**Where the dps come from:** the product's Tuya IoT data model (dps
101-139) and the device's reported properties from the Tuya IoT
platform.

Included, all required, because the device reports every one of them
live:
101 (power), 102 (lock), 103 (mode), 104 (battery protection), 105
(display unit), 110 and 111 (zone A and B on/off), 117 and 118 (zone
temperatures in °F), 119 and 120 (zone targets in °F), 122 (battery
voltage, scale 1), and 123 (battery percent).

Optional, with reason:
- 106 (fault bitmap): only reported when a fault is raised or cleared.
Its last report was from 2024, with the value 0.

Left out:
- 112-116 and 128-133 (the Celsius set): the device only updates the set
that matches its display unit (dp 105). While set to °F, the Celsius
values are frozen at their 2024 values.
- 107, 108, 116, 121, 132, 133, 138 and 139 (the heat box): this model
has no heater. These dps hold factory defaults that have not changed
since 2024.
- 124-127 (second battery): no second battery pack. These dps read 0 and
have not changed since 2024.
- 134-137 (per-zone setpoint limits): these are configuration limits,
not something a user needs.

**Testing:** I loaded the config with tuya-local's own `device_config`
helpers and fed it the device's reported dps. It is the top match, at
quality 101 with the product ID and 81 without. Removing any required dp
stops it matching.

---------

Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
meeowgler 1 день назад
Родитель
Сommit
3b05227654
2 измененных файлов с 203 добавлено и 0 удалено
  1. 1 0
      DEVICES.md
  2. 202 0
      custom_components/tuya_local/devices/ea_carfridge.yaml

+ 1 - 0
DEVICES.md

@@ -675,6 +675,7 @@
 - Casdon KG1 inline water dispenser
 - Casdon KG1 inline water dispenser
 - Casdon TD Pro 2, TD Pro 3 and T2E ovens
 - Casdon TD Pro 2, TD Pro 3 and T2E ovens
 - Cecofry 5500 Connected air fryer
 - Cecofry 5500 Connected air fryer
+- EA dual zone car fridge
 - Etna VW644MC dishwasher, AB791 range hood
 - Etna VW644MC dishwasher, AB791 range hood
 - Fiesta DK-1G smart kettle
 - Fiesta DK-1G smart kettle
 - FRE1L4 water chiller
 - FRE1L4 water chiller

+ 202 - 0
custom_components/tuya_local/devices/ea_carfridge.yaml

@@ -0,0 +1,202 @@
+name: Car fridge
+products:
+  - id: iyqhndov8rdzqrlq
+    manufacturer: EA
+    model: Dual zone car fridge
+entities:
+  - entity: switch
+    dps:
+      - id: 101
+        type: boolean
+        name: switch
+  # The device has separate Celsius (112-115) and Fahrenheit (117-120) dps, and
+  # only updates the set matching its display unit (dp 105).
+  - entity: climate
+    name: Zone A
+    icon: "mdi:fridge-top"
+    dps:
+      - id: 105
+        type: string
+        name: temperature_unit
+        mapping:
+          - dps_val: F
+            value: F
+          - value: C
+      - id: 110
+        type: boolean
+        name: hvac_mode
+        mapping:
+          - dps_val: true
+            value: cool
+          - dps_val: false
+            value: "off"
+      - id: 112
+        type: integer
+        name: current_temperature
+        mapping:
+          - constraint: temperature_unit
+            conditions:
+              - dps_val: F
+                value_redirect: current_temperature_f
+      - id: 114
+        type: integer
+        name: temperature
+        range:
+          min: -20
+          max: 20
+        mapping:
+          - constraint: temperature_unit
+            conditions:
+              - dps_val: F
+                value_redirect: temperature_f
+                range:
+                  min: -4
+                  max: 68
+      - id: 117
+        type: integer
+        name: current_temperature_f
+        hidden: true
+      - id: 119
+        type: integer
+        name: temperature_f
+        hidden: true
+        range:
+          min: -4
+          max: 68
+  - entity: climate
+    name: Zone B
+    icon: "mdi:fridge-bottom"
+    dps:
+      - id: 105
+        type: string
+        name: temperature_unit
+        mapping:
+          - dps_val: F
+            value: F
+          - value: C
+      - id: 111
+        type: boolean
+        name: hvac_mode
+        mapping:
+          - dps_val: true
+            value: cool
+          - dps_val: false
+            value: "off"
+      - id: 113
+        type: integer
+        name: current_temperature
+        mapping:
+          - constraint: temperature_unit
+            conditions:
+              - dps_val: F
+                value_redirect: current_temperature_f
+      - id: 115
+        type: integer
+        name: temperature
+        range:
+          min: -20
+          max: 20
+        mapping:
+          - constraint: temperature_unit
+            conditions:
+              - dps_val: F
+                value_redirect: temperature_f
+                range:
+                  min: -4
+                  max: 68
+      - id: 118
+        type: integer
+        name: current_temperature_f
+        hidden: true
+      - id: 120
+        type: integer
+        name: temperature_f
+        hidden: true
+        range:
+          min: -4
+          max: 68
+  - entity: lock
+    translation_key: child_lock
+    category: config
+    dps:
+      - id: 102
+        type: boolean
+        name: lock
+  - entity: select
+    translation_key: mode
+    icon: "mdi:snowflake"
+    dps:
+      - id: 103
+        type: string
+        name: option
+        mapping:
+          - dps_val: ECO
+            value: Eco
+          - dps_val: MAX
+            value: Max
+  - entity: select
+    name: Battery protection
+    icon: "mdi:car-battery"
+    category: config
+    translation_key: mode
+    dps:
+      - id: 104
+        type: string
+        name: option
+        mapping:
+          - dps_val: L
+            value: low
+          - dps_val: M
+            value: medium
+          - dps_val: H
+            value: high
+  - entity: select
+    translation_key: temperature_unit
+    category: config
+    dps:
+      - id: 105
+        type: string
+        name: option
+        mapping:
+          - dps_val: C
+            value: celsius
+          - dps_val: F
+            value: fahrenheit
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      # only reported when a fault is raised or cleared
+      - id: 106
+        type: bitfield
+        optional: true
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - dps_val: null
+            value: false
+          - value: true
+      - id: 106
+        type: bitfield
+        optional: true
+        name: fault_code
+  - entity: sensor
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 122
+        type: integer
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    class: battery
+    dps:
+      - id: 123
+        type: integer
+        name: sensor
+        unit: "%"
+        class: measurement