Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Parser

    NEWS

    • Monatsrückblick - April 2025

    • Minor js-controller 7.0.7 Update in latest repo

    • Save The Date: ioBroker@Smart Living Forum Solingen, 14.06.

    Parser

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

      @steinerma
      hast du den eine konkrete Frage?
      Falls ich irgendwo schon mal was geschrieben habe, dann musst mir das nochmal zeigen, kann micht nicht mehr erinnern.

      Das Skript scheint auch nicht vollständig zu sein.
      Da dürfte nicht viel passieren.

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

        @OliverIO Freundlicherweise hattest du mir das Skript am 28 Feb 2020, 14:32 (siehe in diesem Trade weiter oben) entschlüsselt. Der Regler, auf welchem die auszulesenden Werte enthält, gibt keine Werte aus. Die Werte müssen gemäss deinem Skript aus einer Datenbank abgerufen werden. Ich wäre schon glücklich, wenn ich Werte aus der Datenbank holen könnte.

        Dein Skript sollte ich noch so erweitern, dass da noch ein/oder mehrere Datenpunkte beschrieben werden können. Das habe ich mal nach bestem Wissen und Gewissen versucht...
        Leider kommt beim Datenpunkt modbus.0.holdingRegisters.862_ID175 (welchen ich beschreibe) immer nur die Zahl "0" raus.
        Meine Frage: weisst du, wo ich den Fehler mache? Gemäss deiner Rückmeldung von vorhin gehe ich davon aus, dass ich auch das Auslesen nicht korrekt erstellt habe?

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

          @steinerma
          ok dann lese nochmal meine Post von oben genau durch und führe alle Schritte durch.
          Bei Problemen frage konkret was nicht funktioniert.
          Das Skript 2 Posts hier drüber funktioniert nicht, weil es nicht vollständig ist.

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

            @OliverIO sagte in Parser:

            Evtl. kann @Homoran sein aktuelles Skript, falls er es nochmal verändert hat, hier bereitstellen.

            werde ich gerne machen.
            GHAbe aber noch nichts verändert, weil ich zum Glück noch keinen weiteren Fehler hatte und so die "Funtionsfähigkeit" im Live-Modus nicht testen konnte

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

              @steinerma Du arbeitest aber anscheinend über modbus.
              Das ist ganz was anderes - wir arbeiten über das Webinterface

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

                @Homoran Den Wert aus dem Webinterface möchte ich gerne über Modbusübertragen. Modbus funktioniert bei mir über den Modbusadapter.
                Jedoch erhalte ich keine Werte aus dem Webinterface...

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

                  @steinerma sagte in Parser:

                  Den Wert aus dem Webinterface möchte ich gerne über Modbusübertragen.

                  Das habe ich mir gedacht

                  @steinerma sagte in Parser:

                  Modbus funktioniert bei mir über den Modbusadapter.

                  Dann hast du ja die Fehlermeldungen

                  @steinerma sagte in Parser:

                  Jedoch erhalte ich keine Werte aus dem Webinterface...

                  Welche Version hast du denn da?

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

                    Danke für deine Antwort. Ursprünglich wollte ich die Werte mit Parser auslesen. OliverIO hat dann herausgefunden, dass die Werte nicht im Sourcecode stehen. Er konnte die Stelle, an der das ganze aus der Datenbank gelesen wird eruieren. Siehe in diese Trade vom 28 Feb 2020, 14:32.
                    Wenn ich das Ganze jetzt richtig interpretiere, muss ich keinen Parser-Adapter mehr haben sondern ein Skript erstellen. Den Parser-Adapter habe ich noch nicht deinstalliert, er hat Version 1.0.7

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

                      @steinerma sagte in Parser:

                      Danke für deine Antwort. Ursprünglich wollte ich die Werte mit Parser auslesen. OliverIO hat dann herausgefunden, dass die Werte nicht im Sourcecode stehen. Er konnte die Stelle, an der das ganze aus der Datenbank gelesen wird eruieren. Siehe in diese Trade vom 28 Feb 2020, 14:32.
                      Wenn ich das Ganze jetzt richtig interpretiere, muss ich keinen Parser-Adapter mehr haben sondern ein Skript erstellen. Den Parser-Adapter habe ich noch nicht deinstalliert, er hat Version 1.0.7

                      korrekt.
                      es kommt aber auf die Firmware-Version des Communication-Boards (und von dem Webinterface) vom Piko an, ob es im Code steht oder nicht.
                      deswegen hatte ich danach gefragt

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

                        @Homoran Ach so, bitte entschuldige - ich habe bei mir keinen Piko Wechselrichter. Es handelt sich bei mir um einen Sonnenkollektor-Regler der Firma Prozeda. Dieser ist über das Conexio 200 Modul verbunden. Das Conexio 200 Modul enthält einen LAN Anschluss und ist mit einem Webinterface ausgerüstet. Hier ein Beispiel der Messwerte:

                        9f3e1e07-5abd-4099-8d58-c4c9ef6aade9-image.png

                        Die Messwerte stehen aber leider nicht im Quelltext und somit lässt es sich nicht so einfach mit Parser auslesen 😞

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

                          @steinerma
                          Irgendwie fangen wir schon wieder von vorne an, obwohl das doch oben alles schon besprochen wurde. Die Werte sind in der Datei Logging.txt
                          https://forum.iobroker.net/topic/30628/parser/13
                          Ein paar Posts weiter hab ich geschrieben was man grob machen müsste.
                          Du musst es schon versuchen die Anweisungen umzusetzen, wenn du damit Probleme hast stell konkrete Fragen bei warst du Probleme hast.
                          Wir machen hier Code und Daten Reengineering
                          Das gehört schon etwas zu den fortgeschrittenen Disziplinen.
                          Allerdings musst du dich da auch in das ein oder andere versuchen einzulesen.
                          Wie gesagt, bevor du komplett verzweifelt stelle hier konkrete Fragen

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

                            @OliverIO Bitte entschuldige - ich bin mit Java überhaupt nicht bewandt.
                            habe hier versucht Daten aus der Logging.txt abzurufen:
                            (Zeilen 1-7). Kann man das so machen?

                            var request = require('request');
                            var url = 'http://192.168.0.34/logging.txt';
                            
                            function updateData()
                            {
                            sendRequest('medius_val.xml?dummy='+Math.round((Math.random()*99999999)), dataRequest);	
                            }
                             
                            
                            
                            OliverIO 1 Reply Last reply Reply Quote 0
                            • OliverIO
                              OliverIO @steinerma last edited by OliverIO

                              @steinerma
                              Ich glaube wir müssen da viel früher anfangen und erst mal Grundlagen vermitteln. An diesem Skript gibt es leider mehrere Probleme
                              Hast du mal nachgeschlagen, was die einzelnen Zeilen überhaupt tun?
                              Zeile eins: require Lädt zusätzliche Programmbibliotheken, welche im Basis Umfang von Nodejs/javascript nicht enthalten sind
                              Hier wird die Bibliothek Request geladen. Fast alle Bibliotheken werden in einer so genannten registry verwaltet.
                              Der Link zu Dieser registry und speziell zu diesem Paket lautet wie folgt
                              https://www.npmjs.com/package/request
                              Dort kann man nachlesen, was für Befehle diese Bibliothek überhaupt anbietet und wie diese zu verwenden sind
                              Request ist ein Paket mit dem man sehr leicht Dateien aus dem Internet abrufen kann und in Java Skript weiter verwenden Kann
                              Wenn du dort nach liest dann hilft dir das einfachste Beispiel schon weiter.

                              const request = require('request');
                              request('http://www.google.com', function (error, response, body) {
                                console.error('error:', error); // Print the error if one occurred
                                console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
                                console.log('body:', body); // Print the HTML for the Google homepage.
                              });
                              

                              In diesem Beispiel wird die Seite von Google aufgerufen, und wenn die Daten da sind, bekommst du das Ergebnis über die Parameter error Response und Body zurück.
                              Anhand der Erklärungen an den jeweiligen Zeilen siehst du das der Inhalt der Datei dann im body steht
                              Nimm einmal dieses Beispiel und setzt angeblich die Gestelle deine Adresse mit dem Logging.txt ein Und schauen was passiert
                              Wenn du Hilfe zu den einzelnen befehlen benötigst, hilft es schon diese zu kopieren und mit dem Zusatz Javascript in Google einfach einzugeben
                              Wie gesagt ohne debugger ist es etwas aufwändiger und der Befehl Console.log ist dein Freund, da er dir den Inhalt einzelner variablen ausgeht und du erkennen kannst ob etwas funktioniert oder nicht

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

                                @OliverIO Hallo Oliver
                                Du hast Recht, meine Kenntnisse sind wirklich praktisch 0. Ich hab begonnen mich einzulesen und festgestellt, dass ich hierfür Tage investieren müsste, um nur die kleinste Aufgabe lösen zu können. Da mir hierzu leider die Zeit fehlt, habe ich mich entschieden den Prozedaregler auszubauen und eine SPS einzubauen. Dies hat dann auch gleich noch den Vorteil, dass ich nicht nur Werte lesen sondern auch schreiben kann :-).
                                Ich danke dir dennoch für deine Unterstützung bis hierher.
                                schöne Grüsse

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

                                  @OliverIO
                                  Hallo nochmal,
                                  nachdem es jetzt länger still war habe ich wegen einer ähnlichen Anfrage in einem anderen Thread mich nochmal an das Skript gemacht.

                                  Auch wenn ich nicht wirklich mit javascript zurecht komme, habe ich einmal das json um zei eckige Klammern erweitert [], dadurch kann es mit dem json-Table Widget angezeigt werden, zum anderen habe ich dann noch (mit vielen Versuchen) die Uhrzeit neu formatiert, damit alles zweistellig mit führenden Nullen angezeigt wird:

                                  vorher:
                                  events.png

                                  jetzt:
                                  events02.png

                                  Mein größter Wunsch wäre aber, dass das Widget eine echte Tabelle zum Scrollen erhält.
                                  Habe mich durch den Code gequält, und irgendwo schreibst du in die Datenpunkte mit "Datenpunkt"+i.
                                  Aber wie ich das in ein großes JSON bekomme, habe ich nicht hinbekommen.

                                  Hier mein (ääh, dein) momentanes Skript:

                                  var domain = '192.168.138.103'; // domain or ip without http:// or https:// 
                                  var url = '/api/dxs.json';
                                  var datenpunkt = '0_userdata.0.Solaranlage.Info';
                                  //var datenpunkt = 'javascript.0.info';
                                  
                                  var msgs = [
                                  {"code":"3000","type":"Störung Updateprozess","description":"Interne Systemstörung","action":"Update des Wechselrichters durchführen."},
                                  {"code":"3003","type":"Interne Kommunikationsstörung","description":"Interne Kommunikationsstörung","action":"zwischen Netzüberwachung und Steuerung Internen Kommunikationsleitungen zwischen den einzelnen Leiterplatten kontrollieren"},
                                  {"code":"3006","type":"Interne Systemstörung ","description":"Interne Systemstörung bzgl. Leistungsabregelung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf. Support"},
                                  {"code":"3010","type":"Interne Kommunikationsstörung","description":"Interne Kommunikationsstörung","action":"zwischen Steuerung und Kommunkationsplatine Kontrollieren Sie die Uhrzeiteinstellung, Funktionalität der Kommunikationsplatine und weiterer Kommunikationseinstellungen. Wechselrichter schaltet trotz fehlerhaftem Zeitstempel auf"},
                                  {"code":"3011","type":"Interne Temperaturstörung","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"3012","type":"Störung Varistor","description":"DC-Varistor defekt","action":"Defekten Varistor tauschen"},
                                  {"code":"3013","type":"Interne Temperaturstörung","description":"Übertemperatur AC/DC an Leistungsstufe","action":"Installationsbedingungen und Lüfter kontrollieren"},
                                  {"code":"3014","type":"Interne Temperaturstörung","description":"Übertemperatur Prozessor","action":"Installationsbedingungen und Lüfter kontrollieren"},
                                  {"code":"3017","type":"Externe Generatorstörung","description":"Überspannung am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                  {"code":"3018","type":"Information","description":"Leistungsabregelung durch externe Vorgaben (Netzbetreiber)","action":"Keine Maßnahme notwendig"},
                                  {"code":"3019","type":"Externe Netzstörung","description":"Leistungsabregelung aufgrund eines Netzfehlers (erhöhte Netzfrequenz)","action":"Support"},
                                  {"code":"3020","type":"Externe Generatorstörung","description":"Überstrom am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                  {"code":"3021","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"3022","type":"Externe Generatorstörung","description":"Überspannung am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                  {"code":"3023","type":"Externe Generatorstörung","description":"Überstrom am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                  {"code":"3024","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"3025","type":"Externe Generatorstörung","description":"Überspannung am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                  {"code":"3026","type":"Externe Generatorstörung","description":"Überstrom am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                  {"code":"3027","type":"Interne Temperaturstörung","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"3028","type":"Externe Generatorstörung","description":"Überspannung am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                  {"code":"3029","type":"Externe Generatorstörung","description":"Überstrom am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                  {"code":"3030","type":"Interne Temperaturstörung","description":"Übertemperatur AC/DC an Leistungsstufe","action":"Installationsbedingungen und Lüfter kontrollieren"},
                                  {"code":"3031","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach Prüfung durch und schaltet generell auf"},
                                  {"code":"3032","type":"Externe Generatorstörung","description":"Überstrom am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                  {"code":"3033","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"3034","type":"Interne Systemstörung ","description":"Interner Zwischenkreisfehler","action":"Das Gerät neu starten"},
                                  {"code":"3035","type":"Interne Systemstörung ","description":"Interner Zwischenkreisfehler","action":"Das Gerät neu starten"},
                                  {"code":"3036","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                  {"code":"3037","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                  {"code":"3038","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                  {"code":"3039","type":"Interne Parametrierungsstörung","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                  {"code":"3045","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach Prüfung durch und schaltet generell auf"},
                                  {"code":"3046","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach Prüfung durch und schaltet generell auf"},
                                  {"code":"3047","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"3048","type":"Interne Kommunikationsstörung","description":"Interner Kommunikationsfehler","action":"Kontrollieren Sie die internen Kommunikationsleitungen zwischen den einzelnen Leiterplatten"},
                                  {"code":"3049","type":"Interne Kommunikationsstörung","description":"Interner Kommunikationsfehler","action":"Kontrollieren Sie die internen Kommunikationsleitungen zwischen den einzelnen Leiterplatten"},
                                  {"code":"3050","type":"Interne Kommunikationsstörung","description":"Interner Kommunikationsfehler","action":"Kontrollieren Sie die internen Kommunikationsleitungen zwischen den einzelnen Leiterplatten"},
                                  {"code":"3051","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"3052","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"3053","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"3054","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"3055","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Das Gerät neu starten"},
                                  {"code":"3056","type":"Interne Parametrierungsstörung","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                  {"code":"3057","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                  {"code":"3059","type":"Interne Parametrierungsstörung","description":"Falsche Parametrierung","action":"Ggf. falsche Ländereinstellung. Support kontaktieren"},
                                  {"code":"3060","type":"Interne Parametrierungsstörung","description":"Falsche Parametrierung","action":"Support kontaktiere"},
                                  {"code":"3061","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                  {"code":"3062","type":"Interne Temperaturstörung","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                  {"code":"3063","type":"Interne Parametrierungsstörung","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                  {"code":"3064","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                  {"code":"3065","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                  {"code":"3066","type":"Interne Parametrierungsstörung","description":"Interne Systemstörung","action":"Support kontaktiere"},
                                  {"code":"3068","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Das Gerät neu starten"},
                                  {"code":"3070","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf"},
                                  {"code":"3071","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf"},
                                  {"code":"3072","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf"},
                                  {"code":"3073","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf"},
                                  {"code":"3074","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf"},
                                  {"code":"3075","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf"},
                                  {"code":"3076","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Die AC-Spannung ist gegebenenfalls zu niedrig"},
                                  {"code":"3079","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Das Gerät neu starten"},
                                  {"code":"3080","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Das Gerät neu starten"},
                                  {"code":"3082","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                  {"code":"3083","type":"Information","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig1"},
                                  {"code":"3084","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                  {"code":"3085","type":"Interne Temperaturstörung","description":"Übertemperatur Prozessor","action":"Installationsbedingungen und Lüfter kontrollieren1 "},
                                  {"code":"3086","type":"Information","description":"Leistungsabregelung aufgrund eines Netzfehlers (erhöhte AC-Spannung)","action":"Support"},
                                  {"code":"3087","type":"Interne Systemstörung ","description":"Interner Systemfehler","action":"Support kontaktieren"},
                                  {"code":"3088","type":"Interne Systemstörung ","description":"Lüftereinheit verschmutzt","action":"Lüftereinheit reinigen"},
                                  {"code":"3089","type":"Interne Systemstörung ","description":"Lüftereinheit verschmutzt","action":"Lüftereinheit reinigen"},
                                  {"code":"3090","type":"Interne Systemstörung ","description":"Interner Systemfehler","action":"Support kontaktieren"},
                                  {"code":"3091","type":"Interne Systemstörung ","description":"Lüfter nicht korrekt angeschlossen","action":"Lüfter-Steckverbindungen prüfe"},
                                  {"code":"3092","type":"Interne Systemstörung ","description":"Lüfter nicht korrekt angeschlossen","action":"Lüfter-Steckverbindungen prüfe"},
                                  {"code":"3093","type":"Interne Parametrierungsstörung","description":"Falsche Parametrierung","action":"Support kontaktiere"},
                                  {"code":"3094","type":"Interne Parametrierungsstörung","description":"Falsche Parametrierung","action":"Support kontaktiere"},
                                  {"code":"3095","type":"Interne Parametrierungsstörung","description":"Falsche Kalibrierung","action":"Support kontaktiere"},
                                  {"code":"3096","type":"Information","description":"Falsche Dimensionierung der PV-Generator","action":"Generatorinstallation/ -auslegung kontrolliere"},
                                  {"code":"3097","type":"Interne Parametrierungsstörung","description":"Falsche Parametrierung","action":"Support kontaktiere"},
                                  {"code":"3098","type":"Information","description":"Netz nicht vorhanden","action":"Keine Maßnahme notwendig"},
                                  {"code":"3101","type":"Information","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                  {"code":"3102","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                  {"code":"3103","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                  {"code":"3104","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf"},
                                  {"code":"3105","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                  {"code":"3106","type":"Information","description":"Falsche Eingabe am KomBoard oder falsche Verdrahtung","action":"Eingabe oder Verdrahtung korriegieren"},
                                  {"code":"4100","type":"Interne Systemstörung ","description":"Interner Softwarefehler","action":"Support"},
                                  {"code":"4101","type":"Interne Systemstörung ","description":"Erhöhter DC-Strom L1","action":"Support"},
                                  {"code":"4102","type":"Interne Systemstörung ","description":"Erhöhter DC-Strom L2","action":"Support"},
                                  {"code":"4103","type":"Interne Systemstörung ","description":"Erhöhter DC-Strom L3","action":"Support"},
                                  {"code":"4104","type":"Interne Systemstörung ","description":"Erhöhter DC-Strom L1","action":"Support"},
                                  {"code":"4105","type":"Interne Systemstörung ","description":"Erhöhter DC-Strom L2","action":"Support"},
                                  {"code":"4106","type":"Interne Systemstörung ","description":"Erhöhter DC-Strom L3","action":"Support"},
                                  {"code":"4110","type":"Interne Systemstörung ","description":"Interner Softwarefehler","action":"Support"},
                                  {"code":"4121","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"4122","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"4130","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"4131","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"4150","type":"Information","description":"Erhöhte Netzfrequenz. Oft gehäuftes Auftreten am Morgen und am Abend.","action":"Installation kontrollieren"},
                                  {"code":"4151","type":"Externe Netzstörung","description":"Zu niedrige Netzfrequenz","action":"Installation kontrollieren"},
                                  {"code":"4157","type":"Externe Netzstörung","description":"Erhöhte Netzfrequenz","action":"Keine Maßnahme notwendig"},
                                  {"code":"4158","type":"Externe Netzstörung","description":"Erhöhte Netzfrequenz","action":"Installation kontrollieren"},
                                  {"code":"4159","type":"Externe Netzstörung","description":"Erhöhte Netzfrequenz","action":"Installation kontrollieren"},
                                  {"code":"4160","type":"Externe Netzstörung","description":"Erhöhte Netzfrequenz","action":"Installation kontrollieren"},
                                  {"code":"4161","type":"Externe Netzstörung","description":"Zu niedrige Netzfrequenz","action":"Installation kontrollieren"},
                                  {"code":"4170","type":"Information","description":"Eine Phase ist nicht angeschlossen. Ein Sicherungsautomat wurde nicht eingeschaltet.","action":"Installation kontrollieren"},
                                  {"code":"4180","type":"Externe Netzstörung","description":"PE-Leitung nicht angeschlossen","action":"Installation kontrollieren"},
                                  {"code":"4181","type":"Externe Netzstörung","description":"PE-Leitung nicht angeschlossen","action":"Installation kontrollieren "},
                                  {"code":"4185","type":"Interne Systemstörung ","description":"Interner Softwarefehler","action":"Support1 "},
                                  {"code":"4200","type":"Externe Netzstörung","description":"Erhöhte Netzspannung","action":"Installation kontrollieren "},
                                  {"code":"4201","type":"Externe Netzstörung","description":"Zu niedrige Netzspannung","action":"Installation kontrollieren "},
                                  {"code":"4210","type":"Externe Netzstörung","description":"Erhöhte Netzspannung","action":"Installation kontrollieren "},
                                  {"code":"4211","type":"Externe Netzstörung","description":"Zu niedrige Netzspannung","action":"Installation kontrollieren "},
                                  {"code":"4220","type":"Externe Netzstörung","description":"Spannungsmittelwert der letzten 10 Min. zu groß","action":"Installation kontrollieren "},
                                  {"code":"4221","type":"Externe Netzstörung","description":"Spannungsmittelwert der letzten 10 Min. zu groß","action":"Installation kontrollieren "},
                                  {"code":"4290","type":"Externe Netzstörung","description":"Die Netzfrequenz hat sich zu schnell verändert.","action":"Generatorinstallation kontrollieren "},
                                  {"code":"4300","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"4301","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"4302","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"4303","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"4304","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"4321","type":"Interne Parametrierungsstörung","description":"Defektes EEPROM unerlaubte Speicherzugriffe","action":"Support"},
                                  {"code":"4322","type":"Interne Parametrierungsstörung","description":"Softwarefehler","action":"Support kontaktieren"},
                                  {"code":"4323","type":"Interne Parametrierungsstörung","description":"Fehlerstrom","action":"Support"},
                                  {"code":"4324","type":"Interne Parametrierungsstörung","description":"Parameterfehler","action":"Support"},
                                  {"code":"4325","type":"Interne Parametrierungsstörung","description":"Parameterfehler","action":"Support"},
                                  {"code":"4340","type":"-","description":"","action":""},
                                  {"code":"4354","type":"Externer Fehlerstrom","description":"Fehlerstrom","action":"Generatorinstallation kontrollieren "},
                                  {"code":"4360","type":"-","description":"","action":""},
                                  {"code":"4421","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support "},
                                  {"code":"4422","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support kontaktieren. "},
                                  {"code":"4424","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                  {"code":"4425","type":"Interne Parametrierungsstörung","description":"Parameterfehler","action":"Support "},
                                  {"code":"4450","type":"Externe Isolationsfehler","description":"Isolationsfehler","action":"Generatorinstallation kontrollieren "},
                                  {"code":"4451","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support kontaktieren "},
                                  {"code":"4475","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support "},
                                  {"code":"4476","type":"Information","description":"Schwache PV-Versorgung (z.B. morgens)","action":"Keine Maßnahme notwendig "},
                                  {"code":"4800","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support "},
                                  {"code":"4801","type":"Interne Systemstörung ","description":"Isolationsfehler","action":"Support "},
                                  {"code":"4802","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support "},
                                  {"code":"4803","type":"Interne Systemstörung ","description":"Isolationsfehler","action":"Support "},
                                  {"code":"4804","type":"Interne Systemstörung ","description":"Isolationsfehler","action":"Support "},
                                  {"code":"4805","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support "},
                                  {"code":"4810","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support "},
                                  {"code":"4850","type":"Interne Systemstörung ","description":"EVU","action":"Support "},
                                  {"code":"4870","type":"-","description":"","action":""},
                                  {"code":"7500","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support "},
                                  {"code":"7503","type":"Information","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"}
                                  ];
                                  
                                  
                                  
                                  function getEvents() {
                                     //log('getEvents');
                                     var keys = [];
                                     var key1 = 234881792;
                                     var key2 = 234881537;  
                                     keys.push(key1);
                                     for (var i=0;i<10;i++) {
                                         keys.push(key2+i);
                                     }
                                  
                                     pikorequest(keys, function(response){
                                         //log('events: '+ JSON.stringify(response));
                                         var item,len
                                         if (typeof response === 'string') response = JSON.parse(response);
                                         item = getResponseId(response,234881792);
                                         len = item.value;
                                         for (var i=0;i<len;i++) {
                                             item = getResponseId(response,234881537+i);
                                             var d,date,code,env;
                                             d = item.value;
                                             date = timeConverter((d[0] << 0) + (d[1] << 8) + (d[2] << 16) + (d[3] << 24));
                                             code = (d[4] << 0) + (d[5] << 8);
                                             env = ("0000"+((d[6] << 0) + (d[7] << 8)).toString(16)).toLocaleUpperCase().substr(-4,4)+'h';
                                             var msg = msgs.find(item => item.code==code);
                                             msg.date=date;
                                             var msgtext = 'Code: '+msg.code+' Typ: '+msg.type+' Beschreibung: '+msg.description+' Maßnahme: '+msg.action
                                             //log('message' + i+1 + ': ' + date + ' '  + code + ' '  + env + ' '+msgtext);
                                             //log("Datenpunkt: "+ datenpunkt+i + " Fehlermeldung: " + msgtext + true/*ack*/);
                                             setState(datenpunkt+i,`[` + JSON.stringify(msg) +`]`, true/*ack*/);
                                         }
                                     });
                                  }
                                  
                                  function pikorequest(keys,callback) {
                                     //log('pikorequest');
                                     if (keys.length==0) {
                                         //log('request error: No keys ');
                                         return;     
                                     }
                                  
                                     var query = '';
                                  
                                     for (var i = 0; i < keys.length; i++) { 
                                         query += '&dxsEntries=' + keys[i];
                                     }
                                  
                                     var req_url = 'http://' + domain + url + '?sessionid=iobroker' + query;
                                     //log ('query: '+req_url);
                                  
                                     request(
                                         { method: 'GET',
                                         uri: req_url,
                                         }
                                     , function (error, response, body) {
                                                 //log('error: ' + error);
                                                 //log('Status: '+ response.statusCode);
                                                 //log('response: '+ JSON.stringify(response));
                                                 //response.body = '{"dxsEntries":[{"dxsId":234881792,"value":1},{"dxsId":234881537,"value":[207,217,88,94,63,16,2,0]},{"dxsId":234881538,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881539,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881540,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881541,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881542,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881543,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881544,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881545,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881546,"value":[0,0,0,0,0,0,0,0]}],"session":{"sessionId":0,"roleId":0},"status":{"code":0}}';
                                                 //response.statusCode = 200;
                                                 //error = false;
                                  
                                             if (!error && response.statusCode == 200) {
                                                 //log('request ok: ');
                                                 //log('Status: '+ response.statusCode);
                                                 //log('response: '+ JSON.stringify(response));
                                                 callback(response.body);
                                             } else {
                                                 log('request nok: ');
                                                 //log('Status: '+ response.statusCode);
                                                 //log('error: ' + error);
                                             }
                                         }
                                     );
                                  }
                                  function getResponseId(response,id) {
                                     return response.dxsEntries.find( item => item.dxsId === id );
                                  }
                                  function timeConverter(UNIX_timestamp){
                                   var a = new Date(UNIX_timestamp * 1000);
                                   var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
                                   var year = a.getFullYear();
                                   var month = months[a.getMonth()];
                                   var date = a.getDate();
                                   var hour = ('0'+a.getHours()).slice(-2);
                                   var min = ('0'+a.getMinutes()).slice(-2);
                                   var sec = ('0'+a.getSeconds()).slice(-2);
                                   var time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec ;
                                   return time;
                                   log (time);
                                  }
                                  schedule("* * * * *", getEvents);
                                  

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

                                    @Homoran

                                    wir haben die maximal 5 möglichen Meldungen jeweils in einen separaten Datenpunkt geschrieben. Um es im JSON-Table widget anzuzeigen, muss man daraus ein array (also eine Liste) machen, was du ja dann auch mit den eckigen Klammern gemacht hast. Nur würde in der Tabelle ja nie mehr wie ein Eintrag stehen.
                                    Daher habe ich den code ein wenig erweitert (2 Zeilen wo msgs vorkommt). jetzt wird dir noch zusätzlich in einen weiteren Datenpunkt die erzeugte Liste aller Meldungen geschrieben. Diesen Datenpunkt kannst du nun für das JSON table widget verwenden.
                                    Leider konnte ich da so nicht direkt testen, müsste aber passen.

                                    var domain = '192.168.138.103'; // domain or ip without http:// or https:// 
                                    var url = '/api/dxs.json';
                                    var datenpunkt = '0_userdata.0.Solaranlage.Info';
                                    //var datenpunkt = 'javascript.0.info';
                                     
                                    var msgs = [
                                    {"code":"3000","type":"Störung Updateprozess","description":"Interne Systemstörung","action":"Update des Wechselrichters durchführen."},
                                    {"code":"3003","type":"Interne Kommunikationsstörung","description":"Interne Kommunikationsstörung","action":"zwischen Netzüberwachung und Steuerung Internen Kommunikationsleitungen zwischen den einzelnen Leiterplatten kontrollieren"},
                                    {"code":"3006","type":"Interne Systemstörung ","description":"Interne Systemstörung bzgl. Leistungsabregelung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf. Support"},
                                    {"code":"3010","type":"Interne Kommunikationsstörung","description":"Interne Kommunikationsstörung","action":"zwischen Steuerung und Kommunkationsplatine Kontrollieren Sie die Uhrzeiteinstellung, Funktionalität der Kommunikationsplatine und weiterer Kommunikationseinstellungen. Wechselrichter schaltet trotz fehlerhaftem Zeitstempel auf"},
                                    {"code":"3011","type":"Interne Temperaturstörung","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"3012","type":"Störung Varistor","description":"DC-Varistor defekt","action":"Defekten Varistor tauschen"},
                                    {"code":"3013","type":"Interne Temperaturstörung","description":"Übertemperatur AC/DC an Leistungsstufe","action":"Installationsbedingungen und Lüfter kontrollieren"},
                                    {"code":"3014","type":"Interne Temperaturstörung","description":"Übertemperatur Prozessor","action":"Installationsbedingungen und Lüfter kontrollieren"},
                                    {"code":"3017","type":"Externe Generatorstörung","description":"Überspannung am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                    {"code":"3018","type":"Information","description":"Leistungsabregelung durch externe Vorgaben (Netzbetreiber)","action":"Keine Maßnahme notwendig"},
                                    {"code":"3019","type":"Externe Netzstörung","description":"Leistungsabregelung aufgrund eines Netzfehlers (erhöhte Netzfrequenz)","action":"Support"},
                                    {"code":"3020","type":"Externe Generatorstörung","description":"Überstrom am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                    {"code":"3021","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"3022","type":"Externe Generatorstörung","description":"Überspannung am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                    {"code":"3023","type":"Externe Generatorstörung","description":"Überstrom am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                    {"code":"3024","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"3025","type":"Externe Generatorstörung","description":"Überspannung am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                    {"code":"3026","type":"Externe Generatorstörung","description":"Überstrom am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                    {"code":"3027","type":"Interne Temperaturstörung","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"3028","type":"Externe Generatorstörung","description":"Überspannung am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                    {"code":"3029","type":"Externe Generatorstörung","description":"Überstrom am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                    {"code":"3030","type":"Interne Temperaturstörung","description":"Übertemperatur AC/DC an Leistungsstufe","action":"Installationsbedingungen und Lüfter kontrollieren"},
                                    {"code":"3031","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach Prüfung durch und schaltet generell auf"},
                                    {"code":"3032","type":"Externe Generatorstörung","description":"Überstrom am PV-Generator","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                    {"code":"3033","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"3034","type":"Interne Systemstörung ","description":"Interner Zwischenkreisfehler","action":"Das Gerät neu starten"},
                                    {"code":"3035","type":"Interne Systemstörung ","description":"Interner Zwischenkreisfehler","action":"Das Gerät neu starten"},
                                    {"code":"3036","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                    {"code":"3037","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                    {"code":"3038","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                    {"code":"3039","type":"Interne Parametrierungsstörung","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                    {"code":"3045","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach Prüfung durch und schaltet generell auf"},
                                    {"code":"3046","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach Prüfung durch und schaltet generell auf"},
                                    {"code":"3047","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"3048","type":"Interne Kommunikationsstörung","description":"Interner Kommunikationsfehler","action":"Kontrollieren Sie die internen Kommunikationsleitungen zwischen den einzelnen Leiterplatten"},
                                    {"code":"3049","type":"Interne Kommunikationsstörung","description":"Interner Kommunikationsfehler","action":"Kontrollieren Sie die internen Kommunikationsleitungen zwischen den einzelnen Leiterplatten"},
                                    {"code":"3050","type":"Interne Kommunikationsstörung","description":"Interner Kommunikationsfehler","action":"Kontrollieren Sie die internen Kommunikationsleitungen zwischen den einzelnen Leiterplatten"},
                                    {"code":"3051","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"3052","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"3053","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"3054","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"3055","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Das Gerät neu starten"},
                                    {"code":"3056","type":"Interne Parametrierungsstörung","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                    {"code":"3057","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Generatorinstallation/ -auslegung kontrollieren"},
                                    {"code":"3059","type":"Interne Parametrierungsstörung","description":"Falsche Parametrierung","action":"Ggf. falsche Ländereinstellung. Support kontaktieren"},
                                    {"code":"3060","type":"Interne Parametrierungsstörung","description":"Falsche Parametrierung","action":"Support kontaktiere"},
                                    {"code":"3061","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                    {"code":"3062","type":"Interne Temperaturstörung","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                    {"code":"3063","type":"Interne Parametrierungsstörung","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                    {"code":"3064","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                    {"code":"3065","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                    {"code":"3066","type":"Interne Parametrierungsstörung","description":"Interne Systemstörung","action":"Support kontaktiere"},
                                    {"code":"3068","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Das Gerät neu starten"},
                                    {"code":"3070","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf"},
                                    {"code":"3071","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf"},
                                    {"code":"3072","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf"},
                                    {"code":"3073","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf"},
                                    {"code":"3074","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf"},
                                    {"code":"3075","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf"},
                                    {"code":"3076","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Die AC-Spannung ist gegebenenfalls zu niedrig"},
                                    {"code":"3079","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Das Gerät neu starten"},
                                    {"code":"3080","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Das Gerät neu starten"},
                                    {"code":"3082","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                    {"code":"3083","type":"Information","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig1"},
                                    {"code":"3084","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support kontaktieren"},
                                    {"code":"3085","type":"Interne Temperaturstörung","description":"Übertemperatur Prozessor","action":"Installationsbedingungen und Lüfter kontrollieren1 "},
                                    {"code":"3086","type":"Information","description":"Leistungsabregelung aufgrund eines Netzfehlers (erhöhte AC-Spannung)","action":"Support"},
                                    {"code":"3087","type":"Interne Systemstörung ","description":"Interner Systemfehler","action":"Support kontaktieren"},
                                    {"code":"3088","type":"Interne Systemstörung ","description":"Lüftereinheit verschmutzt","action":"Lüftereinheit reinigen"},
                                    {"code":"3089","type":"Interne Systemstörung ","description":"Lüftereinheit verschmutzt","action":"Lüftereinheit reinigen"},
                                    {"code":"3090","type":"Interne Systemstörung ","description":"Interner Systemfehler","action":"Support kontaktieren"},
                                    {"code":"3091","type":"Interne Systemstörung ","description":"Lüfter nicht korrekt angeschlossen","action":"Lüfter-Steckverbindungen prüfe"},
                                    {"code":"3092","type":"Interne Systemstörung ","description":"Lüfter nicht korrekt angeschlossen","action":"Lüfter-Steckverbindungen prüfe"},
                                    {"code":"3093","type":"Interne Parametrierungsstörung","description":"Falsche Parametrierung","action":"Support kontaktiere"},
                                    {"code":"3094","type":"Interne Parametrierungsstörung","description":"Falsche Parametrierung","action":"Support kontaktiere"},
                                    {"code":"3095","type":"Interne Parametrierungsstörung","description":"Falsche Kalibrierung","action":"Support kontaktiere"},
                                    {"code":"3096","type":"Information","description":"Falsche Dimensionierung der PV-Generator","action":"Generatorinstallation/ -auslegung kontrolliere"},
                                    {"code":"3097","type":"Interne Parametrierungsstörung","description":"Falsche Parametrierung","action":"Support kontaktiere"},
                                    {"code":"3098","type":"Information","description":"Netz nicht vorhanden","action":"Keine Maßnahme notwendig"},
                                    {"code":"3101","type":"Information","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                    {"code":"3102","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                    {"code":"3103","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                    {"code":"3104","type":"Interne Systemstörung ","description":"Interne AC-Systemstörung","action":"Gerät führt mehrfach eine Prüfung durch und schaltet generell auf"},
                                    {"code":"3105","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"},
                                    {"code":"3106","type":"Information","description":"Falsche Eingabe am KomBoard oder falsche Verdrahtung","action":"Eingabe oder Verdrahtung korriegieren"},
                                    {"code":"4100","type":"Interne Systemstörung ","description":"Interner Softwarefehler","action":"Support"},
                                    {"code":"4101","type":"Interne Systemstörung ","description":"Erhöhter DC-Strom L1","action":"Support"},
                                    {"code":"4102","type":"Interne Systemstörung ","description":"Erhöhter DC-Strom L2","action":"Support"},
                                    {"code":"4103","type":"Interne Systemstörung ","description":"Erhöhter DC-Strom L3","action":"Support"},
                                    {"code":"4104","type":"Interne Systemstörung ","description":"Erhöhter DC-Strom L1","action":"Support"},
                                    {"code":"4105","type":"Interne Systemstörung ","description":"Erhöhter DC-Strom L2","action":"Support"},
                                    {"code":"4106","type":"Interne Systemstörung ","description":"Erhöhter DC-Strom L3","action":"Support"},
                                    {"code":"4110","type":"Interne Systemstörung ","description":"Interner Softwarefehler","action":"Support"},
                                    {"code":"4121","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"4122","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"4130","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"4131","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"4150","type":"Information","description":"Erhöhte Netzfrequenz. Oft gehäuftes Auftreten am Morgen und am Abend.","action":"Installation kontrollieren"},
                                    {"code":"4151","type":"Externe Netzstörung","description":"Zu niedrige Netzfrequenz","action":"Installation kontrollieren"},
                                    {"code":"4157","type":"Externe Netzstörung","description":"Erhöhte Netzfrequenz","action":"Keine Maßnahme notwendig"},
                                    {"code":"4158","type":"Externe Netzstörung","description":"Erhöhte Netzfrequenz","action":"Installation kontrollieren"},
                                    {"code":"4159","type":"Externe Netzstörung","description":"Erhöhte Netzfrequenz","action":"Installation kontrollieren"},
                                    {"code":"4160","type":"Externe Netzstörung","description":"Erhöhte Netzfrequenz","action":"Installation kontrollieren"},
                                    {"code":"4161","type":"Externe Netzstörung","description":"Zu niedrige Netzfrequenz","action":"Installation kontrollieren"},
                                    {"code":"4170","type":"Information","description":"Eine Phase ist nicht angeschlossen. Ein Sicherungsautomat wurde nicht eingeschaltet.","action":"Installation kontrollieren"},
                                    {"code":"4180","type":"Externe Netzstörung","description":"PE-Leitung nicht angeschlossen","action":"Installation kontrollieren"},
                                    {"code":"4181","type":"Externe Netzstörung","description":"PE-Leitung nicht angeschlossen","action":"Installation kontrollieren "},
                                    {"code":"4185","type":"Interne Systemstörung ","description":"Interner Softwarefehler","action":"Support1 "},
                                    {"code":"4200","type":"Externe Netzstörung","description":"Erhöhte Netzspannung","action":"Installation kontrollieren "},
                                    {"code":"4201","type":"Externe Netzstörung","description":"Zu niedrige Netzspannung","action":"Installation kontrollieren "},
                                    {"code":"4210","type":"Externe Netzstörung","description":"Erhöhte Netzspannung","action":"Installation kontrollieren "},
                                    {"code":"4211","type":"Externe Netzstörung","description":"Zu niedrige Netzspannung","action":"Installation kontrollieren "},
                                    {"code":"4220","type":"Externe Netzstörung","description":"Spannungsmittelwert der letzten 10 Min. zu groß","action":"Installation kontrollieren "},
                                    {"code":"4221","type":"Externe Netzstörung","description":"Spannungsmittelwert der letzten 10 Min. zu groß","action":"Installation kontrollieren "},
                                    {"code":"4290","type":"Externe Netzstörung","description":"Die Netzfrequenz hat sich zu schnell verändert.","action":"Generatorinstallation kontrollieren "},
                                    {"code":"4300","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"4301","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"4302","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"4303","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"4304","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"4321","type":"Interne Parametrierungsstörung","description":"Defektes EEPROM unerlaubte Speicherzugriffe","action":"Support"},
                                    {"code":"4322","type":"Interne Parametrierungsstörung","description":"Softwarefehler","action":"Support kontaktieren"},
                                    {"code":"4323","type":"Interne Parametrierungsstörung","description":"Fehlerstrom","action":"Support"},
                                    {"code":"4324","type":"Interne Parametrierungsstörung","description":"Parameterfehler","action":"Support"},
                                    {"code":"4325","type":"Interne Parametrierungsstörung","description":"Parameterfehler","action":"Support"},
                                    {"code":"4340","type":"-","description":"","action":""},
                                    {"code":"4354","type":"Externer Fehlerstrom","description":"Fehlerstrom","action":"Generatorinstallation kontrollieren "},
                                    {"code":"4360","type":"-","description":"","action":""},
                                    {"code":"4421","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support "},
                                    {"code":"4422","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support kontaktieren. "},
                                    {"code":"4424","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support"},
                                    {"code":"4425","type":"Interne Parametrierungsstörung","description":"Parameterfehler","action":"Support "},
                                    {"code":"4450","type":"Externe Isolationsfehler","description":"Isolationsfehler","action":"Generatorinstallation kontrollieren "},
                                    {"code":"4451","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support kontaktieren "},
                                    {"code":"4475","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support "},
                                    {"code":"4476","type":"Information","description":"Schwache PV-Versorgung (z.B. morgens)","action":"Keine Maßnahme notwendig "},
                                    {"code":"4800","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support "},
                                    {"code":"4801","type":"Interne Systemstörung ","description":"Isolationsfehler","action":"Support "},
                                    {"code":"4802","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support "},
                                    {"code":"4803","type":"Interne Systemstörung ","description":"Isolationsfehler","action":"Support "},
                                    {"code":"4804","type":"Interne Systemstörung ","description":"Isolationsfehler","action":"Support "},
                                    {"code":"4805","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support "},
                                    {"code":"4810","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support "},
                                    {"code":"4850","type":"Interne Systemstörung ","description":"EVU","action":"Support "},
                                    {"code":"4870","type":"-","description":"","action":""},
                                    {"code":"7500","type":"Interne Systemstörung ","description":"Interne Systemstörung","action":"Support "},
                                    {"code":"7503","type":"Information","description":"Interne Systemstörung","action":"Keine Maßnahme notwendig"}
                                    ];
                                     
                                     
                                     
                                    function getEvents() {
                                       //log('getEvents');
                                       var keys = [];
                                       var key1 = 234881792;
                                       var key2 = 234881537;  
                                       keys.push(key1);
                                       for (var i=0;i<10;i++) {
                                           keys.push(key2+i);
                                       }
                                     
                                       pikorequest(keys, function(response){
                                           //log('events: '+ JSON.stringify(response));
                                           var item,len;
                                           var msgs = [];
                                           if (typeof response === 'string') response = JSON.parse(response);
                                           item = getResponseId(response,234881792);
                                           len = item.value;
                                           for (var i=0;i<len;i++) {
                                               item = getResponseId(response,234881537+i);
                                               var d,date,code,env;
                                               d = item.value;
                                               date = timeConverter((d[0] << 0) + (d[1] << 8) + (d[2] << 16) + (d[3] << 24));
                                               code = (d[4] << 0) + (d[5] << 8);
                                               env = ("0000"+((d[6] << 0) + (d[7] << 8)).toString(16)).toLocaleUpperCase().substr(-4,4)+'h';
                                               var msg = msgs.find(item => item.code==code);
                                               msg.date=date;
                                               var msgtext = 'Code: '+msg.code+' Typ: '+msg.type+' Beschreibung: '+msg.description+' Maßnahme: '+msg.action
                                               //log('message' + i+1 + ': ' + date + ' '  + code + ' '  + env + ' '+msgtext);
                                               //log("Datenpunkt: "+ datenpunkt+i + " Fehlermeldung: " + msgtext + true/*ack*/);
                                               setState(datenpunkt+i,`[` + JSON.stringify(msg) +`]`, true/*ack*/);
                                               msgs.push(msg);
                                           }
                                           setState(datenpunkt, JSON.stringify(msgs) , true/*ack*/);
                                        });
                                    }
                                     
                                    function pikorequest(keys,callback) {
                                       //log('pikorequest');
                                       if (keys.length==0) {
                                           //log('request error: No keys ');
                                           return;     
                                       }
                                     
                                       var query = '';
                                     
                                       for (var i = 0; i < keys.length; i++) { 
                                           query += '&dxsEntries=' + keys[i];
                                       }
                                     
                                       var req_url = 'http://' + domain + url + '?sessionid=iobroker' + query;
                                       //log ('query: '+req_url);
                                     
                                       request(
                                           { method: 'GET',
                                           uri: req_url,
                                           }
                                       , function (error, response, body) {
                                                   //log('error: ' + error);
                                                   //log('Status: '+ response.statusCode);
                                                   //log('response: '+ JSON.stringify(response));
                                                   //response.body = '{"dxsEntries":[{"dxsId":234881792,"value":1},{"dxsId":234881537,"value":[207,217,88,94,63,16,2,0]},{"dxsId":234881538,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881539,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881540,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881541,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881542,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881543,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881544,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881545,"value":[0,0,0,0,0,0,0,0]},{"dxsId":234881546,"value":[0,0,0,0,0,0,0,0]}],"session":{"sessionId":0,"roleId":0},"status":{"code":0}}';
                                                   //response.statusCode = 200;
                                                   //error = false;
                                     
                                               if (!error && response.statusCode == 200) {
                                                   //log('request ok: ');
                                                   //log('Status: '+ response.statusCode);
                                                   //log('response: '+ JSON.stringify(response));
                                                   callback(response.body);
                                               } else {
                                                   log('request nok: ');
                                                   //log('Status: '+ response.statusCode);
                                                   //log('error: ' + error);
                                               }
                                           }
                                       );
                                    }
                                    function getResponseId(response,id) {
                                       return response.dxsEntries.find( item => item.dxsId === id );
                                    }
                                    function timeConverter(UNIX_timestamp){
                                     var a = new Date(UNIX_timestamp * 1000);
                                     var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
                                     var year = a.getFullYear();
                                     var month = months[a.getMonth()];
                                     var date = a.getDate();
                                     var hour = ('0'+a.getHours()).slice(-2);
                                     var min = ('0'+a.getMinutes()).slice(-2);
                                     var sec = ('0'+a.getSeconds()).slice(-2);
                                     var time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec ;
                                     return time;
                                     log (time);
                                    }
                                    schedule("* * * * *", getEvents);
                                    
                                    Homoran 1 Reply Last reply Reply Quote 0
                                    • Homoran
                                      Homoran Global Moderator Administrators @OliverIO last edited by Homoran

                                      Erst noch einmal ein herzliches dankeschön!
                                      @OliverIO sagte in Parser:

                                      wir haben die maximal 5 möglichen Meldungen jeweils in einen separaten Datenpunkt geschrieben

                                      nicht wirklich:
                                      in den 10! (0-9) Datenpunkten steht immer die selbe Meldung an verschiedenen Terminen

                                      @OliverIO sagte in Parser:

                                      Nur würde in der Tabelle ja nie mehr wie ein Eintrag stehen.

                                      genau!
                                      und bräuchte ich dann ein Array mit Arrays?

                                      @OliverIO sagte in Parser:

                                      jetzt wird dir noch zusätzlich in einen weiteren Datenpunkt die erzeugte Liste aller Meldungen geschrieben.

                                      Habe das Skript übernommen, gestartet.
                                      Ein weiterer Datenpunkt wird nicht angelegt - muss ich das machen? Wäre kein Problem, aber ich habe im Code nach setState gesucht und nichts neues gefunden 😞

                                      EDIT:
                                      ist es diese Stelle setState(datenpunkt, JSON.stringify(msgs) , true/*ack*/); ?
                                      also Solaranlage.Info ohne 0-9?

                                      Habe ich jetzt angelegt - aber passiert (bis jetzt noch) nichts

                                      EDIT2:
                                      habe jetzt jede Minute folgende Meldung im log: javascript.0 2020-09-01 11:16:00.059 error (32463) Error in request callback: TypeError: Cannot set property 'date' of undefined

                                      finde dazu aber sonst nichts

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

                                        @Homoran
                                        In einer schleifen werden ja alle Meldungen durchlaufen.
                                        In Zeile 188 wir die einzelne Nachricht dem Array msgs hinzugefügt.
                                        Wenn die Schleife fertig ist wird das Array msgs in Zeile 190 in den datenpunkt geschrieben.

                                        Die Fehlermeldung hat ersteinmal nichts mit den neuen Zeilen zu tun. Schaue mal im JavaScript Adapter nach wo er da einen Fehler anzeigt.

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

                                          @OliverIO sagte in Parser:

                                          Schaue mal im JavaScript Adapter nach wo er da einen Fehler anzeigt.

                                          Da finde ich ja nichts 😞

                                          Auf jeden Fall tritt die Fehlermeldung nur auf, wenn das neue Skript läuft.Ddebug bringt auch nicht mehr Infos.

                                          @OliverIO sagte in Parser:

                                          Wenn die Schleife fertig ist wird das Array msgs in Zeile 190 in den datenpunkt geschrieben.

                                          Der wird leider nicht befüllt

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

                                            @Homoran
                                            Welcher datentyp hat der neue datenpunkt?
                                            Es sollte string sein. Wenn da date drin steht dann ist das der Fehler

                                            Homoran 1 Reply 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

                                            964
                                            Online

                                            31.6k
                                            Users

                                            79.4k
                                            Topics

                                            1.3m
                                            Posts

                                            parser
                                            3
                                            108
                                            5616
                                            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