Last active
August 8, 2025 19:56
-
-
Save liddiard/b7f80a18b9713dbf5489f85f3077f95d to your computer and use it in GitHub Desktop.
Script for the Shelly Plus Uni board that triggers a door unlock when wired to an apartment unit call box.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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() | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment