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:

      Weshalb GPIO 21?

      Deswegen (Skript Verbrauch.Osmoseverbrauch):

      // Magnetventil
      on({id: 'rpi2.0.gpio.21.state', change: "ne"}, function (obj) {
      
      Aphofis 2 Replies Last reply Reply Quote 0
      • Aphofis
        Aphofis @paul53 last edited by Aphofis

        @paul53
        Das ist alt!!!
        Da waren die Geräte bzw. Relais noch am Raspberry Pi angeschlossen was seid einigen Wochen ein ESP übernommen hat, da diese viel zuverlässiger sind.
        Aktuell ist das Magnetventil unter sonoff.0.Aqua_Control.POWER1 zu schalten
        rpi ist nichts mehr angeschlossen außer einem Ein Aus Schalter für den Pi.

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

          @paul53 sagte in Schaltzustand Verzögern:

          @Aphofis sagte:

          Weshalb GPIO 21?

          Deswegen (Skript Verbrauch.Osmoseverbrauch):

          // Magnetventil
          on({id: 'rpi2.0.gpio.21.state', change: "ne"}, function (obj) {
          

          rpi Adapter sind keine GPIOs mehr eingerichtet.
          Aqua Power
          Aqua Sensoren
          Aqua Control
          Aqua Float
          Aqua Dosierer
          sind alles ESPs

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

            Das ist meine Osmoseverbrauchssteuerung:

            var ml_pro_Tag, ml_Kumulativ, Differenz, ml_Aktuell;
            
            
            ml_pro_Tag = getState("Aqua_Control.0.Osmose_System.ml_pro_Tag").val;
            ml_Kumulativ = getState("Aqua_Control.0.Osmose_System.Osmose_Max").val;
            // Magnetventil
            on({id: 'sonoff.0.Aqua_Control.POWER1', change: "ne"}, function (obj) {
              var value = obj.state.val;
              var oldValue = obj.oldState.val;
              if (!(obj.state ? obj.state.val : "")) {
                Differenz = (obj.state ? obj.state.lc : "") - (obj.oldState ? obj.oldState.lc : "");
                ml_Aktuell = Differenz * parseFloat(getState("Aqua_Control.0.Osmose_System.ml_multiplikator").val);
                setState("Aqua_Control.0.Osmose_System.Osmose_Aktuell"/*Osmose_Aktuell*/, Math.round(ml_Aktuell*100)/100, true);
                ml_Kumulativ = (typeof ml_Kumulativ == 'number' ? ml_Kumulativ : 0) + ml_Aktuell;
                ml_pro_Tag = (typeof ml_pro_Tag == 'number' ? ml_pro_Tag : 0) + ml_Aktuell;
                setState("Aqua_Control.0.Osmose_System.Osmose_Max"/*Osmose_Max*/, Math.round(ml_Kumulativ*100)/100, true);
                setState("Aqua_Control.0.Osmose_System.Osmose_Gesamtverbrauch"/*Osmose_Gesamtverbrauch*/, Math.round((ml_Kumulativ / 1000)*1000)/1000, true);
                setState("Aqua_Control.0.Osmose_System.ml_pro_Tag"/*ml_pro_Tag*/, (Math.round(ml_pro_Tag)), true);
                console.log((['Dosierung aktuell ',Math.round(ml_Aktuell),' ml'].join('')));
                console.log((['Dosierung Gesamt ',Math.round((ml_Kumulativ / parseFloat(1000))*1000)/1000,' Liter'].join('')));
                sendTo("telegram.0", "send", {
                    text: (['Osmose Dosierung aktuell ',Math.round(getState("Aqua_Control.0.Osmose_System.Osmose_Aktuell").val),' ml','\n','Osmose Tages Dosierung ',Math.round((getState("Aqua_Control.0.Osmose_System.ml_pro_Tag").val / 1000)*100)/100,' Liter','\n','Osmose Gesamtverbrauch ',Math.round(getState("Aqua_Control.0.Osmose_System.Osmose_Gesamtverbrauch").val),' Liter'].join(''))
                });
              }
            });
            schedule("0 0 * * *", function () {
              ml_pro_Tag = 0;
              setState("Aqua_Control.0.Osmose_System.ml_pro_Tag"/*ml_pro_Tag*/, 0, true);
            });
            
            paul53 1 Reply Last reply Reply Quote 0
            • paul53
              paul53 @Aphofis last edited by

              @Aphofis sagte:

              Das ist meine Osmoseverbrauchssteuerung:

              Gut, entweder habe ich es in den vielen Posts übersehen oder Du hast die Änderung nicht erwähnt. Jedenfalls sagt dieses Log aus, dass die Reaktion der Ansteuerung des Magnetventils "sonoff.0.Aqua_Control.POWER1" auf den Osmose-Schwimmer funktioniert hat:

              javascript.0	2019-10-02 21:04:23.577	info	script.js.Verbrauch.Osmoseverbrauch: Dosierung Gesamt 851.192 Liter
              javascript.0	2019-10-02 21:04:23.571	info	script.js.Verbrauch.Osmoseverbrauch: Dosierung aktuell 1069 ml
              javascript.0	2019-10-02 21:04:21.561	info	script.js.Technik_Steuerung.Osmose_&_Filter_Max_Hauptsteuerung: Schwimmer: false
              
              Aphofis 1 Reply Last reply Reply Quote 0
              • Aphofis
                Aphofis @paul53 last edited by

                @paul53
                Nur verstehe ich nicht warum das Magnetventil dann nicht abschaltet.
                Es kann natürlich daran liegen das wie du sagst durch Spannungsspitzen das Magnetventil nicht schließt auch wenn das relais den Strom trennt.steht das Magnet Ventil noch angezogen da und das Wasser läuft weiter.

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

                  @paul53
                  Heute hat die Osmose alles gemacht was sie soll! nicht zu viel nicht zu wenig dosiert.
                  Ich versuche mich gerade darin, das Javascript umzusetzen in Blöcke.
                  Leider scheitere ich an:

                  createState(idRestzeit, 300, {type: 'number', unit: 's'});
                  

                  Welcher Block ist das !?
                  Datenpunkt erzeugen fängt auch an mit createState aber beinhaltet eine Funktion aber man kann irgendwie keine Werte rein nehmen.

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

                    @Aphofis sagte:

                    Welcher Block ist das !?

                    Das brauchst Du nicht, denn der Datenpunkt "javascript.0.Osmose.Restzeit" existiert bereits seit dem ersten Skriptstart.

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

                      @paul53 habe ich auch gefunden unter Javascript.0 Osmose Restzeit.
                      Also kann ich das weg lassen ???

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

                        @Aphofis sagte:

                        Also kann ich das weg lassen ???

                        Ja.

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

                          @paul53
                          Danke

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

                            Ich werde sicherlich stunden dafür braucehn aber irgendwann ist es fertig !
                            Vielleicht kannst du dann ja mal drüber gucken ob alles richtig ist.

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

                              @paul53
                              Ist es möglich vielleicht das Magnetventil 2 mal ein aus zuschalten innerhalb von 1 sek bis Eine passende Freilaufdiode vorhanden ist !?
                              Das Magnetventil hat 12 Volt 6,5 Watt also sollte die Freilaufdiode 0,5 A haben.
                              Genau weiß ich es aber nicht.

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

                                @Aphofis sagte:

                                also sollte die Freilaufdiode 0,5 A haben.

                                Besser >= 1 A.

                                @Aphofis sagte:

                                Ist es möglich vielleicht das Magnetventil 2 mal ein aus zuschalten innerhalb von 1 sek bis Eine passende Freilaufdiode vorhanden ist !?

                                Wozu soll das gut sein ? Dann werden noch öfter Störungen durch die hohe Induktionsspannung beim Abschalten erzeugt.

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

                                  @paul53
                                  War nur eine Idee da wieder Osmose bis Filter Max gepumpt wurde.

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

                                    @Aphofis sagte:

                                    ist an GPIO15 ein Relais angeschlossen.

                                    Hat das Relais eine Freilaufdiode ? Braucht es ebenfalls (Induktivität) !

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

                                      @paul53
                                      Das weiß ich nicht!
                                      Das sind meine Relais Boards

                                      Relais Karte

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

                                        Ist da was dabei was eine Freilaufdiode sein kann!?

                                        A77F0834-C476-4399-A1D5-6D245CA104DB.jpeg

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

                                          @Aphofis sagte:

                                          Ist da was dabei was eine Freilaufdiode sein kann!?

                                          D6 könnte eine Freilaufdiode sein. Sicher kann ich es nur anhand eines Stromlaufplanes bestätigen. Oder Du verifizierst, dass die Diode parallel zur Relais-Spule geschaltet ist.

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

                                            @paul53
                                            langt das !?

                                            sainrelay.PNG

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            824
                                            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