// Simultaneously close for a few seconds, then open multiple relays to simulate an "open door" button press const relays = [0, 1] for (const relayID of relays) { // https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Switch/#switchset Shelly.call("Switch.Set", { id: relayID, on: true, toggle_after: 5, // turn off after 5 sec }); } // https://shelly-forum.com/thread/20984-how-to-instruct-to-end-script-within-script-itself/ Shelly.call('Script.Stop', { id: Shelly.getCurrentScriptId() });