Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. HowTo: Zusatz-Programme fuer jarvis v3

    NEWS

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    • Minor js-controller 7.0.7 Update in latest repo

    HowTo: Zusatz-Programme fuer jarvis v3

    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      wolfi913 @MCU last edited by

      @mcu sagte in HowTo: Zusatz-Programme fuer jarvis v3:

      //  limit: dataLimitValue,
      

      Mach keinen Unterschied. Irgendwie sind in der influxDB mehr Werte drin. Mit 7000 funktionierts.
      Screenshot 2024-05-07 170256.png

      M 1 Reply Last reply Reply Quote 0
      • M
        MCU @wolfi913 last edited by MCU

        @wolfi913
        Das ist ja nicht zielführend, da, wenn du 2 Tage wählst, wieder nicht alles angezeigt wird?

        EDIT: Du kannst mal die influxDB-Instanz auf debug stellen, und dann bei jarvis ein Refresh durchführen.
        -> LOG query Aufruf zu DB wird angezeigt.

        // Es kommen Einträge mit 
        History-Queries to execute:
        

        @apollon77 limit zieht nicht für influxDB? (Bei historyDB ist alles ok)

        0_userdata.0.PV.SignedBat17150970902550.21461031104686312 getHistory message: {"id":"0_userdata.0.PV.SignedBat","options":{"start":1715010686903,"end":1715097086903,"aggregate":"onchange","limit":5000,"ignoreNull":true}}
        

        Es werden bei limit: 5000, nur 502 angzeigt. Setzt man zusätzlich count: 5000, werden auch aus influxDB 5000 geholt, aber wenn mehr vorhanden sind wird die Kurve abgebrochen.
        -> limit scheint fest im Adapter definiert zu sein bei influxDB.

        Issue aufmachen?

        // Hiernach sollte es egal sein, ob limit oder count gesetzt wird 
        
        limit:      parseInt(msg.message.options.limit, 10) || parseInt(msg.message.options.count, 10) || adapter.config.limit || 2000,
        
        // hiernach sollte er bei onchange limit nutzen, wenn count nicht gesetzt
        
        if (!options.count || isNaN(options.count)) {
                if (options.aggregate === 'none' || options.aggregate === 'onchange') {
                    options.count = options.limit;
                } else {
                    options.count = 500;
                }
            }
        
        W apollon77 2 Replies Last reply Reply Quote 0
        • W
          wolfi913 @MCU last edited by wolfi913

          @mcu sagte in HowTo: Zusatz-Programme fuer jarvis v3:

          @wolfi913
          Das ist ja nicht zielführend, da, wenn du 2 Tage wählst, wieder nicht alles angezeigt wird?

          EDIT: Du kannst mal die influxDB-Instanz auf debug stellen, und dann bei jarvis ein Refresh durchführen.
          -> LOG query Aufruf zu DB wird angezeigt.

          // Es kommen Einträge mit 
          History-Queries to execute:
          

          Ich hab's mal bei 5000 im Script eingestellt. Im Log (Debug) stehen:

          Incoming message getHistory from system.adapter.javascript.0
          0_userdata.0.PV.SignedBat17150961902120.559960672577708 getHistory message: {"id":"0_userdata.0.PV.SignedBat","options":{"start":1715009786818,"end":1715096186818,"aggregate":"onchange","limit":5000,"ignoreNull":true,"count":5000}}
          Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-05-06T15:36:26.818Z, stop: 2024-05-07T15:36:26.818Z) |> filter(fn: (r) => r["_field"] == "value") |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat" and contains(value: r._value, set: [true, false])) |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") |> group()
          Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-02-04T15:36:26.818Z, stop: 2024-05-06T15:36:26.817Z) |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat") |> last() |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
          Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-05-06T15:36:26.818Z, stop: 2024-05-07T15:36:26.818Z) |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat") |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") |> group() |> sort(columns:["_time"], desc: false) |> limit(n: 5000)
          Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-05-07T15:36:26.819Z) |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat") |> first() |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
          Send: 5002 of: 5001 in: 130ms
          
          M 1 Reply Last reply Reply Quote 0
          • M
            MCU @wolfi913 last edited by MCU

            @wolfi913 Und jetzt mal ohne count (bzw. null), da war das Problem aufgetaucht.

            W 1 Reply Last reply Reply Quote 0
            • W
              wolfi913 @MCU last edited by

              @mcu sagte in HowTo: Zusatz-Programme fuer jarvis v3:

              @wolfi913 Und jetzt mal ohne count (bzw. null), da war das Problem aufgetaucht.

              Incoming message getHistory from system.adapter.javascript.0
              0_userdata.0.PV.SignedBat17150967602230.6250690538939112 getHistory message: {"id":"0_userdata.0.PV.SignedBat","options":{"start":1715010356877,"end":1715096756877,"aggregate":"onchange","limit":5000,"ignoreNull":true,"count":null}}
              Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-05-06T15:45:56.877Z, stop: 2024-05-07T15:45:56.877Z) |> filter(fn: (r) => r["_field"] == "value") |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat" and contains(value: r._value, set: [true, false])) |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") |> group()
              Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-02-04T15:45:56.877Z, stop: 2024-05-06T15:45:56.876Z) |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat") |> last() |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
              Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-05-06T15:45:56.877Z, stop: 2024-05-07T15:45:56.877Z) |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat") |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") |> group() |> sort(columns:["_time"], desc: false) |> limit(n: 500)
              Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-05-07T15:45:56.878Z) |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat") |> first() |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
              Send: 502 of: 501 in: 70ms
              
              M 1 Reply Last reply Reply Quote 0
              • M
                MCU @wolfi913 last edited by MCU

                @wolfi913 Genau.
                762b182b-5fdc-4956-b431-bef658ddf256-image.png
                Nimm mal bitte count raus:

                // count: dataLimitValue
                
                W 1 Reply Last reply Reply Quote 0
                • W
                  wolfi913 @MCU last edited by

                  @mcu sagte in HowTo: Zusatz-Programme fuer jarvis v3:

                  @wolfi913 Genau.
                  762b182b-5fdc-4956-b431-bef658ddf256-image.png
                  Nimm mal bitte count raus:

                  // count: dataLimitValue
                  
                  Send: 502 of: 501 in: 70ms
                  0_userdata.0.PV.SignedBat17150970902550.21461031104686312 getHistory message: {"id":"0_userdata.0.PV.SignedBat","options":{"start":1715010686903,"end":1715097086903,"aggregate":"onchange","limit":5000,"ignoreNull":true}}
                  Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-05-06T15:51:26.903Z, stop: 2024-05-07T15:51:26.903Z) |> filter(fn: (r) => r["_field"] == "value") |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat" and contains(value: r._value, set: [true, false])) |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") |> group()
                  Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-02-04T15:51:26.903Z, stop: 2024-05-06T15:51:26.902Z) |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat") |> last() |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
                  Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-05-06T15:51:26.903Z, stop: 2024-05-07T15:51:26.903Z) |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat") |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") |> group() |> sort(columns:["_time"], desc: false) |> limit(n: 500)
                  Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-05-07T15:51:26.904Z) |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat") |> first() |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
                  Send: 502 of: 501 in: 64ms
                  
                  M 1 Reply Last reply Reply Quote 0
                  • M
                    MCU @wolfi913 last edited by

                    @wolfi913 Ja und das darf laut Programm (main.js iobroker.influxDB) gar nicht passieren.

                    https://github.com/ioBroker/ioBroker.influxdb/blob/a7214d819f29556d8f1b3e7cf5b4c1d506a1ff1f/main.js#L1964

                    W 1 Reply Last reply Reply Quote 0
                    • W
                      wolfi913 @MCU last edited by

                      @mcu sagte in HowTo: Zusatz-Programme fuer jarvis v3:

                      @wolfi913 Ja und das darf laut Programm (main.js iobroker.influxDB) gar nicht passieren.

                      https://github.com/ioBroker/ioBroker.influxdb/blob/a7214d819f29556d8f1b3e7cf5b4c1d506a1ff1f/main.js#L1964

                      Scheint also so, dass der Bug im influx-Adapter liegt? Ich stellt auf alle Fälle bei mir momentan mal den Chart auf history um.

                      M 1 Reply Last reply Reply Quote 0
                      • M
                        MCU @wolfi913 last edited by

                        @wolfi913 Du könntest nochmal ein Upload für die influxDB versuchen und wieder umstellen auf info, sonst haut es dir das LOG voll.

                        W 2 Replies Last reply Reply Quote 0
                        • W
                          wolfi913 @MCU last edited by

                          @mcu sagte in HowTo: Zusatz-Programme fuer jarvis v3:

                          sonst haut es dir das LOG voll.

                          Hab ich schon umgestellt

                          1 Reply Last reply Reply Quote 0
                          • W
                            wolfi913 @MCU last edited by wolfi913

                            @mcu
                            Mir ist gerade zwischendrin im Log noch was aufgefallen. Hatte ich vorher nie gesehen. Denke ein warn wär mir normalerweise aufgefallen

                            warn	script.js.jarvis.eChartsHistoryGetData: Timeout -> DP 0_userdata.0.PV.SignedBat nicht vorhanden in DB: influxdb.1
                            

                            Ziemlich sonderbar. Es werden ja scheinbar trotzdem Daten geliefert und der DP ist definitiv in der InfluxDB da.

                            Ergänzung:
                            Hab jetzt kurz nochmal auf influx zurückgestellt. Die warn ist nicht nochmal aufgetaucht. Trotz mehrmaligem F5.
                            Möglicherweise tatsächlich nur einmalig vorgekommen.

                            M 1 Reply Last reply Reply Quote 0
                            • M
                              MCU @wolfi913 last edited by MCU

                              @wolfi913 Taucht auch nur als "Hinweis" auf, wenn history-Abfrage einen timeout produziert. Kann auch evtl mit der Anzahl der Werte zusammenhängen?

                              Hattest du mal ein Upload gemacht um danach nochmal die nur limit für influx zu testen?

                              iob upload influxdb
                              
                              W 1 Reply Last reply Reply Quote 0
                              • W
                                wolfi913 @MCU last edited by wolfi913

                                @mcu
                                ok 👍

                                Hattest du mal ein Upload gemacht um danach nochmal die nur limit für influx zu testen?

                                Mach ich gleich noch, bin nur zwischendrin aufgehalten worden
                                Upload gemacht und nochmal mit Limit: 5000 ohne Count getestet. Weiterhin nur 502 Werte

                                M 1 Reply Last reply Reply Quote 0
                                • M
                                  MCU @wolfi913 last edited by MCU

                                  @wolfi913 Problem erkannt. Der Adapter setzt schon selbst count auf 500
                                  https://github.com/ioBroker/ioBroker.influxdb/blob/a7214d819f29556d8f1b3e7cf5b4c1d506a1ff1f/main.js#L1978
                                  und fragt noch ab, ob options.count gesetzt wurde.
                                  https://github.com/ioBroker/ioBroker.influxdb/blob/a7214d819f29556d8f1b3e7cf5b4c1d506a1ff1f/main.js#L1995
                                  Ist es damit aber schon und somit geht er gar nicht in die entscheidende Abfrage.

                                  Issue aufgemacht:
                                  https://github.com/ioBroker/ioBroker.influxdb/issues/391

                                  mcuiobroker created this issue in ioBroker/ioBroker.influxdb

                                  open Problem with limit setting -> it is not set #391

                                  W 1 Reply Last reply Reply Quote 1
                                  • W
                                    wolfi913 @MCU last edited by

                                    @mcu
                                    Dann schauen wir mal ob sich da im Adapter was ändert. Ich bleib ich momentan mal für den Chart auf der historyDB. Wenn sich im influx-Adapter was Neues tut kann ich ja nochmal durchprobieren.

                                    1 Reply Last reply Reply Quote 1
                                    • apollon77
                                      apollon77 @MCU last edited by

                                      @mcu Da gibts brlaube ein known issue in influxdb adapter ... kam ich bisher noch nicht dazu final zu fixen ... Bitte mal schauen obs da sgleiche oder was anderes ist

                                      1 Reply Last reply Reply Quote 0
                                      • M
                                        MCU last edited by

                                        @apollon77 Ich hatte den Issue dort eingetragen nachdem ich den Fehler feststellen konnte.
                                        https://github.com/ioBroker/ioBroker.influxdb/issues/391

                                        mcuiobroker created this issue in ioBroker/ioBroker.influxdb

                                        open Problem with limit setting -> it is not set #391

                                        apollon77 1 Reply Last reply Reply Quote 1
                                        • apollon77
                                          apollon77 @MCU last edited by

                                          @mcu Cool, auch danke für die Infos und Links. Willst du mal Fix versuchen und PR machen wenn Du die stelle und Vergleich zu History schon hast? Oder soll ich schauen das ich die tage zeit finde?

                                          M 1 Reply Last reply Reply Quote 1
                                          • M
                                            MCU @apollon77 last edited by MCU

                                            @apollon77 Gibt es igrendwo eine Anleitung dazu, wie man ein PR erstellt?
                                            Gefunden:
                                            https://www.youtube.com/watch?v=l8MZCnrSeQQ

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            700
                                            Online

                                            31.6k
                                            Users

                                            79.5k
                                            Topics

                                            1.3m
                                            Posts

                                            javascript
                                            30
                                            858
                                            150417
                                            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