Explorar o código

Eruiklink curtain: use current_position to determine state

Description of situation_set seems to indicate that it should be the
reliable way to tell if the curtain is fully opened or fully closed, but
it does not seem to be the case.

Issue #1735
Jason Rumney hai 1 ano
pai
achega
1da9cfa103

+ 7 - 5
custom_components/tuya_local/devices/eruiklink_curtains.yaml

@@ -27,6 +27,9 @@ primary_entity:
     - id: 3
     - id: 3
       type: integer
       type: integer
       name: current_position
       name: current_position
+      range:
+        min: 0
+        max: 100
       mapping:
       mapping:
         - invert: true
         - invert: true
     - id: 7
     - id: 7
@@ -35,21 +38,20 @@ primary_entity:
       mapping:
       mapping:
         - dps_val: opening
         - dps_val: opening
           value: opening
           value: opening
-          constraint: situation_set
+          constraint: current_position
           conditions:
           conditions:
-            - dps_val: fully_open
+            - dps_val: 0
               value: opened
               value: opened
         - dps_val: closing
         - dps_val: closing
           value: closing
           value: closing
-          constraint: situation_set
+          constraint: current_position
           conditions:
           conditions:
-            - dps_val: fully_close
+            - dps_val: 100
               value: closed
               value: closed
     - id: 11
     - id: 11
       type: string
       type: string
       name: situation_set
       name: situation_set
       optional: true
       optional: true
-      persist: false
 secondary_entities:
 secondary_entities:
   - entity: select
   - entity: select
     name: Direction
     name: Direction