Browse Source

Add support for Chiltrix CX50 Heat Pump (#4377)

* Add support for Chiltrix CX50 Heat Pump

Closes #4285

Model ID: e0iyd8
Device ID: kjf6gjn1kaawfyjk

* Fix chiltrix_cx50 device config to satisfy schema tests and update comments to satisfy lint

* fix (chiltrix_cx50_comboheatpump): rename file, add trailing newline

This is not a proper review, I was just fixing the lint error, and noticed the file name is missing info about the device type, which will make it difficult for users to identify a potential match.

PR #4377

* Reworked the config based on pull request feedback

* removed translation key statement

* fix (chilltrix_cx50_comboheatpump): naming and other changes

- top level name should be generic
- avoid ambiguous abbreviations in entity names
- avoid duplicate sensors
- use return temperature rather than output temperature as proxy for air heating temperature.
- add classes

PR #4377

---------

Co-authored-by: Christian Bartels <cb@MBPCB.theB.lan>
Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
cb2206 2 tuần trước cách đây
mục cha
commit
d656e2ed21

+ 3 - 1
DEVICES.md

@@ -94,6 +94,7 @@ devices # Supported
 - Brokton BRST12 air conditioner
 - Carson CB PA280
 - Cecotec ForceClima Soundless portable air conditioner
+- Chiltrix CX50 and CX35
 - Confortotal CICON242 mini split air conditioner
 - Cooper&Hunter Nordic Evo Ng
 - Costway portable air conditioner
@@ -424,7 +425,8 @@ devices # Supported
 - Siguro Air Master AP-K50 air purifier
 - Smartmi E1 and P1 air purifiers
 - Soho SO-350WUI Air Purifier
-- Soleusair A02 and A10 air purifiers

+- Soleusair A02 and A10 air purifiers
+
 - Stadler Form Roger air purifier
 - Tesla Smart S300, Pro and Mini air purifiers
 - TrueLife P3 and P7 air purifiers

+ 349 - 0
custom_components/tuya_local/devices/chiltrix_cx50_comboheatpump.yaml

@@ -0,0 +1,349 @@
+name: Combo heat pump
+products:
+  - id: kjf6gjn1kaawfyjk
+    manufacturer: Chiltrix
+    model: CX50
+
+entities:
+  # PRIMARY HVAC (CLIMATE)
+  - entity: climate
+    name: Air
+    dps:
+      # Power control
+      - id: 126
+        type: boolean
+        name: hvac_mode
+        mapping:
+          - dps_val: false
+            value: "off"
+            available: water_off
+          - dps_val: true
+            constraint: mode
+            conditions:
+              - dps_val: "cool"
+                value: cool
+                available: water_off
+              - dps_val: "heat"
+                value: heat
+                available: water_off
+              - dps_val: "dhw"
+                value: "off"
+                available: water_on
+              - dps_val: "cool_dhw"
+                value: cool
+                available: water_on
+              - dps_val: "heat_dhw"
+                value: heat
+                available: water_on
+
+      # Mode enum
+      - id: 130
+        type: string
+        name: mode
+        hidden: true
+
+      # Helper: water heating inactive
+      - id: 130
+        type: string
+        name: water_off
+        hidden: true
+        mapping:
+          - dps_val: "cool"
+            value: true
+          - dps_val: "heat"
+            value: true
+          - value: false
+
+      # Helper: water heating active
+      - id: 130
+        type: string
+        name: water_on
+        hidden: true
+        mapping:
+          - dps_val: "dhw"
+            value: true
+          - dps_val: "cool_dhw"
+            value: true
+          - dps_val: "heat_dhw"
+            value: true
+          - value: false
+
+      # Target temperature (return water setpoint for HVAC)
+      - id: 101
+        type: integer
+        name: temperature
+        unit: C
+        range:
+          min: 0
+          max: 80
+
+      # Current temperature (return water as proxy)
+      - id: 111
+        type: integer
+        name: current_temperature
+
+  # DHW WATER HEATER
+  - entity: water_heater
+    name: DHW
+    dps:
+      # Power & operation mode combined
+      - id: 126
+        type: boolean
+        name: operation_mode
+        mapping:
+          - dps_val: false
+            value: "off"
+            available: air_off
+          - dps_val: true
+            constraint: mode
+            conditions:
+              - dps_val: "dhw"
+                value: heat_pump
+                available: air_off
+              - dps_val: "cool"
+                value: "off"
+                available: air_cool
+              - dps_val: "cool_dhw"
+                value: heat_pump
+                available: air_cool
+              - dps_val: "heat"
+                value: "off"
+                available: air_heat
+              - dps_val: "heat_dhw"
+                value: heat_pump
+                available: air_heat
+
+      # Mode enum (hidden)
+      - id: 130
+        type: string
+        name: mode
+        hidden: true
+
+      # Helper: air off (dhw only)
+      - id: 130
+        type: string
+        name: air_off
+        hidden: true
+        mapping:
+          - dps_val: "dhw"
+            value: true
+          - value: false
+
+      # Helper: air cooling active
+      - id: 130
+        type: string
+        name: air_cool
+        hidden: true
+        mapping:
+          - dps_val: "cool"
+            value: true
+          - dps_val: "cool_dhw"
+            value: true
+          - value: false
+
+      # Helper: air heating active
+      - id: 130
+        type: string
+        name: air_heat
+        hidden: true
+        mapping:
+          - dps_val: "heat"
+            value: true
+          - dps_val: "heat_dhw"
+            value: true
+          - value: false
+
+      # DHW setpoint
+      - id: 102
+        type: integer
+        name: temperature
+        unit: C
+        range:
+          min: 10
+          max: 70
+
+      # Current DHW temperature
+      - id: 113
+        type: integer
+        name: current_temperature
+
+  # EXTRA CONFIG NUMBERS
+  - entity: number
+    name: Minimum water flow
+    category: config
+    class: volume_flow_rate
+    dps:
+      - id: 103
+        type: integer
+        name: value
+        unit: L/min
+        range:
+          min: 0
+          max: 60
+
+  # TEMPERATURE & FLOW SENSORS
+  - entity: sensor
+    name: Output temperature
+    class: temperature
+    category: diagnostic
+    icon: "mdi:thermometer-chevron-down"
+    dps:
+      - id: 112
+        type: integer
+        name: sensor
+        unit: °C
+        class: measurement
+        mapping:
+          - scale: 10
+
+  - entity: sensor
+    name: Air conditioning water flow
+    category: diagnostic
+    class: volume_flow_rate
+    dps:
+      - id: 114
+        type: integer
+        name: sensor
+        unit: L/min
+        class: measurement
+
+  - entity: sensor
+    name: Compressor temperature
+    class: temperature
+    category: diagnostic
+    icon: "mdi:fire"
+    dps:
+      - id: 115
+        type: integer
+        name: sensor
+        unit: °C
+        class: measurement
+
+  - entity: sensor
+    name: Coil temperature
+    class: temperature
+    category: diagnostic
+    icon: "mdi:pipe"
+    dps:
+      - id: 116
+        type: integer
+        name: sensor
+        unit: °C
+        class: measurement
+
+  - entity: sensor
+    name: Ambient temperature
+    class: temperature
+    category: diagnostic
+    icon: "mdi:thermometer-lines"
+    dps:
+      - id: 117
+        type: integer
+        name: sensor
+        unit: °C
+        class: measurement
+
+  - entity: sensor
+    name: Compressor return temperature
+    class: temperature
+    category: diagnostic
+    icon: "mdi:fan"
+    dps:
+      - id: 118
+        type: integer
+        name: sensor
+        unit: °C
+        class: measurement
+
+  - entity: sensor
+    name: Exchange plate temperature
+    class: temperature
+    category: diagnostic
+    icon: "mdi:pipe-wrench"
+    dps:
+      - id: 119
+        type: integer
+        name: sensor
+        unit: °C
+        class: measurement
+
+  # ELECTRICAL / SPEED
+  - entity: sensor
+    name: Compressor frequency
+    class: frequency
+    category: diagnostic
+    icon: "mdi:engine"
+    dps:
+      - id: 106
+        type: integer
+        name: sensor
+        unit: Hz
+        class: measurement
+
+  - entity: sensor
+    name: Fan speed
+    category: diagnostic
+    icon: "mdi:fan-auto"
+    dps:
+      - id: 107
+        type: integer
+        name: sensor
+        unit: rpm
+        class: measurement
+
+  - entity: sensor
+    class: current
+    category: diagnostic
+    dps:
+      - id: 108
+        type: integer
+        name: sensor
+        unit: A
+        class: measurement
+        mapping:
+          - scale: 10
+
+  # RAW STATUS WORD
+  - entity: sensor
+    name: Status bits
+    category: diagnostic
+    icon: "mdi:information-outline"
+    hidden: true
+    dps:
+      - id: 120
+        type: integer
+        name: sensor
+
+  # FAULT STATUS (BINARY_SENSOR)
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      # Main fault detection from group 1
+      - id: 104
+        type: string
+        name: sensor
+        mapping:
+          - dps_val: "eorr0"
+            value_redirect: fault_group_2
+          - value: true
+
+      # Fault code 1 as attribute
+      - id: 104
+        type: string
+        name: fault_code
+
+      # Fallback to group 2
+      - id: 105
+        type: string
+        name: fault_group_2
+        hidden: true
+        mapping:
+          - dps_val: "eorr0"
+            value: false
+          - value: true
+
+      # Fault code 2 as attribute
+      - id: 105
+        type: string
+        name: fault_code_2