Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const sourceInputId = 0; // If using multiple switches, update (0 is the first, 1 is the second, etc.)
- const sourceInputEventType = "single_push"; // single_push / long_push / double_push
- const targetSwitch = "0"; // Update if multiple outputs on the remote relay and it's not the first
- const httpIP = "10.1.1.1"; // update with the IP of your remote Shelly
- const httpPassword = "password"; // update with the web password for it
- Shelly.addEventHandler(function (event) {
- if (event.name === "input" && event.id === sourceInputId && event.info.event === sourceInputEventType) {
- Shelly.call(
- "HTTP.GET",
- {
- "url": "http://admin:" + httpPassword + "@" + httpIP + "/relay/" + targetSwitch + "?turn=toggle"
- }
- )
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment