Przeglądaj źródła

Create vta+_fan_heater

This creates a new device that wasn't recognised and i tested fully via Studio Code Server. I took inspiration from the nedis_ptc_fan_heater.yaml, but that device has much more functions and dps not marked as optionals, so it wouldn't recognise my device. That Fan heater has a great feature that use constraints the hvac_mode with preset_mode, so the fan only option that is reported as preset, now works as a hvac_mode. I also improved the code by adding a "null" dps_val on the conditions, using the documentation of the integration that previously reported an error when selecting this "custom" hvac_mode. I found an error on the nedis_ptc .yaml timer values, that i intend to correct in another pull request.
MigSo 1 rok temu
rodzic
commit
5acb7aef4b

+ 78 - 0
custom_components/tuya_local/devices/vta+_fan_heater

@@ -0,0 +1,78 @@
+name: Fan heater
+products:
+  - id: ebcb3fda096d331d27h8yc
+    name: VTA+ AXIAL Fan Heater
+primary_entity:
+  entity: climate
+  translation_only_key: heater
+  dps:
+    - id: 1
+      type: boolean
+      name: hvac_mode
+      mapping:
+        - dps_val: false
+          value: "off"
+        - dps_val: true
+          constraint: preset_mode
+          conditions:
+            - dps_val: "null"
+              value: fan_only
+            - dps_val: "level_1"
+              value: fan_only
+            - dps_val: "level_2"
+              value: heat
+            - dps_val: "level_3"
+              value: heat
+    - id: 5
+      name: preset_mode
+      type: string
+      mapping:
+        - dps_val: "level_1"
+          value: none
+          hidden: true
+        - dps_val: "level_2"
+          value: eco
+        - dps_val: "level_3"
+          value: boost
+    - id: 8
+      type: boolean
+      name: swing_mode
+      mapping:
+        - dps_val: false
+          value: "off"
+        - dps_val: true
+          value: "on"
+secondary_entities:
+  - entity: lock
+    translation_key: child_lock
+    category: config
+    dps:
+      - id: 7
+        name: lock
+        type: boolean
+  - entity: select
+    translation_key: timer
+    category: config
+    dps:
+      - id: 19
+        name: option
+        type: string
+        mapping:
+          - dps_val: "cancel"
+            value: cancel
+          - dps_val: "1h"
+            value: "1h"
+          - dps_val: "2h"
+            value: "2h"
+          - dps_val: "4h"
+            value: "4h"
+          - dps_val: "8h"
+            value: "8h"
+  - entity: sensor
+    translation_key: time_remaining
+    class: duration
+    dps:
+      - id: 20
+        type: integer
+        name: sensor
+        unit: min