Jump to content
🌟 NOTIFICATION/Benachrichtigung: Welcome to our New Store! - shelly.com 🌟 ×

If_then_else

Members
  • Posts

    26
  • Joined

  • Letzter Besuch

About If_then_else

  • Birthday 03.01.1991

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

If_then_else's Achievements

Apprentice

Apprentice (3/14)

  • Reacting Well
  • Dedicated
  • Collaborator Rare
  • Week One Done
  • First Post

Recent Badges

5

Reputation

  1. @Mitch We had this discussion about 3 years ago {https://www.smarthome-forum.eu/thread/8739-deep-sleep-beim-shelly1/?postID=95027#post95027} and nothing has changed since then. Shelly only supports it for battery-operated devices and there is no script function for these.😉 If you do find a solution with the Shellys, you could post it here.
  2. Select the Eco Mode(It is't a usual DSM) , Flash with an other OS (No way back) or:
  3. @flejur With your new information the situation looks a little different. I think you can understand the matrix and adapt the script - code below yourself. /// Decode Inputs to Outputs V1.0 //////////////////////////////////////////////////////////////////////////////////////////// /// /// Created by if_then_else or HighFive © 2024 /// //////////////////////////////////////////////////////////////////////////////////////////// let log = 1; // If no console log needed please set log to "0" let inputStateOld = -1; //////////////////////////////////////////////////////////////////////////////////////////// function timerHandler() { let inputState = 0; //////////////////////////////////////////////////////////////////////////////////////////// /// Read all input //////////////////////////////////////////////////////////////////////////////////////////// if (Shelly.getComponentStatus('input:0').state === true) { inputState = inputState + 1; }; //////////////////////////////////////////////////////////////////////////////////////////// if (Shelly.getComponentStatus('input:1').state === true) { inputState = inputState + 2; }; //////////////////////////////////////////////////////////////////////////////////////////// if (Shelly.getComponentStatus('input:2').state === true) { inputState = inputState + 4; }; //////////////////////////////////////////////////////////////////////////////////////////// if (Shelly.getComponentStatus('boolean:200').value === true) { inputState = inputState + 8; }; //////////////////////////////////////////////////////////////////////////////////////////// /// Set Output relays //////////////////////////////////////////////////////////////////////////////////////////// Shelly.call("Switch.set", { 'id': 0, 'on': (inputState == 08) || (inputState == 09) || (inputState == 10) || (inputState == 11) || (inputState == 12) || (inputState == 13) || (inputState == 14) || (inputState == 15) }); //////////////////////////////////////////////////////////////////////////////////////////// Shelly.call("Switch.set", { 'id': 1, 'on': (inputState == 02) || (inputState == 03) || (inputState == 06) || (inputState == 07) }); //////////////////////////////////////////////////////////////////////////////////////////// Shelly.call("Switch.set", { 'id': 2, 'on': (inputState == 02) || (inputState == 03) || (inputState == 06) || (inputState == 07) || (inputState == 08) || (inputState == 09) || (inputState == 10) || (inputState == 11) || (inputState == 12) || (inputState == 13) || (inputState == 14) || (inputState == 15) }); //////////////////////////////////////////////////////////////////////////////////////////// /// Print all input and relay states to console window //////////////////////////////////////////////////////////////////////////////////////////// if ((log != 0) && (inputState != inputStateOld)) { print('Input number: ' + inputState + ' | Virtual input {bool:200}: ' + (Shelly.getComponentStatus('boolean:200')).value + ' | s1: ' + Shelly.getComponentStatus('input:0').state + ' | s2: ' + Shelly.getComponentStatus('input:1').state + ' | s3: ' + Shelly.getComponentStatus('input:2').state + ' | OUT1: ' + Shelly.getComponentStatus('switch', 0).output + ' | OUT2: ' + Shelly.getComponentStatus('switch', 1).output + ' | OUT3: ' + Shelly.getComponentStatus('switch', 2).output); }; inputStateOld = inputState; }; //////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////// Timer.set(1000, true, timerHandler, null); ////////////////////////////////////////////////////////////////////////////////////////////
  4. @SmurfnSurf I would like to set a few facts straight. My script proposal would be created based on the specification you formulated. (See below) - I am convinced that this will also be fulfilled with my proposal. ------------------------------------------------------------------------------------------------------------- I can tell from your last posting that you have very limited programming experience.😉 You are mixing actions, cyclic program sequences and event-triggered functions. You are also mixing various code examples from different authors. I will therefore take myself out of this matter and would advise you to read through this Shelly documentation.{Shelly documentations}
  5. Dir ist schon klar dass von den 8.2 Millarden Erdenbürger, weniger als 2% davon deutschsprachig sind? [*] [*] inkl. Deutschland, Österreich, Schweiz, Luxemburg, Liechtenstein, Belgien, Italien (Südtirol), auch (Namibia, Dänemark, Frankreich) Die deutsche Sprache ist hiermit auch weit hinter Englisch, Chinesisch, Spanisch, Französisch, Russisch, Indonesisch etc. am 11 od. 12 Platz. Quelle: https://de.wikipedia.org/wiki/Liste_der_meistgesprochenen_Sprachen - Die meisten Shelly Beiträge im Netz sind von den überwiegend internationalen Smarthome Freunden im Netz. - Der brauchbare Anteil der deutschsprachigen Beiträge, wird von mir geschätzt, auch bei den obigen rund 2% liegen. PS: "Ich bin auch kein Deutscher" frei nach J.F. Kennedy
  6. Wurde umbenannt... https://www.smarthome-forum.eu
  7. Ich denke es gibt vereinzelt auch deutsche Anleitungen. Jedoch sind die Mehrzahl der interessanten Beiträge überwiegend in Englisch. - Versuch dich mit Eng>Deu Übersetzern durchzukämpfen. 😉
  8. @Weidenhof1 Ja, die Funktion geht da jeder Ein/Ausgang komplet getrennt genutzt werden kann. (Detached)
  9. @flejur I would like to create an example script for you, but an analysis of your information raised some questions. Check my summary and let me know what is wrong, especially with the red fields.
  10. Script id kann nur zwischen 1..10 liegen. 😊 Also starte mal mit 1.. Beispiel: Da dieser Webhook nur ein Neustart nach Reboot unterbindet, jedoch das Script bereits schon gestartet ist, ist ein neuer Reboot notwendig.
  11. Geht sicherlich. Nur mit deiner obigen Spezifikation würde sofort nach dem Einschalten eine Benachrichtigung versendet. Oder meinst du einen Stromanstieg über beispielhaft > 5Amp. Auf welcher Phase A, B, C? Oder denkst du über einen Stromanstieg in einer bestimmten Zeit? Fragen über Fragen...
  12. @SmurfnSurf Below you will find a code sample which should meet your functional specification. /// Switch between different times V1.0 //////////////////////////////////////////////////////////////////////////////////////////// /// /// Created by "If then else" © 2024 /// //////////////////////////////////////////////////////////////////////////////////////////// function timerHandler() { // create a new Date object let now = new Date(); // get the current hour (from 0 to 23) let hour = now.getHours(); // get the current minute (from 0 to 59) let minute = now.getMinutes(); // get the current minutes of the actual day actdayminutes = (hour * 60) + minute; /// if ( ((actdayminutes >= (09 * 60) + 00) && (actdayminutes < (11 * 60) + 00)) /// (time greater than 9:00) AND (time less than 11:00) || ((actdayminutes >= (13 * 60) + 00) && (actdayminutes < (15 * 60) + 00)) /// (time greater than 13:00) AND (time less than 15:00) || ((actdayminutes >= (15 * 60) + 00) && (actdayminutes < (17 * 60) + 00))) { /// (time greater than 15:00) AND (time less than 17:00) // print('Time window activ'); // } else { // print('Time window not activ'); // }; }; //////////////////////////////////////////////////////////////////////////////////////////// Timer.set(1000, true, timerHandler, null); ////////////////////////////////////////////////////////////////////////////////////////////
  13. Mit diesem Feature würde sich Shelly von den Mitbewerbern abheben.
  14. Nun ohne eine vernünftige Spezifikation hast du schon viele Wünsche... Ich denke für diese einfache Lösung reicht für dich wenn du diese Checkbox in Echtzeit 😀 auswählst: Gute Nacht.
×
×
  • Erstelle neue...