Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Visualisierung
    4. Bayrol Webportal

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Bayrol Webportal

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

      @mameier1234
      ha, zu schnell gelesen. korrigiert

      M 1 Reply Last reply Reply Quote 0
      • M
        mameier1234 @OliverIO last edited by

        @oliverio Ich habe noch ein bisschen umgebaut...

        das hier auskommentieren

        //setTimeout(getData.bind(this),requesttime,sessionid,cid);
        

        dafür am Schluss dann die Werte nur innerhalb 9-18 Uhr in die Datenpunkte schreiben.

        function checkAndExecuteFunction() {
            const now = new Date();
            const startHour = 9;
            const endHour = 18;
        
            // Erstelle eine Kopie des aktuellen Datums und setze die Stunde auf die Start- und Endzeit
            const startTime = new Date(now.getFullYear(), now.getMonth(), now.getDate(), startHour, 0, 0);
            const endTime = new Date(now.getFullYear(), now.getMonth(), now.getDate(), endHour, 0, 0);
        
            // Prüfe, ob die aktuelle Zeit innerhalb des Zeitfensters liegt
            if (now >= startTime && now < endTime) {
                //console.log("Abfrage wird ausgeführt");
                main();
            } else {
                //console.log("Es ist nicht die Zeit für die Funktion, sie wird nicht ausgeführt.");
            }
        }
        
        // Interval aufsetzen, um die Funktion alle 60 Sekunden zu prüfen
        setInterval(checkAndExecuteFunction, 60000);
        
        

        Damit bekomme ich die unschärfen ausserhalb meiner Filterzeiten weg. Sonst steht ja das Wasser in der Messzelle und kühlt auf die Umgebung ab... und die riesen Redox-Sprünge im stehenden Wasser habe ich so auch nicht in meinen Graphen..

        Vieleicht hilft es ja jemandem.

        1 Reply Last reply Reply Quote 0
        • Q
          qwertz last edited by

          Hat jemand von euch mit dem Skript auch das Problem, dass manchmal keine neuen Werte kommen ?
          Das Skript läuft ohne Fehlermeldung aber es kommen dann irgendwann keine neuen Werte mehr.
          Erst ein Neustart des Skriptes hilft. Eine Fehlermeldung im Log erscheint nicht.

          M 1 Reply Last reply Reply Quote 0
          • M
            mameier1234 @qwertz last edited by

            @qwertz Ja.. hatte ich auch schon... Seit meiner Änderung allerdings nun schon seit einer Woche kein Problem mehr.

            1 Reply Last reply Reply Quote 0
            • Q
              qwertz last edited by

              OK. Möglicherweise gibt es ein TimeOut vom Server, wenn man 24h am Stück immer wieder die Daten pullt ? Ich werde das Skript mal stoppen solange die Filterpumpe nicht läuft.

              M 1 Reply Last reply Reply Quote 0
              • M
                mameier1234 @qwertz last edited by

                @qwertz deswegen habe ich ja die Änderungen im Script.. einstellbar, wann es nicht pollen soll.. und vor allem nicht falsche Werte in die DB schreibt...

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

                  @OliverIO
                  Ich versuche gerade das Script zum laufen zu bringen, allerdings habe ich die gleichen Fehler wie oben beschrieben.
                  Meiner Meinung nach habe ich alles so wie oben von dir beschrieben gemacht.

                  Was könnte das Problem sein?

                  javascript.0	22:32:11.471	error	script.js.common.Pool.Byrol: TypeError: Cannot read properties of null (reading 'length')
                  javascript.0	22:32:11.471	error	at getCID (script.js.common.Pool.Byrol:129:16)
                  javascript.0	22:32:11.471	error	at login (script.js.common.Pool.Byrol:74:10)
                  javascript.0	22:32:11.471	error	at main (script.js.common.Pool.Byrol:19:14)
                  
                  OliverIO 1 Reply Last reply Reply Quote 0
                  • OliverIO
                    OliverIO @NWH last edited by

                    @nwh

                    hast du das skript, das als textdatei dem folgenden post anhängt, verwendet?
                    https://forum.iobroker.net/post/1147632

                    im skript ist ein regex enthalten, das das forum nicht richtig anzeigen mag.
                    keine ahnung ob man das hier auch mal fixen mag.

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

                      @oliverio ja das habe ich genommen.

                      OliverIO 1 Reply Last reply Reply Quote 0
                      • OliverIO
                        OliverIO @NWH last edited by OliverIO

                        @nwh dein fehler ist genau der, der gepostet wurde mit der skriptversion und den defekten regex

                        wenn du magst, kannst du mir deine zugangskennung per PN senden, dann lass ich das hier mal laufen und kann rein debuggen.
                        habe gerade mal die letzte version laufen lassen mit einer anderen zugangskennung.
                        das läuft einwandfrei

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

                          @oliverio

                          seltsam.
                          habe jetzt die textdatei selbst mal getestet und da sind fehler drin.
                          hier jetzt eine version die klappen müsste

                          bayrol.txt

                          NWH 1 Reply Last reply Reply Quote 0
                          • NWH
                            NWH @OliverIO last edited by

                            @oliverio leider nein.
                            4328cae2-2be8-41c6-80f4-53258c1f71e2-image.png

                            So sehen die besagten Zeilen aus.

                            OliverIO 1 Reply Last reply Reply Quote 0
                            • OliverIO
                              OliverIO @NWH last edited by

                              @nwh

                              neuer versuch
                              bayrol.txt

                              NWH 1 Reply Last reply Reply Quote 0
                              • NWH
                                NWH @OliverIO last edited by

                                @oliverio hat wieder nicht funktioniert.

                                Wenn ich die Zeilen so abändere

                                function extractValues(text){
                                  const regexPH = /[pH]<\/span><h1>([\d\.]+)<\/h1>/gm;
                                  const regexMV = /[mV]<\/span><h1>([\d\.]+)<\/h1>/gm;
                                  const regexCC = /[°C]<\/span><h1>([\d\.]+)<\/h1>/gm;
                                

                                dann kommt nurmehr der Fehler.

                                javascript.0	23:21:12.867	error	script.js.common.Pool.Byrol compile failed: at script.js.common.Pool.Byrol:109
                                
                                OliverIO 1 Reply Last reply Reply Quote 0
                                • OliverIO
                                  OliverIO @NWH last edited by OliverIO

                                  @nwh
                                  du sollst nix abändern. du sollst nur deine login daten im skript eintragen

                                  ansonsten komm ich nicht mehr weiter.
                                  mit den anderen login-daten funktioniert es

                                  ich selbst hab bayrol nicht

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

                                    @oliverio
                                    So ich depp, habe den falschen login eingegeben.

                                    jetzt ist er Richtig, allerdings kommt jetzt das.
                                    Er meckert jetzt mit "reading1"

                                    javascript.0	23:45:06.327	error	script.js.common.Pool.Byrol: TypeError: Cannot read properties of null (reading '1')
                                    javascript.0	23:45:06.327	error	at extractValues (script.js.common.Pool.Byrol:119:26)
                                    javascript.0	23:45:06.327	error	at getData (script.js.common.Pool.Byrol:99:13)
                                    javascript.0	23:45:06.327	error	at main (script.js.common.Pool.Byrol:19:14)
                                    

                                    Das kommt zuvor noch

                                    javascript.0	23:50:10.271	info	Stopping script script.js.common.Pool.Byrol
                                    javascript.0	23:52:46.677	info	Start JavaScript script.js.common.Pool.Byrol (Javascript/js)
                                    javascript.0	23:52:46.687	info	script.js.common.Pool.Byrol: registered 0 subscriptions, 0 schedules, 0 messages, 0 logs and 0 file subscriptions
                                    javascript.0	23:52:47.669	info	script.js.common.Pool.Byrol: <div><div class="gapp_"></div><div class="tab_data_link" onclick="document.location.href='device.php?c=26081'"><div class="gstat_warning"></div><div class="tab_box stat_warning"><span>pH&nbsp;[pH]</span><h1>7.20</h1></div><div class="tab_box stat_warning"><span>mV&nbsp;[mV]</span><h1>860</h1></div><div class="tab_box stat_warning"><span>T1&nbsp;[°C]</span><h1>27.1</h1></div><div class="tab_box "></div><div class="tab_info"><span>DGGB18461B23</span></br><span>PoolManager Chlor (Cl)</span></br><span>v221216-M1 (7.8.3)</span></br><span><a href="device.php?c=26081">Direct access</a></div></div></div>
                                    

                                    aber morgen weiter...

                                    OliverIO 1 Reply Last reply Reply Quote 0
                                    • OliverIO
                                      OliverIO @NWH last edited by

                                      @nwh

                                      das ist nicht die letzte version des scripts

                                      NWH 1 Reply Last reply Reply Quote 0
                                      • NWH
                                        NWH @OliverIO last edited by NWH

                                        @oliverio Guten Morgen

                                        Das ist die letzte Version:

                                        javascript.0	07:31:23.019	error	script.js.common.Pool.Byrol: TypeError: Cannot read properties of null (reading '1')
                                        javascript.0	07:31:23.019	error	at extractValues (script.js.common.Pool.Byrol:115:26)
                                        javascript.0	07:31:23.019	error	at getData (script.js.common.Pool.Byrol:96:13)
                                        javascript.0	07:31:23.019	error	at main (script.js.common.Pool.Byrol:19:14)
                                        

                                        Das wären noch die Meldungen vom debug:

                                        
                                        javascript.0
                                        2024-06-25 07:29:45.191	error	at main (script.js.common.Pool.Byrol:19:14)
                                        javascript.0
                                        2024-06-25 07:29:45.191	error	at processTicksAndRejections (node:internal/process/task_queues:95:5
                                        javascript.0
                                        2024-06-25 07:29:45.191	error	at getData (script.js.common.Pool.Byrol:96:13)
                                        javascript.0
                                        2024-06-25 07:29:45.191	error	at extractValues (script.js.common.Pool.Byrol:115:26)
                                        javascript.0
                                        2024-06-25 07:29:45.191	error	script.js.common.Pool.Byrol: TypeError: Cannot read properties of null (reading '1')
                                        javascript.0
                                        2024-06-25 07:29:43.819	info	script.js.common.Pool.Byrol: registered 0 subscriptions, 0 schedules, 0 messages, 0 logs and 0 file subscriptions
                                        javascript.0
                                        2024-06-25 07:29:43.810	info	Start JavaScript script.js.common.Pool.Byrol (Javascript/js)
                                        
                                        1 Reply Last reply Reply Quote 0
                                        • Q
                                          qwertz last edited by

                                          Hat einer von den Skriptbastlern github und kann das Script dort einstellen ?
                                          Das ist ja unnötig Ärger hier.

                                          OliverIO 1 Reply Last reply Reply Quote 0
                                          • OliverIO
                                            OliverIO @qwertz last edited by

                                            @qwertz

                                            https://github.com/oweitman/diverse-iobroker-scripts/tree/main/bayrol

                                            NWH Q 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            416
                                            Online

                                            31.9k
                                            Users

                                            80.1k
                                            Topics

                                            1.3m
                                            Posts

                                            14
                                            98
                                            9544
                                            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