Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Daten aus URL in blocky

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Daten aus URL in blocky

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

      @ingranu sagte: Cannot read property 'slice' of undefined

      Kann es sein, dass in result nicht immer etwas geliefert wird? Dann frage result ab:

      Bild_2022-11-02_133846810.png

      oder prüfe den Anfang:

      Bild_2022-11-02_134259264.png

      ingranu 1 Reply Last reply Reply Quote 0
      • ingranu
        ingranu @paul53 last edited by

        @paul53 einfach nix..

        Ausgabe kommt bei Abruf der URL aber immer
        1Screenshot 2022-11-02 135601.jpg

        13:56:24.492	info	javascript.0 (4987) Stop script script.js.common.Mediola_states2
        13:56:24.502	info	javascript.0 (4987) Start javascript script.js.common.Mediola_states2
        13:56:24.509	info	javascript.0 (4987) script.js.common.Mediola_states2: registered 0 subscriptions, 1 schedule, 0 messages, 0 logs and 0 file subscriptions
        
        paul53 2 Replies Last reply Reply Quote 0
        • paul53
          paul53 @ingranu last edited by paul53

          @ingranu sagte: einfach nix..

          Bau Debug-Ausgaben ein, um zu sehen, was passiert.
          Weise bei "aktualisiere" noch einen Datenpunkt zu.

          Bild_2022-11-02_142631600.png

          EDIT: Der Schleifenabbruch erfolgt an der falschen Stelle: Die Schleife wird sofort abgebrochen und nicht erst bei erfüllter Bedingung.

          ingranu 2 Replies Last reply Reply Quote 0
          • paul53
            paul53 @ingranu last edited by paul53

            @ingranu sagte: Ausgabe kommt bei Abruf der URL aber immer

            Wenn ich es mit dem oben angegeben String in result teste, erhalte ich das erwartete Ergebnis:

            Bild_2022-11-02_143233547.png

            Schleifenabbruch korrigieren!!

            1 Reply Last reply Reply Quote 0
            • ingranu
              ingranu @paul53 last edited by

              @paul53 Da tuuuut sich jetzt was 🙂

              javascript.0 (4987) script.js.common.Mediola_states3: [{"type":"FS20","adr":"443525","state":"00:A6"},{"type":"FS20","adr":"2b063b","state":"FF:FF"},{"type":"EVENT","adr":"02","state":"1"},{"type":"FS20","adr":"8d3700","state":"FF:FF"},{"type":"FS20","adr":"aaf900","state":"FF:FF"},{"type":"FS20","adr":"20d600","state":"FF:FF"},{"type":"EVENT","adr":"03","state":"1"},{"type":"FS20","adr":"903702","state":"FF:FF"},{"type":"FS20","adr":"1c291e","state":"FF:FF"},{"type":"FS20","adr":"8d3702","state":"FF:FF"},{"type":"FS20","adr":"0b3212","state":"FF:FF"},{"type":"FS20","adr":"ffffa9","state":"FF:FF"},{"type":"FS20","adr":"015301","state":"FF:FF"},{"type":"FS20","adr":"231a42","state":"FF:FF"},{"type":"ELRO","adr":"123409","state":"FF:FF"},{"type":"FS20","adr":"ffff01","state":"FF:FF"},{"type":"IT","adr":"aa3c0080","state":"FF:FF"},{"type":"FS20","adr":"271b20","state":"FF:FF"},{"type":"FS20","adr":"800001","state":"FF:FF"},{"type":"ELRO","adr":"000550","state":"00:12"},{"type":"IT","adr":"518b1180","state":"06:12"},{"type":"IT","adr":"010","state":"FF:FF"},{"type":"ELRO","adr":"100550","state":"00:FF"},{"type":"IT","adr":"1db90080","state":"FF:FF"},{"type":"IT","adr":"b3930080","state":"FF:FF"},{"type":"IT","adr":"2e340080","state":"06:A6"},{"type":"IT","adr":"a5430080","state":"FF:FF"},{"type":"IT","adr":"7f450080","state":"FF:FF"},{"type":"IT","adr":"44240080","state":"06:12"},{"type":"FS20","adr":"1a0132","state":"FF:FF"},{"type":"IT","adr":"25ca0080","state":"06:FF"},{"type":"EVENT","adr":"01","state":"0"},{"type":"IT","adr":"60b5a280","state":"FF:FF"},{"type":"IT","adr":"518b1181","state":"06:7A"},{"type":"IT","adr":"6616a881","state":"FF:FF"},{"type":"IT","adr":"60b5a282","state":"06:54"},{"type":"IT","adr":"00","state":"FF:FF"},{"type":"IT","adr":"44205800","state":"FF:FF"},{"type":"IT","adr":"a1234561","state":"FF:FF"},{"type":"IT","adr":"af760080","state":"06:12"},{"type":"IT","adr":"13b80080","state":"FF:FF"},{"type":"IT","adr":"6616a880","state":"06:A6"}]
              
              paul53 1 Reply Last reply Reply Quote 0
              • ingranu
                ingranu @paul53 last edited by

                @paul53 said in Daten aus URL in blocky:

                @ingranu sagte: einfach nix..

                Bau Debug-Ausgaben ein, um zu sehen, was passiert.
                Weise bei "aktualisiere" noch einen Datenpunkt zu.

                Bild_2022-11-02_142631600.png

                EDIT: Der Schleifenabbruch erfolgt an der falschen Stelle: Die Schleife wird sofort abgebrochen und nicht erst bei erfüllter Bedingung.

                javascript.0 (4987) script.js.common.Mediola_states3: [{"type":"FS20","adr":"443525","state":"00:A6"},{"type":"FS20","adr":"2b063b","state":"FF:FF"},{"type":"EVENT","adr":"02","state":"1"},{"type":"FS20","adr":"8d3700","state":"FF:FF"},{"type":"FS20","adr":"aaf900","state":"FF:FF"},{"type":"FS20","adr":"20d600","state":"FF:FF"},{"type":"EVENT","adr":"03","state":"1"},{"type":"FS20","adr":"903702","state":"FF:FF"},{"type":"FS20","adr":"1c291e","state":"FF:FF"},{"type":"FS20","adr":"8d3702","state":"FF:FF"},{"type":"FS20","adr":"0b3212","state":"FF:FF"},{"type":"FS20","adr":"ffffa9","state":"FF:FF"},{"type":"FS20","adr":"015301","state":"FF:FF"},{"type":"FS20","adr":"231a42","state":"FF:FF"},{"type":"ELRO","adr":"123409","state":"FF:FF"},{"type":"FS20","adr":"ffff01","state":"FF:FF"},{"type":"IT","adr":"aa3c0080","state":"FF:FF"},{"type":"FS20","adr":"271b20","state":"FF:FF"},{"type":"FS20","adr":"800001","state":"FF:FF"},{"type":"ELRO","adr":"000550","state":"00:12"},{"type":"IT","adr":"518b1180","state":"06:12"},{"type":"IT","adr":"010","state":"FF:FF"},{"type":"ELRO","adr":"100550","state":"00:FF"},{"type":"IT","adr":"1db90080","state":"FF:FF"},{"type":"IT","adr":"b3930080","state":"FF:FF"},{"type":"IT","adr":"2e340080","state":"06:A6"},{"type":"IT","adr":"a5430080","state":"FF:FF"},{"type":"IT","adr":"7f450080","state":"FF:FF"},{"type":"IT","adr":"44240080","state":"06:12"},{"type":"FS20","adr":"1a0132","state":"FF:FF"},{"type":"IT","adr":"25ca0080","state":"06:FF"},{"type":"EVENT","adr":"01","state":"0"},{"type":"IT","adr":"60b5a280","state":"FF:FF"},{"type":"IT","adr":"518b1181","state":"06:7A"},{"type":"IT","adr":"6616a881","state":"FF:FF"},{"type":"IT","adr":"60b5a282","state":"06:54"},{"type":"IT","adr":"00","state":"FF:FF"},{"type":"IT","adr":"44205800","state":"FF:FF"},{"type":"IT","adr":"a1234561","state":"FF:FF"},{"type":"IT","adr":"af760080","state":"06:12"},{"type":"IT","adr":"13b80080","state":"FF:FF"},{"type":"IT","adr":"6616a880","state":"06:A6"}]
                
                1 Reply Last reply Reply Quote 0
                • paul53
                  paul53 @ingranu last edited by paul53

                  @ingranu sagte: Da tuuuut sich jetzt was

                  Den Schleifenabbruch hast du korrigiert?

                  Bild_2022-11-02_145750263.png

                  ingranu 1 Reply Last reply Reply Quote 0
                  • ingranu
                    ingranu @paul53 last edited by

                    @paul53

                    Ja die Schleife habe ich korrigiert, die Ausgabe erfolgt jetzt wie folgt, also alle Geräte:

                    javascript.0 (4987) script.js.common.Mediola_states4: [{"type":"FS20","adr":"443525","state":"00:A7"},{"type":"FS20","adr":"2b063b","state":"FF:FF"},{"type":"EVENT","adr":"02","state":"1"},{"type":"FS20","adr":"8d3700","state":"FF:FF"},{"type":"FS20","adr":"aaf900","state":"FF:FF"},{"type":"FS20","adr":"20d600","state":"FF:FF"},{"type":"EVENT","adr":"03","state":"1"},{"type":"FS20","adr":"903702","state":"FF:FF"},{"type":"FS20","adr":"1c291e","state":"FF:FF"},{"type":"FS20","adr":"8d3702","state":"FF:FF"},{"type":"FS20","adr":"0b3212","state":"FF:FF"},{"type":"FS20","adr":"ffffa9","state":"FF:FF"},{"type":"FS20","adr":"015301","state":"FF:FF"},{"type":"FS20","adr":"231a42","state":"FF:FF"},{"type":"ELRO","adr":"123409","state":"FF:FF"},{"type":"FS20","adr":"ffff01","state":"FF:FF"},{"type":"IT","adr":"aa3c0080","state":"FF:FF"},{"type":"FS20","adr":"271b20","state":"FF:FF"},{"type":"FS20","adr":"800001","state":"FF:FF"},{"type":"ELRO","adr":"000550","state":"00:13"},{"type":"IT","adr":"518b1180","state":"06:13"},{"type":"IT","adr":"010","state":"FF:FF"},{"type":"ELRO","adr":"100550","state":"00:FF"},{"type":"IT","adr":"1db90080","state":"FF:FF"},{"type":"IT","adr":"b3930080","state":"FF:FF"},{"type":"IT","adr":"2e340080","state":"06:A7"},{"type":"IT","adr":"a5430080","state":"FF:FF"},{"type":"IT","adr":"7f450080","state":"FF:FF"},{"type":"IT","adr":"44240080","state":"06:13"},{"type":"FS20","adr":"1a0132","state":"FF:FF"},{"type":"IT","adr":"25ca0080","state":"06:FF"},{"type":"EVENT","adr":"01","state":"0"},{"type":"IT","adr":"60b5a280","state":"FF:FF"},{"type":"IT","adr":"518b1181","state":"06:7B"},{"type":"IT","adr":"6616a881","state":"FF:FF"},{"type":"IT","adr":"60b5a282","state":"06:55"},{"type":"IT","adr":"00","state":"FF:FF"},{"type":"IT","adr":"44205800","state":"FF:FF"},{"type":"IT","adr":"a1234561","state":"FF:FF"},{"type":"IT","adr":"af760080","state":"06:13"},{"type":"IT","adr":"13b80080","state":"FF:FF"},{"type":"IT","adr":"6616a880","state":"06:A7"}]
                    

                    Aber wie kann ich jetzt da ne Automation mache, respektive kann ich den Wert welche in benötige irgendwo als Variable eintragen lassen?

                    paul53 2 Replies Last reply Reply Quote 0
                    • paul53
                      paul53 @ingranu last edited by paul53

                      @ingranu
                      Da muss noch eine Log-Ausgabe hinterher kommen:

                      06:13
                      

                      Deaktiviere mal den "Debug output json", denn offenbar kommt das JSON rein.

                      @ingranu sagte in Daten aus URL in blocky:

                      kann ich den Wert welche in benötige irgendwo als Variable eintragen lassen?

                      Der Block "aktualisiere" schreibt den Wert in einen unter "0_userdata.0" selbst erstellten Datenpunkt vom Typ "string".

                      ingranu 1 Reply Last reply Reply Quote 0
                      • ingranu
                        ingranu @paul53 last edited by

                        @paul53 Welchen Debug meinst du? Diesen hier?
                        3Screenshot 2022-11-02 150958.jpg

                        paul53 1 Reply Last reply Reply Quote 0
                        • paul53
                          paul53 @ingranu last edited by

                          @ingranu sagte: Welchen Debug meinst du? Diesen hier?

                          Ja, und den ganz oben (debug output result). Dann bleibt nur noch der Debug-Block für das ausgefilterte "state".

                          ingranu 1 Reply Last reply Reply Quote 0
                          • ingranu
                            ingranu @paul53 last edited by

                            @paul53 Sieht nur wie folgt aus:

                            unten keine Info Ausgabe mehr

                            4Screenshot 2022-11-02 151514.jpg

                            5Screenshot 2022-11-02 151635.jpg

                            paul53 1 Reply Last reply Reply Quote 0
                            • paul53
                              paul53 @ingranu last edited by

                              @ingranu sagte: unten keine Info Ausgabe mehr

                              Wo befindet sich jetzt der Block "die Schleife abbrechen"?

                              ingranu 1 Reply Last reply Reply Quote 0
                              • ingranu
                                ingranu @paul53 last edited by

                                @paul53 6Screenshot 2022-11-02 152815.jpg

                                paul53 1 Reply Last reply Reply Quote 0
                                • paul53
                                  paul53 @ingranu last edited by paul53

                                  @ingranu sagte: die Ausgabe erfolgt jetzt wie folgt, also alle Geräte:

                                  Ist das die gesamte Log-Ausgabe (Variable result)?
                                  Wenn ja, fehlt dort der Anfang "{XC_SUC}".

                                  Dann frage mal zusätzlich ab:

                                  Bild_2022-11-02_153425154.png

                                  ingranu 1 Reply Last reply Reply Quote 0
                                  • paul53
                                    paul53 @ingranu last edited by

                                    @ingranu
                                    Bei "aktualisiere" ist der Datenpunkt noch nicht zugewiesen.

                                    1 Reply Last reply Reply Quote 0
                                    • ingranu
                                      ingranu @paul53 last edited by

                                      @paul53 Wo fehlt das {XC_SUC} ?

                                      7Screenshot 2022-11-02 153434.jpg

                                      Homoran paul53 2 Replies Last reply Reply Quote 0
                                      • Homoran
                                        Homoran Global Moderator Administrators @ingranu last edited by

                                        @ingranu sagte in Daten aus URL in blocky:

                                        Wo fehlt das {XC_SUC} ?

                                        im result! Deswegen wollte ich das result schon ganz am Anfang sehen

                                        1 Reply Last reply Reply Quote 0
                                        • paul53
                                          paul53 @ingranu last edited by

                                          @ingranu sagte: Wo fehlt das {XC_SUC} ?

                                          In der Log-Ausgabe von result.

                                          ingranu 1 Reply Last reply Reply Quote 0
                                          • ingranu
                                            ingranu @paul53 last edited by

                                            @paul53 so ?

                                            8Screenshot 2022-11-02 153812.jpg

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            859
                                            Online

                                            32.0k
                                            Users

                                            80.5k
                                            Topics

                                            1.3m
                                            Posts

                                            3
                                            45
                                            5573
                                            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