Browse Source

Add support for Qlima MS-AC 5002 portable air conditioner (#5407)

* Create qlima_yfa05c.yaml

Add support for Qlima MS-AC 5002

* Update qlima_yfa05c.yaml

Specfial handling of the SLEEP setting, in the device it is a mode, but HA doesn't know about a mode called SLEEP.

* Rename qlima_yfa05c.yaml to qlima_yfa05c_air_conditioner.yaml

Renamed it to match existing naming convention

* Update and rename qlima_yfa05c_air_conditioner.yaml to qlima_ms_ac_5002_air_conditioner.yaml

Renamed the file to reflect the retailers name of the device instead of tuyas

* Update qlima_ms_ac_5002_air_conditioner.yaml

There are only two fan speeds in this firmware

* Update qlima_ms_ac_5002_air_conditioner.yaml

Added the missing space on line 86

* Rename device and modify COOL state property

Thanks for the review! I've updated the profile to use a generic top-level name, marked the SLEEP mapping as hidden: true, and added a default mapping for the Sleep switch so all non-SLEEP modes correctly map to false.
Kenneth Fribert 1 week ago
parent
commit
21e773046e

+ 197 - 0
custom_components/tuya_local/devices/qlima_ms_ac_5002_air_conditioner.yaml

@@ -0,0 +1,197 @@
+name: Air conditioner
+
+products:
+  - id: ryylocvd0dyrdekd
+    manufacturer: Qlima
+    model: MS-AC 5002
+
+# -----------------------------------------------------------------------------
+# Qlima retail model:
+#   MS-AC 5002
+#
+# Tuya reported model:
+#   YFA-05C
+#
+# This model is based on the Carson CB platform but uses a different firmware.
+#
+# Sleep mode is NOT exposed as DP101.
+#
+# Instead, DP4 (mode) reports one of:
+#
+#   COOL
+#   HEAT
+#   DRY
+#   FAN
+#   SLEEP
+#
+# When Sleep is active:
+#
+#   • DP4 changes from COOL to SLEEP.
+#   • No other datapoints change.
+#   • DP101 is not present.
+#   • Selecting another HVAC mode is ignored by the firmware.
+#   • Power cycling exits Sleep and returns to COOL.
+#
+# To avoid the climate entity becoming "unknown", SLEEP is treated as COOL
+# while a dedicated Sleep switch is implemented using DP4.
+# -----------------------------------------------------------------------------
+
+entities:
+  - entity: climate
+    dps:
+      - id: 1
+        name: hvac_mode
+        type: boolean
+        mapping:
+          - dps_val: false
+            value: "off"
+          - dps_val: true
+            constraint: mode
+            conditions:
+              - dps_val: COOL
+                value: cool
+              - dps_val: SLEEP
+                value: cool
+                hidden: true
+              - dps_val: FAN
+                value: fan_only
+              - dps_val: DRY
+                value: dry
+              - dps_val: HEAT
+                value: heat
+
+      - id: 2
+        name: temperature
+        type: integer
+        range:
+          min: 16
+          max: 30
+        mapping:
+          - constraint: temperature_unit
+            conditions:
+              - dps_val: "F"
+                range:
+                  min: 60
+                  max: 86
+        optional: true
+
+      - id: 3
+        name: current_temperature
+        type: integer
+
+      - id: 4
+        name: mode
+        type: string
+        hidden: true
+
+      - id: 5
+        name: fan_mode
+        type: integer
+        mapping:
+          - dps_val: 1
+            value: low
+          - dps_val: 2
+            value: high
+
+      - id: 19
+        name: temperature_unit
+        type: string
+
+      - id: 104
+        name: swing_mode
+        type: boolean
+        mapping:
+          - dps_val: true
+            value: vertical
+          - dps_val: false
+            value: "off"
+
+      - id: 110
+        name: model_code
+        type: integer
+
+  - entity: select
+    translation_key: temperature_unit
+    category: config
+    dps:
+      - id: 19
+        type: string
+        name: option
+        mapping:
+          - dps_val: C
+            value: celsius
+          - dps_val: F
+            value: fahrenheit
+
+  # Sleep is implemented as DP4="SLEEP" rather than a dedicated boolean DP.
+  - entity: switch
+    translation_key: sleep
+    dps:
+      - id: 4
+        name: switch
+        type: string
+        mapping:
+          - dps_val: SLEEP
+            value: true
+          - dps_val: COOL
+            value: false
+          - value: false
+
+  - entity: binary_sensor
+    translation_key: defrost
+    category: diagnostic
+    dps:
+      - id: 102
+        type: boolean
+        name: sensor
+
+  - entity: number
+    translation_key: timer
+    class: duration
+    category: config
+    dps:
+      - id: 103
+        type: integer
+        name: value
+        unit: h
+        range:
+          min: 0
+          max: 24
+
+  - entity: sensor
+    translation_key: time_remaining
+    class: duration
+    category: diagnostic
+    dps:
+      - id: 105
+        type: integer
+        name: sensor
+        unit: min
+        class: measurement
+
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 106
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            constraint: fault_code_2
+            conditions:
+              - dps_val: 0
+                value: false
+              - dps_val: null
+                value: false
+            value: true
+          - value: true
+
+      - id: 106
+        name: fault_code
+        type: bitfield
+
+      - id: 111
+        type: bitfield
+        name: fault_code_2
+        optional: true