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

      @Aphofis sagte:

      Ich schnalle die Struktur nicht so ganz!

      Die vorherige Version war besser !

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

        @paul53
        Na toll

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

          @Aphofis
          Nimm diese:
          Osmose.js.txt

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

            @paul53
            Da fehlt dann nur

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

              @Aphofis sagte:

              Da fehlt dann nur

              Wo ?

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

                @paul53
                In der txt die ich nehmen sollte oder ist der Log da schon irgendwo drin?

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

                  @Aphofis sagte:

                  ist der Log da schon irgendwo drin?

                  Zeile 36.

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

                    @paul53 Das hab ich wohl nicht so ganz gefunden!
                    Wird wohl auch noch eine Zeit dauern, bis ich JS lesen kann

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

                      @paul53
                      Bis jetzt macht die Osmose Steuerung was sie soll!
                      Wird nicht zu viel dosiert und Filter Max wurde seid gestern Abend nicht erreicht

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

                        @Aphofis sagte:

                        Wird nicht zu viel dosiert

                        Wenn vorher zuviel dosiert wurde, dann war die Abfrage des Schwimmers alle 2 Sekunden zu langsam. Jetzt wird direkt auf den Schwimmer reagiert.

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

                          @paul53
                          klingt toll aber heute wurde wieder bis filter max true war dosiert.
                          bringt es was den wert auf 500 ms zu stellen???

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

                            @Aphofis sagte:

                            bringt es was den wert auf 500 ms zu stellen???

                            Nein, das Magnetventil wird direkt vom Trigger des Schwimmers geschlossen. Schneller geht es per Software (JS) nicht. Die Frage ist, ob das setState() wirklich zuverlässig das Ventil steuert oder es bei zuviel Verkehr im 2,4-GHz-Band ins Leere läuft, bzw. ob jedes Schwimmer-Signal zuverlässig in ioBroker ankommt.
                            Wenn der Schwimmer noch einen zweiten potentialfreien Kontakt hat, würde ich ihn in Reihe (UND-Verknüpfung) zwischen Sonoff-Aktor und Magnetventil schalten.

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

                              @paul53 nein leider nicht es sind normale Schwimmer mit einem pull-up Widerstand dazwischen mehr nicht

                              4AB02CC9-69A7-4195-912C-63E0CB598CF2.jpeg
                              Kann man nicht die sende Intervalle vom ESP8266 verkürzen !?

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

                                @Aphofis sagte:

                                Kann man nicht die sende Intervalle vom ESP8266 verkürzen !?

                                Keine Ahnung, mit dem WLAN-Zeugs kenne ich mich nicht aus, da ich es nicht verwende.

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

                                  @paul53
                                  Naja ich kenne mich eigntl damit aus!
                                  Nur vllt liegt es an was anderem.
                                  hatte jetzt 2 liter wasser raus Filter max ist false aber Skimmer wird nicht wieder eingeschaltet. Relais ist aus und im Sonoff andapter ist er auch false
                                  Das meine ich damit wenn ich sage Blockly ist mir lieber! da ich dann selbst guchen kann. Bei einem JS weiß ich nicht wie ich die einzelnen Datenpunkte kontrollieren soll.

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

                                    Datenpunkte zum Skimmer

                                    sonoff.0.Aqua_Power.POWER3
                                    

                                    sind alle richtog gesetzt

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

                                      @paul53
                                      ist hier denn alles Korrekt an Code!?

                                      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;
                                        log('Schwimmer: ' + Schwimmer)
                                        if(Schwimmer) Magnetventil_Ein();
                                        else setState("sonoff.0.Aqua_Control.POWER1"/*Osmose_Magnetventil*/, false);
                                      });
                                      
                                      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);
                                      });
                                      
                                      paul53 1 Reply Last reply Reply Quote 0
                                      • paul53
                                        paul53 @Aphofis last edited by

                                        @Aphofis sagte:

                                        ist hier denn alles Korrekt an Code!?

                                        Ja.

                                        @Aphofis sagte in Schaltzustand Verzögern:

                                        Filter max ist false aber Skimmer wird nicht wieder eingeschaltet.

                                        Der Skimmer wird durch das Skript nach 20 s eingeschaltet, nachdem der Max-Schwimmer auf false wechselt (Zeile 62).

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

                                          @paul53
                                          tut's nur leider nicht!!!
                                          Per Datenpunkt lässt sich der Skimmer tadellos einschalten.
                                          Gibt es in dem JS eine Kontrolle die den Skimmer kontrolliert bei Filter max false !?

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

                                            @Aphofis sagte:

                                            Gibt es in dem JS eine Kontrolle die den Skimmer kontrolliert bei Filter max false !?

                                            Nein, er wird nur abhängig vom Max-Schwimmer gesteuert.

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            511
                                            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