Script for Cover

  • Hello,

    i need to support a particular motor blind (see image attached). I have connect the circuit with myne Shelly PRO 2PM and set it in Cover mode. If i press the Up or Down button it works but the problem is the stop button.

    I'm so tring to implement a script for make it working.

    In this script what i want to do is:

    - store a status of the action that the cover is doing

    - based on the status for stop the blind i have to set the shelly in stop mode and then re-set the output in open or close. This stop the blind.

    The problem is that seems the status variable not store the value 1 or 2.

    this is the log:

    Code
    opening
    INPUT: Cover is now opening
    
    stopped
    INPUT: Cover button stop
    STATUS: Cover to stop:
    0
    undefined
    INPUT: Cover button stop

    why the status not take the value?

    Thanks

  • If i see right, variable e is not defined.

  • Hello,

    e seems not be the problem. In the script i can reach the line 24 but after that status value is always different from 1 or 2.

    The variable status not keep the value.

    Thanks