Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. [gelöst] Schaltzustand Verzögern

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    [gelöst] Schaltzustand Verzögern

    This topic has been deleted. Only users with topic management privileges can see it.
    • paul53
      paul53 @Aphofis last edited by paul53

      @Aphofis sagte:

      gibt es dann eine telegram nachricht

      Ja, das ist der unterste Teil im Skript (Zeilen 69 - 77).

      on({id: 'sonoff.0.Aqua_Power.POWER3', change: "ne"}, function (obj) {
        var txt;  
        if (obj.state.val) txt = text_ein;   
        else txt = text_aus;   
        sendTo("telegram.0", "send", {
          text: txt
        });
        log(txt);
      });
      
      Aphofis 1 Reply Last reply Reply Quote 0
      • Aphofis
        Aphofis @paul53 last edited by

        @paul53
        OK und nach einem Pi Neustart bleibt die restzeit verfügbar was am Tag dosiert werden darf !?

        paul53 1 Reply Last reply Reply Quote 0
        • paul53
          paul53 @Aphofis last edited by paul53

          @Aphofis sagte:

          nach einem Pi Neustart bleibt die restzeit verfügbar was am Tag dosiert werden darf !?

          Ja, dafür sorgen die Zeilen 16 und 29.

          Aphofis 1 Reply Last reply Reply Quote 0
          • Aphofis
            Aphofis @paul53 last edited by

            @paul53
            OK
            Die Steuerung läuft jetzt! Ich werde dann berichten ob alles tadellos läuft und auch keine zu viel dosierungen mehr vorkommen.
            Zumindest hoffe ich es! Wenn Osmose Schwimmer false ist sollte zumindet nix mehr laufen.
            Als ich das JS gestartet hatte, ist die Osmose auch los gelaufen da ca. 2 Liter fehlten.
            Hatte Heute gegen Mittag die Osmose Steuerung per VPN deaktiviert da ich nicht wieder eine Überrasschung haben wollte.
            Osmose hat mit der JS Steuerung 3 mal dosiert jetzt ist momentan Ruhe und Schwimmer ist false und Magnet Ventil auch also alles wie es soll.
            Wenn Filter Max von True in false wechselt wann wird der Skimmer wieder eingeschaltet ?

            paul53 1 Reply Last reply Reply Quote 0
            • paul53
              paul53 @Aphofis last edited by paul53

              @Aphofis sagte:

              Wenn Filter Max von True in false wechselt wann wird der Skimmer wieder eingeschaltet ?

              Ja, mit 10 s Verzögerung gegenüber Magnetventil: Zeile 60.
              Also insgesamt 20 s Verzögerung, nachdem Filter Max von true in false wechselt.

              Aphofis 1 Reply Last reply Reply Quote 0
              • Aphofis
                Aphofis @paul53 last edited by Aphofis

                @paul53 OK Prima!
                Dafür das bei mir ein JS jetzt die Osmose und Filter MAx übernommen hat, muss ich dir nun Löcher in Bauch fragen!!! Ich hoffe das ist OK

                paul53 1 Reply Last reply Reply Quote 0
                • paul53
                  paul53 @Aphofis last edited by

                  @Aphofis sagte:

                  Ich hoffe das ist OK

                  Ja, besser als ein Blockly, bei dem Du dann noch die richtigen Datenpunkt-IDs zuordnen müsstest.

                  Aphofis 1 Reply Last reply Reply Quote 0
                  • Aphofis
                    Aphofis @paul53 last edited by

                    @paul53 Punkt für Dich !!! 😊

                    1 Reply Last reply Reply Quote 0
                    • Aphofis
                      Aphofis last edited by

                      @paul53
                      Jetzt gerade wurde wieder zu viel dosiert
                      Wie kommt sowas ?

                      E453A3D9-DE9F-458D-B9C2-B1CB26221496.jpeg

                      1 Reply Last reply Reply Quote 0
                      • Aphofis
                        Aphofis last edited by

                        Osmose Schwimmer ist false und Magnet Ventil läuft einfach weiter zumindest in Objekte in ioBroker ist der datenpunkt Osmose Niveau Schwimmer false und in der Web Oberfläche vom tasmota gerät

                        paul53 1 Reply Last reply Reply Quote 0
                        • paul53
                          paul53 @Aphofis last edited by

                          @Aphofis sagte:

                          Osmose Schwimmer ist false und Magnet Ventil läuft einfach weiter

                          Laufen die Wellen-Skripte, so dass der Computer vielleicht überlastet ist ?

                          Aphofis 1 Reply Last reply Reply Quote 0
                          • Aphofis
                            Aphofis @paul53 last edited by Aphofis

                            @paul53
                            Nein die sind aus!
                            16% RAM sind frei

                            paul53 1 Reply Last reply Reply Quote 0
                            • paul53
                              paul53 @Aphofis last edited by paul53

                              @Aphofis
                              Sollte eigentlich nicht nötig sein, aber füge mal im Skript in Zeile 37 (s. Skript oben) ein:

                                else setState("sonoff.0.Aqua_Control.POWER1"/*Osmose_Magnetventil*/, false);
                              
                              Aphofis 1 Reply Last reply Reply Quote 0
                              • Aphofis
                                Aphofis @paul53 last edited by

                                @paul53 mach ich!

                                Mein Script sieht so aus

                                const idRestzeit = 'Osmose.Restzeit';
                                
                                const text_ein = ['Filter Max unterschritten, Skimmer & Osmose','\n','wurden wieder eingeschaltet'].join('');
                                
                                const text_aus = ['Filter Max erreicht, Skimmer & Osmose','\n','wurden abgeschaltet'].join('');
                                
                                 
                                
                                createState(idRestzeit, 300, {type: 'number', unit: 's'});
                                
                                 
                                
                                var Osmosefreigabe = !getState('sonoff.0.Aqua_Float.POWER4').val;
                                
                                var Schwimmer = getState("sonoff.0.Aqua_Float.POWER1").val;
                                
                                var Restzeit, timeout_aus, timeout_ein, Magnetventil_Kontrolle;
                                
                                 
                                
                                function Magnetventil_Ein() {
                                
                                  if (!Magnetventil_Kontrolle && Restzeit > 0 && Osmosefreigabe) {
                                
                                    Magnetventil_Kontrolle = setInterval(function () {
                                
                                      if (Restzeit > 0 && Schwimmer && Osmosefreigabe) {
                                
                                        Restzeit--;
                                
                                        setState(idRestzeit, 2 * Restzeit, true);
                                
                                      } else {
                                
                                        setState("sonoff.0.Aqua_Control.POWER1"/*Osmose_Magnetventil*/, false);
                                
                                        clearInterval(Magnetventil_Kontrolle); 
                                
                                        Magnetventil_Kontrolle = null;
                                
                                      }
                                
                                    }, 2000);
                                
                                    setState("sonoff.0.Aqua_Control.POWER1"/*Osmose_Magnetventil*/, true);
                                
                                  }
                                
                                }
                                
                                 
                                
                                // Skripstart
                                
                                setTimeout(function() {
                                
                                    Restzeit = getState(idRestzeit).val / 2;
                                
                                    if(Schwimmer && Osmosefreigabe) Magnetventil_Ein();
                                
                                    else setState("sonoff.0.Aqua_Control.POWER1"/*Osmose_Magnetventil*/, false);
                                
                                }, 200);
                                
                                 
                                
                                on({id: 'sonoff.0.Aqua_Float.POWER1', change: "ne"}, function (obj) {
                                
                                  Schwimmer = obj.state.val;
                                
                                  if(Schwimmer) Magnetventil_Ein();
                                
                                });
                                
                                 
                                
                                schedule("0 0 * * *", function () {
                                
                                  Restzeit = 150;
                                
                                  setState(idRestzeit, 300, true);
                                
                                  if(Schwimmer) Magnetventil_Ein();
                                
                                });
                                
                                 
                                
                                on({id: 'sonoff.0.Aqua_Float.POWER4', change: "ne"}, function (obj) {
                                
                                  if (obj.state.val) {
                                
                                    timeout_aus = setTimeout(function () {
                                
                                      Osmosefreigabe = false;  
                                
                                      setState("sonoff.0.Aqua_Power.POWER3"/*Aqua_Power_Skimmer*/, false);
                                
                                      setState("sonoff.0.Aqua_Control.POWER1"/*Osmose_Magnetventil*/, false);
                                
                                    }, 5000);
                                
                                    if (timeout_ein) {
                                
                                        clearTimeout(timeout_ein); 
                                
                                        timeout_ein = null;
                                
                                    }
                                
                                  } else {
                                
                                    timeout_ein = setTimeout(function () {
                                
                                      Osmosefreigabe = true;
                                
                                      if(Schwimmer) Magnetventil_Ein();                
                                
                                      setStateDelayed("sonoff.0.Aqua_Power.POWER3"/*Aqua_Power_Skimmer*/, true, 10000);
                                
                                    }, 10000);
                                
                                    if (timeout_aus) {
                                
                                        clearTimeout(timeout_aus); 
                                
                                        timeout_aus = null;
                                
                                    }
                                
                                  }
                                
                                });
                                
                                 
                                
                                on({id: 'sonoff.0.Aqua_Power.POWER3', change: "ne"}, function (obj) {
                                
                                  var txt;  
                                
                                  if (obj.state.val) txt = text_ein;   
                                
                                  else txt = text_aus;   
                                
                                  sendTo("telegram.0", "send", {
                                
                                    text: txt
                                
                                  });
                                
                                  log(txt);
                                
                                });
                                

                                Wo soll ich es hier einfügen ?

                                paul53 1 Reply Last reply Reply Quote 0
                                • paul53
                                  paul53 @Aphofis last edited by

                                  @Aphofis sagte:

                                  Wo soll ich es hier einfügen ?

                                  In Zeile 72.

                                  Aphofis 1 Reply Last reply Reply Quote 0
                                  • Aphofis
                                    Aphofis @paul53 last edited by

                                    @paul53
                                    nach:

                                    if(Schwimmer) Magnetventil_Ein();
                                     else setState("sonoff.0.Aqua_Control.POWER1"/*Osmose_Magnetventil*/, false); 
                                    
                                    paul53 1 Reply Last reply Reply Quote 0
                                    • paul53
                                      paul53 @Aphofis last edited by paul53

                                      @Aphofis sagte:

                                      nach:

                                      Richtig. Und in Zeile 70 füge noch ein Log ein, um zu sehen ob richtig getriggert wird:

                                        log('Schwimmer: ' + Schwimmer);
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • Aphofis
                                        Aphofis last edited by

                                        ok
                                        korrekt?

                                        on({id: 'sonoff.0.Aqua_Float.POWER1', change: "ne"}, function (obj) {
                                        
                                          Schwimmer = obj.state.val;
                                        
                                          if(Schwimmer) Magnetventil_Ein();
                                        
                                         else setState("sonoff.0.Aqua_Control.POWER1"/*Osmose_Magnetventil*/, false); 
                                         
                                        });
                                        
                                        paul53 1 Reply Last reply Reply Quote 0
                                        • paul53
                                          paul53 @Aphofis last edited by paul53

                                          @Aphofis sagte:

                                          korrekt?

                                          Ja, jedoch die Leerzeilen sind überflüssig: Sie entstehen beim Kopieren aus dem Forum.

                                          Aphofis 1 Reply Last reply Reply Quote 0
                                          • Aphofis
                                            Aphofis last edited by

                                            Magnetventil Stecker ist wieder drin JS neu gestartet.
                                            OK also kann ich die rasu nehmen?

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            815
                                            Online

                                            32.0k
                                            Users

                                            80.4k
                                            Topics

                                            1.3m
                                            Posts

                                            4
                                            262
                                            16348
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo