Shelly Plus 1 and portal door

  • Hello,

    I just purchased a Shelly Plus 1 device to control my automatic portal door. I'm totally beginner with Shelly device. I setup the device and it's working correctly (connected to my wifi network), I set the output type as a Edge switch with a auto off timer at 0.5 so when I click on the button on the mobile app the Shelly device is sending a short ON/OFF 0.5s signal to the portal command board then the door is opening. To stop the door I have to click again to to button and click a third time to close the door.

    I'm trying to have this process automated as follow when clicking on the mobile app button:

    0.5s On/Off signal -> door is opening

    Timer 3 seconds

    0.5s On/Off signal -> door is stopped

    Timer 10 seconds

    0.5s On/Off signal -> door is closing

    I tried to do it with action based on Switch toggled off condition then adding the 2 following hit URLs:

    http://127.0.0.1/relay/0?turn=on&timer=3

    http://127.0.0.1/relay/0?turn=on&timer=10

    It seems that only the 10 seconds timer is taken into account and action is looping every 10 seconds, so I'm not sure if action is the best way to do it. Is anybody have a clue how to do this small automation when clicking on the mobile app button?

    Thank you very much for your valuable help.

  • I created a simple script that is doing more or less what I want :

    Code
        //open door during 6 seconds
        Shelly.call("Switch.set", {'id': 0, 'on': true});
        Timer.set(6000, false, function (ud) {
          Shelly.call("Switch.set", {'id': 0, 'on': true});
        }, null);
        
        //close the door after 30 seconds
        Timer.set(30000, false, function (ud) {
          Shelly.call("Switch.set", {'id': 0, 'on': true});
        }, null);

    Now the question is how to get this script executed when clicking on the application button?

  • I tried to use this condition to check if an event is occurring:

    Code
     Shelly.addEventHandler(function(e) {
      if (e.component === "input:0") {
        if (e.info.event === "single_push") {

    I think this event is related to a physical button connected to the Shelly input, is there a similar event to check event on the mobile App button?