Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Kostal Wechselrichter mit Firmware 3.71

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Kostal Wechselrichter mit Firmware 3.71

    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      burgerking68 last edited by

      Hallo, ich habe einen "alten" Kostal WR 8.3 mit Firmware 3.71 und möchte gerne von dem Webserver die Einzelnen Werte in IOBroker parsen/auslesen. Für den Zugang zur Website wird ein User+Passwort benötigt. Kann mir jemand hierzu eine Hilfestellung geben wie ich dieses entweder mit einem Adater (parser) oder mit JS hinbekomme?

      Danke für Unterstützung!

      Gruß, burgerking68

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

        Hast du die Suche benutzt ?

        Es gibt hier 2 Scripte.

        Eines für die alte Firmware und eines für die neue Firmware.

        B 1 Reply Last reply Reply Quote 0
        • B
          burgerking68 @bahnuhr last edited by

          @bahnuhr Ja, leider hatte ich das Script für die neueren FW-Versionen benutzt. Ich habe jetzt aber hoffentlich das richtige Script zu meiner FW gefunden. Noch eine kurze Frage: muß ich die im Script befindlichen Variablen vorher im IOBroker anlegen?

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

            @burgerking68 sagte in Kostal Wechselrichter mit Firmware 3.71:

            muß ich die im Script befindlichen Variablen vorher im IOBroker anlegen?

            Wenn kein createState im Script vorhanden ist, dann ja

            Welches Script hast du jetzt ?

            B 1 Reply Last reply Reply Quote 0
            • B
              burgerking68 @bahnuhr last edited by Homoran

              @bahnuhr
              diese hier:

              // 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.Status.Photovoltaik.Leistung_aktuell';
                  var idTag = 'javascript.0.Status.Photovoltaik.Tagesleistung';
                  var idall = 'javascript.0.Status.Photovoltaik.Leistung_gesamt';
                  var idP1 = 'javascript.0.Status.Photovoltaik.Leistung_Strang1';
                  var idP2 = 'javascript.0.Status.Photovoltaik.Leistung_Strang2';
               
                  var NameAnlage = 'pvxxxx';        // Nutzername der Photovoltaik-Anlage
                  var PassAnlage = 'xxxxx';         // Password der Photovoltaik-Anlage
                  var IPAnlage = '192.168.xxx.xxx';    // IP der Photovoltaik-Anlage
               
                  var logging = false;
                  var request = require('request');
               
               function Piko() {
                  log("Piko 5.5 auslesen");
                  var results = [];
                  request('http://' + NameAnlage + ':' + PassAnlage +'@' + IPAnlage, function (error, response, body) {
                      var d = body.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);
               
                      if (logging) log("Leistung aktuell= " + pwr + " W");
                      if (logging) log("Tagesleistung= " + day + " kWh");
                      if (logging) log("Leistung gesamt= " + all + " kWh");
              	    if (logging) log("Leistung Strang 1= " + p1 + " W");
                  	if (logging) log("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("2,7,12,17,22,27,32,37,42,47,52,57 * * * *", function () {
                  log ("Auslöser: Schedule");
              	Piko();
              });
               
              schedule("3 0 * * *", function () {     // Variablen löschen um 00:03 Uhr   
                  setState('javascript.0.Status.Photovoltaik.Tagesleistung', 0);
              });
              

              MOD-EDIT: Code in code-tags gesetzt!

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

                Ja, da habe ich dran mitgearbeitet (steht ja auch oben).

                Ich weiß nur nicht, ob dies das richtige für deine Firmware ist.
                du musst die alte dos Oberfläche haben , also etwa so:
                ab2a994e-49c3-42be-8c0f-4f698e298477-image.png

                Wenn dies bei dir im Browser auch so aus sieht, dann bist du richtig.

                Die Objekte legt du mit einem Extra Script, oder manuell an.
                Extra Script:

                // Photovoltaik -------------------------------------------------------------------------------------------------------------
                createState('javascript.0.Geräte.Photovoltaik.Leistung_aktuell', 0, {type: 'number',name: 'Leistung aktuell',min: 0,role: 'per Script'});
                createState('javascript.0.Geräte.Photovoltaik.Tagesleistung', 0, {type: 'number',name: 'Tagesleistung',min: 0,role: 'per Script'});
                createState('javascript.0.Geräte.Photovoltaik.Leistung_gesamt', 0, {type: 'number',name: 'Leistung gesamt',min: 0,role: 'per Script'});
                createState('javascript.0.Geräte.Photovoltaik.Leistung_Strang1', 0, {type: 'number',name: 'Leistung Strang 1',min: 0,role: 'per Script'});
                createState('javascript.0.Geräte.Photovoltaik.Leistung_Strang2', 0, {type: 'number',name: 'Leistung Strang 2',min: 0,role: 'value'});
                

                mfg
                Dieter

                B 1 Reply Last reply Reply Quote 0
                • B
                  burgerking68 @bahnuhr last edited by

                  @bahnuhr
                  Danke Dir! Ja, die WebOberfläche entspricht der von Dir geposteten! Ich habe jetzt mit Deinem Script die Variablen erstellt und das Script erneute angestossen: Leider kommen im LOG aber immer noch folgende Fehlemeldungen und die entsprechenden Werte werden auch nicht eingetragen. Er findet (so lese ich es als nicht Script-Erfahrener) die erste Variable schon nicht (1998) State "javascript.0.Status.Photovoltaik.Leistung_aktuell" not found). Obwohl ich diese als Objekte im IOBroker jetzt sehen kann. Oder muß ich dort einen Adapter noch neu starten?

                  javascript.0 2020-08-14 09:47:00.465 warn (1998) at processTicksAndRejections (internal/process/task_queues.js:84:21)
                  javascript.0 2020-08-14 09:47:00.465 warn (1998) at endReadableNT (_stream_readable.js:1221:12)
                  javascript.0 2020-08-14 09:47:00.464 warn (1998) at IncomingMessage.EventEmitter.emit (domain.js:482:12)
                  javascript.0 2020-08-14 09:47:00.464 warn (1998) at IncomingMessage.emit (events.js:327:22)
                  javascript.0 2020-08-14 09:47:00.464 warn (1998) at Object.onceWrapper (events.js:421:28)
                  javascript.0 2020-08-14 09:47:00.464 warn (1998) at IncomingMessage.<anonymous> (/opt/iobroker/node_modules/iobroker.javascript/node_modules/request/request.js:1076:12)
                  javascript.0 2020-08-14 09:47:00.463 warn (1998) at Request.EventEmitter.emit (domain.js:482:12)
                  javascript.0 2020-08-14 09:47:00.463 warn (1998) at Request.emit (events.js:315:20)
                  javascript.0 2020-08-14 09:47:00.463 warn (1998) at Request.<anonymous> (/opt/iobroker/node_modules/iobroker.javascript/node_modules/request/request.js:1154:10)
                  javascript.0 2020-08-14 09:47:00.462 warn (1998) at Request.EventEmitter.emit (domain.js:482:12)
                  javascript.0 2020-08-14 09:47:00.462 warn (1998) at Request.emit (events.js:315:20)
                  javascript.0 2020-08-14 09:47:00.461 warn (1998) at Request.self.callback (/opt/iobroker/node_modules/iobroker.javascript/node_modules/request/request.js:185:22)
                  javascript.0 2020-08-14 09:47:00.461 warn (1998) at Request._callback (/opt/iobroker/node_modules/iobroker.javascript/lib/request.js:27:17)
                  javascript.0 2020-08-14 09:47:00.461 warn (1998) at script.js.BghScripte.Funktionsscripte.PVAnlage:64:9
                  javascript.0 2020-08-14 09:47:00.460 warn (1998) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1345:20)
                  javascript.0 2020-08-14 09:47:00.457 warn (1998) State "javascript.0.Status.Photovoltaik.Leistung_Strang2" not found
                  javascript.0 2020-08-14 09:47:00.456 warn (1998) at processTicksAndRejections (internal/process/task_queues.js:84:21)
                  javascript.0 2020-08-14 09:47:00.456 warn (1998) at endReadableNT (_stream_readable.js:1221:12)
                  javascript.0 2020-08-14 09:47:00.455 warn (1998) at IncomingMessage.EventEmitter.emit (domain.js:482:12)
                  javascript.0 2020-08-14 09:47:00.455 warn (1998) at IncomingMessage.emit (events.js:327:22)
                  javascript.0 2020-08-14 09:47:00.455 warn (1998) at Object.onceWrapper (events.js:421:28)
                  javascript.0 2020-08-14 09:47:00.454 warn (1998) at IncomingMessage.<anonymous> (/opt/iobroker/node_modules/iobroker.javascript/node_modules/request/request.js:1076:12)
                  javascript.0 2020-08-14 09:47:00.454 warn (1998) at Request.EventEmitter.emit (domain.js:482:12)
                  javascript.0 2020-08-14 09:47:00.454 warn (1998) at Request.emit (events.js:315:20)
                  javascript.0 2020-08-14 09:47:00.453 warn (1998) at Request.<anonymous> (/opt/iobroker/node_modules/iobroker.javascript/node_modules/request/request.js:1154:10)
                  javascript.0 2020-08-14 09:47:00.453 warn (1998) at Request.EventEmitter.emit (domain.js:482:12)
                  javascript.0 2020-08-14 09:47:00.453 warn (1998) at Request.emit (events.js:315:20)
                  javascript.0 2020-08-14 09:47:00.452 warn (1998) at Request.self.callback (/opt/iobroker/node_modules/iobroker.javascript/node_modules/request/request.js:185:22)
                  javascript.0 2020-08-14 09:47:00.452 warn (1998) at Request._callback (/opt/iobroker/node_modules/iobroker.javascript/lib/request.js:27:17)
                  javascript.0 2020-08-14 09:47:00.451 warn (1998) at script.js.BghScripte.Funktionsscripte.PVAnlage:63:9
                  javascript.0 2020-08-14 09:47:00.451 warn (1998) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1345:20)
                  javascript.0 2020-08-14 09:47:00.448 warn (1998) State "javascript.0.Status.Photovoltaik.Leistung_Strang1" not found
                  javascript.0 2020-08-14 09:47:00.447 warn (1998) at processTicksAndRejections (internal/process/task_queues.js:84:21)
                  javascript.0 2020-08-14 09:47:00.447 warn (1998) at endReadableNT (_stream_readable.js:1221:12)
                  javascript.0 2020-08-14 09:47:00.446 warn (1998) at IncomingMessage.EventEmitter.emit (domain.js:482:12)
                  javascript.0 2020-08-14 09:47:00.446 warn (1998) at IncomingMessage.emit (events.js:327:22)
                  javascript.0 2020-08-14 09:47:00.446 warn (1998) at Object.onceWrapper (events.js:421:28)
                  javascript.0 2020-08-14 09:47:00.445 warn (1998) at IncomingMessage.<anonymous> (/opt/iobroker/node_modules/iobroker.javascript/node_modules/request/request.js:1076:12)
                  javascript.0 2020-08-14 09:47:00.445 warn (1998) at Request.EventEmitter.emit (domain.js:482:12)
                  javascript.0 2020-08-14 09:47:00.445 warn (1998) at Request.emit (events.js:315:20)
                  javascript.0 2020-08-14 09:47:00.444 warn (1998) at Request.<anonymous> (/opt/iobroker/node_modules/iobroker.javascript/node_modules/request/request.js:1154:10)
                  javascript.0 2020-08-14 09:47:00.444 warn (1998) at Request.EventEmitter.emit (domain.js:482:12)
                  javascript.0 2020-08-14 09:47:00.444 warn (1998) at Request.emit (events.js:315:20)
                  javascript.0 2020-08-14 09:47:00.444 warn (1998) at Request.self.callback (/opt/iobroker/node_modules/iobroker.javascript/node_modules/request/request.js:185:22)
                  javascript.0 2020-08-14 09:47:00.443 warn (1998) at Request._callback (/opt/iobroker/node_modules/iobroker.javascript/lib/request.js:27:17)
                  javascript.0 2020-08-14 09:47:00.443 warn (1998) at script.js.BghScripte.Funktionsscripte.PVAnlage:62:9
                  javascript.0 2020-08-14 09:47:00.442 warn (1998) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1345:20)
                  javascript.0 2020-08-14 09:47:00.439 warn (1998) State "javascript.0.Status.Photovoltaik.Leistung_gesamt" not found
                  javascript.0 2020-08-14 09:47:00.438 warn (1998) at processTicksAndRejections (internal/process/task_queues.js:84:21)
                  javascript.0 2020-08-14 09:47:00.438 warn (1998) at endReadableNT (_stream_readable.js:1221:12)
                  javascript.0 2020-08-14 09:47:00.437 warn (1998) at IncomingMessage.EventEmitter.emit (domain.js:482:12)
                  javascript.0 2020-08-14 09:47:00.437 warn (1998) at IncomingMessage.emit (events.js:327:22)
                  javascript.0 2020-08-14 09:47:00.436 warn (1998) at Object.onceWrapper (events.js:421:28)
                  javascript.0 2020-08-14 09:47:00.436 warn (1998) at IncomingMessage.<anonymous> (/opt/iobroker/node_modules/iobroker.javascript/node_modules/request/request.js:1076:12)
                  javascript.0 2020-08-14 09:47:00.436 warn (1998) at Request.EventEmitter.emit (domain.js:482:12)
                  javascript.0 2020-08-14 09:47:00.435 warn (1998) at Request.emit (events.js:315:20)
                  javascript.0 2020-08-14 09:47:00.435 warn (1998) at Request.<anonymous> (/opt/iobroker/node_modules/iobroker.javascript/node_modules/request/request.js:1154:10)
                  javascript.0 2020-08-14 09:47:00.435 warn (1998) at Request.EventEmitter.emit (domain.js:482:12)
                  javascript.0 2020-08-14 09:47:00.435 warn (1998) at Request.emit (events.js:315:20)
                  javascript.0 2020-08-14 09:47:00.434 warn (1998) at Request.self.callback (/opt/iobroker/node_modules/iobroker.javascript/node_modules/request/request.js:185:22)
                  javascript.0 2020-08-14 09:47:00.434 warn (1998) at Request._callback (/opt/iobroker/node_modules/iobroker.javascript/lib/request.js:27:17)
                  javascript.0 2020-08-14 09:47:00.433 warn (1998) at script.js.BghScripte.Funktionsscripte.PVAnlage:61:9
                  javascript.0 2020-08-14 09:47:00.432 warn (1998) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1345:20)
                  javascript.0 2020-08-14 09:47:00.425 warn (1998) State "javascript.0.Status.Photovoltaik.Tagesleistung" not found
                  javascript.0 2020-08-14 09:47:00.425 warn (1998) at processTicksAndRejections (internal/process/task_queues.js:84:21)
                  javascript.0 2020-08-14 09:47:00.424 warn (1998) at endReadableNT (_stream_readable.js:1221:12)
                  javascript.0 2020-08-14 09:47:00.424 warn (1998) at IncomingMessage.EventEmitter.emit (domain.js:482:12)
                  javascript.0 2020-08-14 09:47:00.424 warn (1998) at IncomingMessage.emit (events.js:327:22)
                  javascript.0 2020-08-14 09:47:00.423 warn (1998) at Object.onceWrapper (events.js:421:28)
                  javascript.0 2020-08-14 09:47:00.423 warn (1998) at IncomingMessage.<anonymous> (/opt/iobroker/node_modules/iobroker.javascript/node_modules/request/request.js:1076:12)
                  javascript.0 2020-08-14 09:47:00.423 warn (1998) at Request.EventEmitter.emit (domain.js:482:12)
                  javascript.0 2020-08-14 09:47:00.422 warn (1998) at Request.emit (events.js:315:20)
                  javascript.0 2020-08-14 09:47:00.422 warn (1998) at Request.<anonymous> (/opt/iobroker/node_modules/iobroker.javascript/node_modules/request/request.js:1154:10)
                  javascript.0 2020-08-14 09:47:00.421 warn (1998) at Request.EventEmitter.emit (domain.js:482:12)
                  javascript.0 2020-08-14 09:47:00.421 warn (1998) at Request.emit (events.js:315:20)
                  javascript.0 2020-08-14 09:47:00.420 warn (1998) at Request.self.callback (/opt/iobroker/node_modules/iobroker.javascript/node_modules/request/request.js:185:22)
                  javascript.0 2020-08-14 09:47:00.420 warn (1998) at Request._callback (/opt/iobroker/node_modules/iobroker.javascript/lib/request.js:27:17)
                  javascript.0 2020-08-14 09:47:00.420 warn (1998) at script.js.BghScripte.Funktionsscripte.PVAnlage:60:9
                  javascript.0 2020-08-14 09:47:00.419 warn (1998) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1345:20)
                  javascript.0 2020-08-14 09:47:00.414 warn (1998) State "javascript.0.Status.Photovoltaik.Leistung_aktuell" not found

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

                    P.S.
                    Packe log oder scripte in spoiler und/oder code

                    und ja; du musst die Variablen noch anlegen.
                    Nehme das o.g. Scirpt, starte es einmal; nach dem Anlegen kannst du das Script wieder löschen.

                    B 1 Reply Last reply Reply Quote 0
                    • B
                      burgerking68 @bahnuhr last edited by

                      @bahnuhr Hi, ich habe den Fehler gefunden: Dein Script in dem die Variablen angelegt werden ist nicht kompatibel mit dem JS. Die Variablen werden in der Form "javascript.0.Geräte.." angelegt. Das Script benötigt diese jedoch in der Form "javascript.0.Status..." Habe das entsprechend angepasst. Nun läuft es! Danke für den tollen, schnellen Support!

                      Andreas

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

                        @burgerking68 sagte in Kostal Wechselrichter mit Firmware 3.71:

                        "javascript.0.Geräte.." angelegt.

                        Stimmt.
                        Geräte ist meine akt. Version.

                        Wenn du Status hast, dann ist es noch die alte Version.
                        Aber hauptsache es funktioniert.

                        B 1 Reply Last reply Reply Quote 0
                        • B
                          burgerking68 @bahnuhr last edited by

                          @bahnuhr ja, läuft soweit: Dankeschön

                          1 Reply Last reply Reply Quote 0
                          • S
                            SirTiGer last edited by

                            Hi Leute,

                            ich bin jetzt erst auf das Pferd aufgesprungen diverse Geräte auszulesen. Unter anderem auch meinen alten Wechselrichter von Kostal.
                            Es ist ein Piko 10.1 mit der Firmware ver 5.44.

                            Habe die Datenpunkte erstellt. Kein Problem. Das Script läuft auch, nur leider bekomme ich eine Fehlermeldung.

                            
                            javascript.0
                            2022-12-31 10:47:00.090	error	Request error: Error: getaddrinfo ENOTFOUND pvserver
                            
                            javascript.0
                            2022-12-31 10:47:00.089	error	Error in request callback: TypeError: Cannot read properties of undefined (reading 'toString')
                            

                            Was mache ich falsch?

                            Schöne Grüße
                            Timo

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

                              @sirtiger

                              Welches Script hast du genommen?
                              Wie sieht die Weboberfläche von Piko aus?
                              (alte oder neue Version)

                              @sirtiger sagte in Kostal Wechselrichter mit Firmware 3.71:

                              ENOTFOUND pvserver

                              user und passwort korrekt ?

                              bahnuhr 1 Reply Last reply Reply Quote 0
                              • S
                                SirTiGer last edited by

                                Hi,

                                ich habe mich da gerade nochmal reingefuchst... Das Script funktioniert jetzt. Ich war wahrscheinlich ein bißchen voreilig.
                                Es lag am Passwort. Das konnte wohl so nicht verarbeitet werden. Sonderzeichen wie ?, ! und # müssen wohl in der URL anders eingetragen werden.
                                Was ist eigentlich mit dem 3. String?
                                Habe versucht mir das results-Array im Log anzeigen zu lassen. Funktioniert nicht wirklich.

                                Schöne Grüße
                                Timo

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

                                  @sirtiger sagte in Kostal Wechselrichter mit Firmware 3.71:

                                  Was ist eigentlich mit dem 3. String?
                                  Habe versucht mir das results-Array im Log anzeigen zu lassen. Funktioniert nicht wirklich.

                                  Nochmal.

                                  @bahnuhr sagte in Kostal Wechselrichter mit Firmware 3.71:

                                  Welches Script hast du genommen?

                                  1 Reply Last reply Reply Quote 0
                                  • Homoran
                                    Homoran Global Moderator Administrators @SirTiGer last edited by

                                    @sirtiger sagte in Kostal Wechselrichter mit Firmware 3.71:

                                    Was ist eigentlich mit dem 3. String?
                                    Habe versucht mir das results-Array im Log anzeigen zu lassen. Funktioniert nicht wirklich.

                                    kommt auf das Skript an.
                                    Der Result liefert nur was angefragt wird

                                    S 1 Reply Last reply Reply Quote 0
                                    • S
                                      SirTiGer @Homoran last edited by SirTiGer

                                      @homoran, @bahnuhr

                                      Aus diesem Thread für die alte Version

                                      Homoran 1 Reply Last reply Reply Quote 0
                                      • Homoran
                                        Homoran Global Moderator Administrators @SirTiGer last edited by Homoran

                                        @sirtiger sagte in Kostal Wechselrichter mit Firmware 3.71:

                                        @homoran, @bahnuhr

                                        Aus diesem Thread für die alte Version

                                        Link?
                                        oder posten in code-tags

                                        bahnuhr 1 Reply Last reply Reply Quote 0
                                        • S
                                          SirTiGer last edited by

                                          
                                           
                                          // 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.Photovoltaik.Leistung_aktuell';
                                               var idTag = 'javascript.0.Photovoltaik.Tagesleistung';
                                               var idall = 'javascript.0.Photovoltaik.Leistung_gesamt';
                                               var idP1 = 'javascript.0.Photovoltaik.Leistung_Strang1';
                                               var idP2 = 'javascript.0.Photovoltaik.Leistung_Strang2';
                                            
                                               var NameAnlage = 'pvserver';        // Nutzername der Photovoltaik-Anlage
                                               var PassAnlage = 'xxxx';         // Password der Photovoltaik-Anlage
                                               var IPAnlage = '192.168.123.200';    // IP der Photovoltaik-Anlage
                                            
                                               var logging = false;
                                               var request = require('request');
                                            
                                            
                                            function Piko() {
                                               log("Piko 10.1 auslesen");
                                               var results = [];
                                               request('http://' + NameAnlage + ':' + PassAnlage +'@' + IPAnlage, function (error, response, body) {
                                                   var d = body.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);
                                                       log (z[1]);
                                                   }
                                                   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);
                                            
                                                   if (logging) log("Leistung aktuell= " + pwr + " W");
                                                   if (logging) log("Tagesleistung= " + day + " kWh");
                                                   if (logging) log("Leistung gesamt= " + all + " kWh");
                                           	     if (logging) log("Leistung Strang 1= " + p1 + " W");
                                               	 if (logging) log("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("2,7,12,17,22,27,32,37,42,47,52,57 * * * *", function () {
                                               log ("Auslöser: Schedule");
                                           	Piko();
                                           });
                                            
                                           schedule("3 0 * * *", function () {     // Variablen löschen um 00:03 Uhr   
                                               setState('javascript.0.Photovoltaik.Tagesleistung', 0);
                                           });
                                            
                                          
                                          

                                          Das hier..

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

                                            @homoran
                                            Rainer, er will nicht.

                                            Habe jetzt schon mehrmals geschrieben: "welches Script"
                                            Welcher 3. String ?

                                            Macht so keinen Spaß.
                                            Man will helfen, bekommt aber die Infos nicht.

                                            Bin jetzt raus hier.

                                            S Homoran 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate
                                            FAQ Cloud / IOT
                                            HowTo: Node.js-Update
                                            HowTo: Backup/Restore
                                            Downloads
                                            BLOG

                                            505
                                            Online

                                            31.6k
                                            Users

                                            79.6k
                                            Topics

                                            1.3m
                                            Posts

                                            parsen wechselrichter
                                            5
                                            64
                                            3884
                                            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