blackout26 Posted November 19 Posted November 19 Hallo zusammen, wer kann mir bitte helfen. Ich benötige eine Funktion (Skript) wenn ich dieses Starte das meine angeschlossene Hupe alle 60 Sekunden kurz hupt und das ganze soll sich 30 Minuten lang wiederholen. Wäre Super wenn mir da einer weiterhelfen kann. Dankeschön Gruß Walter Quote Translate Revert translation? English (American) Finnish French German Italian Portuguese (European) Spanish
Heinz Posted November 21 Posted November 21 here you go this is a script for that a shelly 1 let onTime = 60 * 1000; // ON duration in milliseconds (60 seconds) let offTime = 30 * 60 * 1000; // OFF duration in milliseconds (30 minutes) function controlRelay() { // Turn relay ON Shelly.call("Switch.Set", { id: 0, on: true }); print("Relay turned ON"); Timer.set(onTime, false, function () { // Turn relay OFF Shelly.call("Switch.Set", { id: 0, on: false }); print("Relay turned OFF"); // Schedule next ON Timer.set(offTime, false, function () { controlRelay(); // Restart the process }); }); } // Start the process when the script runs controlRelay(); Quote Translate Revert translation? English (American) Finnish French German Italian Portuguese (European) Spanish
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.