Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Visualisierung
    4. Wie Kostal Piko 3.6 Wechselrichter Visualisieren ?

    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

    Wie Kostal Piko 3.6 Wechselrichter Visualisieren ?

    This topic has been deleted. Only users with topic management privileges can see it.
    • bahnuhr
      bahnuhr Forum Testing Most Active @io2345 last edited by bahnuhr

      @io2345
      Das ist keine Warnung, das ist eine Info.

      Aber wie schon erwähnt, könntest ja mal dein jetziges Script zeigen.
      Hast du ja (bewusst) bisher nicht gemacht; oder hab ich was übersehn.

      Nachtrag:
      Wenn du alle setstate rausnimmst wird auch nix mehr gespeichert !!!

      I 1 Reply Last reply Reply Quote 0
      • I
        io2345 @bahnuhr last edited by io2345

        @bahnuhr
        Na, da gibt's halt nicht viel zu zeigen. Ist dein komplettes Script ohne die beiden besprochenen Blöcke:

        // Photovoltaik: Piko 5.5 Anlage (alte Firmware)
        // Danke an homoran für den regex
        // @bahnuhr; 03/2019 Dieter Müller
        
        //Variaben
           var idaktuell = 'javascript.0.Geräte.Photovoltaik.2012_Leistung_alt_aktuell';
           var idTag = 'javascript.0.Geräte.Photovoltaik.2012_Tagesleistung';
           var idall = 'javascript.0.Geräte.Photovoltaik.2012_Leistung_alt_gesamt';
           var idP1 = 'javascript.0.Geräte.Photovoltaik.2012_Leistung_Strang1';
           var idP2 = 'javascript.0.Geräte.Photovoltaik.2012_Leistung_Strang2';
        
           var NameAnlage = 'pvserver';        // Nutzername der Photovoltaik-Anlage
           var PassAnlage = 'pvwr';         // Password der Photovoltaik-Anlage
           var IPAnlage = '192.168.0.20';    // IP der Photovoltaik-Anlage
        
           var logging = false;
        
        
        function Piko() {
          // log("Piko 5.5 auslesen");
           var results = [];
           httpGet('http://' + NameAnlage + ':' + PassAnlage +'@' + IPAnlage, { timeout: 10000, responseType: 'document' }, (err, response) => { 
           if (err) { 
               if (err.indexOf("size of -1") != -1) {
                   log (err,"info");
               } else {
                   console.error(err); 
               }
           } else { 
               var d = (response.data).toString();
               if (logging) log (d);
               var reg = /#FFFFFF">[^\d]+([^<]+)/g
               var z = reg.exec(d);
        
               while(z != null) {
                   if (isNaN(z[1])) {
                       if (logging) log("keine Zahl= "+ z[1]);
                       z[1] = 0;
                   } else {
                       if (logging) log("Zahl= "+ z[1]);
                       parseFloat(z[1]);
                   }
                   results[results.length] = z[1];
                   z = reg.exec(d);
               }
               if (logging) log("results= "+ results);
        
           // Werte zuordnen
               var pwr = results[0];           // Energie aktuell in W
               var day = results[2];           // Tagesenergie in kWh
               var all = results[1];           // Gesamtenergie in kWh
               var v1 = results[3];            // PV Generator Nr. 1 - Spannung in V
               var i1 = results[5];            // PV Generator Nr. 1 - Strom in A
               var p1 = parseInt(v1 * i1);
               var v2 = results[7];            // PV Generator Nr. 2 - Spannung in V
               var i2 = results[9];            // PV Generator Nr. 2 - Strom in A
               var p2 = parseInt(v2 * i2);
              
               // geändert: in pwr wird die aktuelle Energie angezeigt; dies passt aber nicht mit p1 + p2 überein.
               // vermutlich wird die W des Wechselrichters abgezogen. neu habe ich nun pwr = p1 + p2
                   pwr = p1 + p2;
        
        //       if (logging) log("aktuell -> Leistung aktuell= " + pwr + " W // Tagesleistung= " + day + " kWh // Leistung alt gesamt= " + all + " kWh // Leistung Strang 1= " + p1 + " W // Leistung Strang 2= " + p2 + " W");
        
        //       setState(idaktuell, parseFloat(pwr));
        //       setState(idTag, parseFloat(day));
        //       setState(idall, parseFloat(all));
        //       setState(idP1, parseFloat(p1));
        //       setState(idP2, parseFloat(p2));
           } });
        }
        
        
        schedule('5 * * * * *', function () {
           //log ("Auslöser: Schedule");
           Piko();
        });
        
        /*
        schedule("3 0 * * *", function () {     // Variablen löschen um 00:03 Uhr   
           setState('javascript.0.Geräte.Photovoltaik.2012_Tagesleistung', 0);
        });
        */
        
        //Piko();
        

        Und wenn der Text im Script-Log gelb ist und davor "warn" steht (die fünf unteren Zeilen), ist es keine Info - oder irre ich?

        javascript.0	17:37:15.385	info	Start JavaScript script.js.common.Kostal_Piko_55_WR_auslesen_neu (Javascript/js)
        javascript.0	17:37:15.394	info	script.js.common.Kostal_Piko_55_WR_auslesen_neu: registered 0 subscriptions, 1 schedule, 0 messages, 0 logs and 0 file subscriptions
        javascript.0	17:38:05.539	warn	at Object.<anonymous> (script.js.common.Kostal_Piko_55_WR_auslesen_neu:66:9)
        javascript.0	17:38:05.540	warn	at Object.<anonymous> (script.js.common.Kostal_Piko_55_WR_auslesen_neu:67:9)
        javascript.0	17:38:05.541	warn	at Object.<anonymous> (script.js.common.Kostal_Piko_55_WR_auslesen_neu:68:9)
        javascript.0	17:38:05.541	warn	at Object.<anonymous> (script.js.common.Kostal_Piko_55_WR_auslesen_neu:69:9)
        javascript.0	17:38:05.541	warn	at Object.<anonymous> (script.js.common.Kostal_Piko_55_WR_auslesen_neu:70:9)
        
        bahnuhr 4 Replies Last reply Reply Quote 0
        • bahnuhr
          bahnuhr Forum Testing Most Active @io2345 last edited by

          @io2345

          wie gesagt:
          Wenn man alle setstate rausnimmt bekommst du die Werte nirgends gespeichert.
          So funktioniert es nicht.

          1 Reply Last reply Reply Quote 1
          • bahnuhr
            bahnuhr Forum Testing Most Active @io2345 last edited by

            @io2345
            Hast du die DP angelegt ?

               var idaktuell = 'javascript.0.Geräte.Photovoltaik.2012_Leistung_alt_aktuell';
               var idTag = 'javascript.0.Geräte.Photovoltaik.2012_Tagesleistung';
               var idall = 'javascript.0.Geräte.Photovoltaik.2012_Leistung_alt_gesamt';
               var idP1 = 'javascript.0.Geräte.Photovoltaik.2012_Leistung_Strang1';
               var idP2 = 'javascript.0.Geräte.Photovoltaik.2012_Leistung_Strang2';
            
            

            Bei dir stimmt etwas nicht.

            1 Reply Last reply Reply Quote 0
            • bahnuhr
              bahnuhr Forum Testing Most Active @io2345 last edited by

              @io2345
              Noch ein Nachtrag.
              Deine Warnhinweise im log können nicht ! von dem Script kommen was darüber steht.
              Denn dort hast du diese Zeilen ja mit // raus genommen.

              I 1 Reply Last reply Reply Quote 0
              • bahnuhr
                bahnuhr Forum Testing Most Active @io2345 last edited by

                Habe dein Script mal bei mir eingefügt.

                Es funktioniert einwandfrei !

                1 Reply Last reply Reply Quote 1
                • I
                  io2345 @bahnuhr last edited by

                  @bahnuhr
                  Die Logeinträge sind gekommen, bevor ich die Zeilen auskommentiert hatte.

                  Ich lass einfach das alte Script, solange "request" noch funktioniert. Manchmal muss man einfach pragmatisch sein.

                  bahnuhr 1 Reply Last reply Reply Quote 0
                  • bahnuhr
                    bahnuhr Forum Testing Most Active @io2345 last edited by

                    @io2345

                    Vielleicht zeigst du uns mal deinen angelegten DP (screenshot von den Objekten)

                    Wie gesagt, dein Script funktioniert einwandfrei.

                    I 1 Reply Last reply Reply Quote 0
                    • I
                      io2345 @bahnuhr last edited by

                      @bahnuhr
                      Könnte es das sein?:

                      f8331e78-e055-435c-81b7-0a3ad7f9939c-image.png

                      bahnuhr 2 Replies Last reply Reply Quote 0
                      • bahnuhr
                        bahnuhr Forum Testing Most Active @io2345 last edited by

                        @io2345
                        Du musst halt auch die DP richtig anlegen:
                        Bei den DP steht kein ...2012...

                        In deinem Script schon !
                        c5049f57-b556-44ef-8e44-b231f874db1c-image.png

                        Das passt natürlich nicht zusammen.

                        Mach es richtig, dann läuft es auch.

                        1 Reply Last reply Reply Quote 1
                        • bahnuhr
                          bahnuhr Forum Testing Most Active @io2345 last edited by

                          @io2345

                          Und Rückinfo.

                          Klappt es jetzt, oder nicht ?

                          I 1 Reply Last reply Reply Quote 0
                          • I
                            io2345 @bahnuhr last edited by

                            @bahnuhr Ein weiser Mann sagte mal "Mach es richtig, dann läuft es auch". Und so war es auch.
                            Ich hatte zwar Option 2 gewählt und - statt neue Datenpunkte anzulegen - die bisherigen aus dem alten Script weiterverwendet. Aber ansonsten keine Probleme.

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

                            Support us

                            ioBroker
                            Community Adapters
                            Donate

                            759
                            Online

                            31.9k
                            Users

                            80.1k
                            Topics

                            1.3m
                            Posts

                            8
                            94
                            6539
                            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