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.
    • Homoran
      Homoran Global Moderator Administrators @bahnuhr last edited by

      @bahnuhr sagte in Wie Kostal Piko 3.6 Wechselrichter Visualisieren ?:

      Und die Datenpunkte selber anlegen.

      Ah ja!
      hab ich vergessen 😞

      1 Reply Last reply Reply Quote 0
      • D
        discotosca @bahnuhr last edited by

        @bahnuhr Habe jetzt das Script am Laufen, IP, Benutzer und Kennwort meines Wechselrichters eingetragen.
        Wo lege ich die Datenpunkte an...?

        Sorry für die vielen blöden Fragen...

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

          @discotosca sagte in Wie Kostal Piko 3.6 Wechselrichter Visualisieren ?:

          @bahnuhr Habe jetzt das Script am Laufen, IP, Benutzer und Kennwort meines Wechselrichters eingetragen.
          Wo lege ich die Datenpunkte an...?

          Sorry für die vielen blöden Fragen...

          Mit einem solchen Script. Kannst danach wieder löschen.

          // 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'});
          
          
          D 1 Reply Last reply Reply Quote 1
          • Homoran
            Homoran Global Moderator Administrators @discotosca last edited by Homoran

            @discotosca sagte in Wie Kostal Piko 3.6 Wechselrichter Visualisieren ?:

            Wo lege ich die Datenpunkte an...?

            unter objects im Baum 0_userdata.0

            diese IDs musst du dann im Script eintragen

            EDIT:
            oder mit dem Script von @Bahnuhr unter javascript.0 (wenn .0 deine Instanz ist!)

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

              @homoran

              Rainer, geht beides.
              Die angelegten Datenpunkte müssen dann halt mit dem Script passen.

              Manuell anlegen bei den Objekten ist auch möglich.

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

                @bahnuhr sagte in Wie Kostal Piko 3.6 Wechselrichter Visualisieren ?:

                geht beides.

                klar doch!
                nur dein Post tauchte erst vor meinem auf, als ich abgedrückt hatte

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

                  @homoran

                  Sonst bist du immer schneller 😉

                  1 Reply Last reply Reply Quote 0
                  • D
                    discotosca @bahnuhr last edited by

                    @bahnuhr Vielen lieben Dank. Ich habe es tatsächlich hinbekommen, obwohl ich von Javascript ehrlich NULL Plan habe...
                    Eine Frage nur noch, mein Wechselrichter hat 3 Strings... Kann man das irgendwie anpassen...?

                    Gruß Jörg... (Und nochmals lieben Dank...)

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

                      @discotosca sagte in Wie Kostal Piko 3.6 Wechselrichter Visualisieren ?:

                      Kann man das irgendwie anpassen...?

                      wenn man weiß wo die Werte kommen
                      ich rate mal [11] und [13]??
                      @bahnuhr ?

                      D 1 Reply Last reply Reply Quote 0
                      • D
                        discotosca @Homoran last edited by

                        @homoran ... Bitte nochmal für jemanden, der nicht bis zum Hals im JavaScript steckt... 😞

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

                          @discotosca sagte in Wie Kostal Piko 3.6 Wechselrichter Visualisieren ?:

                          @homoran ... Bitte nochmal für jemanden, der nicht bis zum Hals im JavaScript steckt... 😞

                          also für mich!

                          irgendwo in der Abfrage steht das Ergebnis
                          ich tippe an Position 11 und 13.

                          du kannst über den Browser das Ergebnis abrufen.
                          leider habe ich diese alte Version nicht mehr und müsste selber nach der Vorgehensweise suchen.
                          Das kannst du auch. @bahnuhr hat einen weiteren Thread verlinkt

                          EDIT:
                          Abruf über den Browser müsste so gehen
                          http://User:Passwort@IP

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

                            @homoran sagte in Wie Kostal Piko 3.6 Wechselrichter Visualisieren ?:

                            http://User:Passwort@IP

                            Ja, das müsste gehen.

                            Du musst halt, wie @Homoran schon geschrieben hat rausfinden, an welcher Position deine Daten kommen.
                            Und dann das Script erweitern.

                            Probier es aus. Funktioniert dann schon.

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

                              @homoran sagte in Wie Kostal Piko 3.6 Wechselrichter Visualisieren ?:

                              http://User:Passwort@IP

                              Ne, funktioniert doch nicht.
                              Dann wird nur die normale UI angezeigt.

                              Schalte aber doch mal logging auf true und schaue dann was im log steht.
                              Und dann durchzählen.

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

                                @bahnuhr sagte in Wie Kostal Piko 3.6 Wechselrichter Visualisieren ?:

                                Dann wird nur die normale UI angezeigt.

                                ok!
                                ist schon zu lange her.
                                Dann mit der rechren Maustaste auf die Website, "Quelltext anzeigen" anklicken und diesen hier in code-tags posten.

                                @bahnuhr Das müsste bei dir aber auch gehen, wenn auch nur mit 0-Werten

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

                                  @homoran sagte in Wie Kostal Piko 3.6 Wechselrichter Visualisieren ?:

                                  @bahnuhr Das müsste bei dir aber auch gehen, wenn auch nur mit 0-Werten

                                  ja, geht

                                  Ich würde es aber mit "logging" probieren

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

                                    @bahnuhr sagte in Wie Kostal Piko 3.6 Wechselrichter Visualisieren ?:

                                    ja, geht

                                    wäre es dir möglich das umzusetzen, bitte?
                                    @discotosca schafft das nicht

                                    @discotosca sagte in Wie Kostal Piko 3.6 Wechselrichter Visualisieren ?:

                                    obwohl ich von Javascript ehrlich NULL Plan habe...

                                    dann wäre es ja gemäß meiner damaligen Vorgehensweise vielleicht doch mit dem Parser für dich einfacher

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

                                      @homoran sagte in Wie Kostal Piko 3.6 Wechselrichter Visualisieren ?:

                                      wäre es dir möglich das umzusetzen, bitte?
                                      @discotosca schafft das nicht

                                      Na klar.
                                      @discotosca
                                      Schick mir das log nachdem du logging auf true gesetzt hast.
                                      Dann schau ich mal.

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

                                        So, ich habe mir mein log mal angeschaut und das Script angepasst.
                                        Bitte prüfen und Rückinfo.

                                        1. Variablen anlegen:
                                        // 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'});
                                        createState('javascript.0.Geräte.Photovoltaik.Leistung_Strang3', 0, {type: 'number',name: 'Leistung Strang 3',min: 0,role: 'value'}); 
                                        

                                        2 angepasstes Script:

                                        
                                        // Photovoltaik: Piko 5.5 Anlage (alte Firmware)
                                        // Danke an homoran für den regex
                                        // @bahnuhr; 03/2019 Dieter Müller
                                        // @bahnuhr; 10/2021 Dieter Müller - angepasst auf 3 String
                                        
                                        //Variaben
                                            var idaktuell = 'javascript.0.Geräte.Photovoltaik.Leistung_aktuell';
                                            var idTag = 'javascript.0.Geräte.Photovoltaik.Tagesleistung';
                                            var idall = 'javascript.0.Geräte.Photovoltaik.Leistung_gesamt';
                                            var idP1 = 'javascript.0.Geräte.Photovoltaik.Leistung_Strang1';
                                            var idP2 = 'javascript.0.Geräte.Photovoltaik.Leistung_Strang2';
                                            var idP3 = 'javascript.0.Geräte.Photovoltaik.Leistung_Strang3';
                                        
                                            var NameAnlage = 'xxx';        // Nutzername der Photovoltaik-Anlage
                                            var PassAnlage = 'xxx';         // 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);
                                                var v3 = results[11];            // PV Generator Nr. 3 - Spannung in V
                                                var i3 = results[13];            // PV Generator Nr. 3 - Strom in A
                                                var p3 = parseInt(v3 * i3);
                                        
                                                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");
                                            	if (logging) log("Leistung Strang 3= " + p3 + " W");
                                        
                                                setState(idaktuell, parseFloat(pwr));
                                                setState(idTag, parseFloat(day));
                                                setState(idall, parseFloat(all));
                                                setState(idP1, parseFloat(p1));
                                                setState(idP2, parseFloat(p2));
                                                setState(idP3, parseFloat(p3));
                                            });
                                        }
                                        
                                        
                                        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.Geräte.Photovoltaik.Tagesleistung', 0);
                                        });
                                        
                                        

                                        mfg
                                        Dieter

                                        Edit: zeile 13 berichtigt

                                        W D I 3 Replies Last reply Reply Quote 3
                                        • W
                                          w00dy @bahnuhr last edited by w00dy

                                          @bahnuhr
                                          Hab's mal getestet:

                                          29.10.2021, 18:04:25.626	[error]: javascript.0 (708) script.js.Photovoltaik.Kostal-Piko-auslesen compile failed:
                                          at script.js.Photovoltaik.Kostal-Piko-auslesen:13
                                          
                                          M 1 Reply Last reply Reply Quote 0
                                          • M
                                            MartyBr @w00dy last edited by

                                            @w00dy
                                            In Zeile 13

                                            var idP3 = 'javascript.0.Geräte.Photovoltaik.Leistung_Strang3;

                                            fehlt das Hochkomma '

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            812
                                            Online

                                            31.7k
                                            Users

                                            79.9k
                                            Topics

                                            1.3m
                                            Posts

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