Przeglądaj źródła

Add Curtains with feedback

These follow the same dps layout as QS C01 curtains, but the current
position is accurately fed back on the position dp, as well as using
that dp to request a desired position.

Discussion #1681
Jason Rumney 2 lat temu
rodzic
commit
6c9551dc7a

+ 1 - 0
DEVICES.md

@@ -482,6 +482,7 @@ of device.
 - Simple garage door
 - Simple blind controller (two variants - `simple_blinds` lets the position be set, but does not trust it to accurately reflect the current position always, `position_blinds` does trust the position to accurately reflect the current position)
 - Simple gate opener (simple garage door with timer)
+- Curtain with feedback (same DP layout as QS C01 curtains, but reads back the current_position from the position as some of these seem to accuraately report position as well)
 - Abalon BCM700D curtain motor (likely to work with other brands)
 - AGL Ultracontato r2 door controller
 - AGL Ultra Magic gate opener

+ 53 - 0
custom_components/tuya_local/devices/curtain_with_feedback.yaml

@@ -0,0 +1,53 @@
+name: Curtain module
+primary_entity:
+  entity: cover
+  class: curtain
+  dps:
+    - id: 1
+      name: control
+      type: string
+      mapping:
+        - dps_val: open
+          value: open
+        - dps_val: close
+          value: close
+        - dps_val: stop
+          value: stop
+    - id: 2
+      name: position
+      type: integer
+      unit: "%"
+      range:
+        min: 0
+        max: 100
+      mapping:
+        - step: 10
+    - id: 2
+      name: current_position
+      type: integer
+secondary_entities:
+  - entity: select
+    name: Motor reverse mode
+    category: config
+    icon: "mdi:sign-direction"
+    dps:
+      - id: 8
+        name: option
+        type: string
+        mapping:
+          - dps_val: forward
+            value: Forward
+          - dps_val: back
+            value: Back
+  - entity: number
+    name: Travel time
+    category: config
+    icon: "mdi:timer"
+    dps:
+      - id: 10
+        name: value
+        type: integer
+        unit: s
+        range:
+          min: 1
+          max: 60