Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Tester
    4. JavaScript 7.9.0 - Neue Objekt- und HTTP-Bausteine

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    JavaScript 7.9.0 - Neue Objekt- und HTTP-Bausteine

    This topic has been deleted. Only users with topic management privileges can see it.
    • haus-automatisierung
      haus-automatisierung Developer Most Active @Diginix last edited by

      @diginix Stell das Script mal auf verbose um mehr Infos im Log zu bekommen was genau gesendet wird

      Diginix 1 Reply Last reply Reply Quote 0
      • Diginix
        Diginix @haus-automatisierung last edited by

        @haus-automatisierung Wie schon vermutet ist die spitze Klammer glaube das Problem.
        In der Logausgabe ist sie encodiert:

        "auth":{"username":"user","password":"W4qkVKo%3E"}
        

        eigentlich ist es "W4qkVKo>"

        haus-automatisierung 1 Reply Last reply Reply Quote 0
        • haus-automatisierung
          haus-automatisierung Developer Most Active @Diginix last edited by

          @diginix sagte in JavaScript 7.9.0 - Neue Objekt- und HTTP-Bausteine:

          In der Logausgabe ist sie encodiert:

          Diese Baustelle macht mich noch fertig 🙂 7.9.4 ist auf dem Weg

          Ralla66 1 Reply Last reply Reply Quote 1
          • Ralla66
            Ralla66 Most Active @haus-automatisierung last edited by

            @haus-automatisierung

            senden ohne Daten so ?

            Post 1.jpg

            haus-automatisierung 1 Reply Last reply Reply Quote 0
            • haus-automatisierung
              haus-automatisierung Developer Most Active @Ralla66 last edited by

              @ralla66 Post Request ohne Daten?

              Ralla66 1 Reply Last reply Reply Quote 0
              • Ralla66
                Ralla66 Most Active @haus-automatisierung last edited by

                @haus-automatisierung

                genau, sollte per Get und Post gehen nach Web Api OpenDTU
                OpenDTU

                Post_G.jpg

                haus-automatisierung 1 Reply Last reply Reply Quote 0
                • haus-automatisierung
                  haus-automatisierung Developer Most Active @Ralla66 last edited by

                  @ralla66 Pack mal null da rein. Also keinen Leerstring.

                  Ralla66 1 Reply Last reply Reply Quote 0
                  • Ralla66
                    Ralla66 Most Active @haus-automatisierung last edited by

                    @haus-automatisierung

                    leider nein,
                    wird der Body Leer mit gesendet ?

                    haus-automatisierung 1 Reply Last reply Reply Quote 0
                    • haus-automatisierung
                      haus-automatisierung Developer Most Active @Ralla66 last edited by

                      @ralla66 sagte in JavaScript 7.9.0 - Neue Objekt- und HTTP-Bausteine:

                      leider nein,

                      Gerade getestet, funktioniert.

                      Screenshot 2024-03-20 at 20.09.21.png

                      Ralla66 1 Reply Last reply Reply Quote 0
                      • Ralla66
                        Ralla66 Most Active @haus-automatisierung last edited by Ralla66

                        @haus-automatisierung

                        Post24.jpg

                        ich schau mal morgen mit Wireshark nach

                        haus-automatisierung 1 Reply Last reply Reply Quote 0
                        • haus-automatisierung
                          haus-automatisierung Developer Most Active @Ralla66 last edited by haus-automatisierung

                          @ralla66 Du wollest einen leeren Post-Request und jetzt kommt die andere Seite damit nicht klar und möchte Werte? 🙂

                          Was rufst Du auf? Die ntp config? Die braucht doch Werte für die Konfiguration - laut Doku:

                          curl -u "admin:password" http://192.168.10.10/api/ntp/config -d 'data={"ntp_server":"my.own.ntp.server.home","ntp_timezone":"CET-1CEST,M3.5.0,M10.5.0/3","ntp_timezone_descr":"Europe/Berlin"}'
                          {"type":"success","message":"Settings saved!"}
                          

                          Ich suche mal nicht weiter, gerne erklären wo der Fehler im JavaScript liegt mit einem funktionierenden Beispiel in curl.

                          Ralla66 2 Replies Last reply Reply Quote 1
                          • Ralla66
                            Ralla66 Most Active @haus-automatisierung last edited by

                            @haus-automatisierung

                            Danke soweit,
                            hatte auch die npt time getestet.
                            Schaue mal weiter, dann kann nur die Anfrage falsch sein.

                            1 Reply Last reply Reply Quote 0
                            • Diginix
                              Diginix last edited by Diginix

                              @haus-automatisierung mit 7.9.4 funktioniert basic auth nun
                              DANKE!

                              1 Reply Last reply Reply Quote 1
                              • Diginix
                                Diginix last edited by Diginix

                                @haus-automatisierung Bie diesem Block zum Reboot eines Sonoff mit Tasmota FW kommt eine Fehlermeldung

                                1b67f1da-629a-40d3-94c5-9c881f6cc112-image.png

                                09:24:16.358	info	javascript.0 (1952275) script.js.test.Test: httpGet({"method":"get","url":"http://192.168.2.77/cm?cmnd=Restart%2099&user=admin&password=gzJIi3ab","responseType":"text","responseEncoding":"utf8","timeout":2000,"headers":{"User-Agent":"Mozilla/5.0 (X11; Linux i686; rv:109.0) Gecko/20100101 Firefox/121.0"}})
                                09:24:18.604	error	javascript.0 (1952275) script.js.test.Test: maxContentLength size of -1 exceeded
                                
                                haus-automatisierung 2 Replies Last reply Reply Quote 0
                                • haus-automatisierung
                                  haus-automatisierung Developer Most Active @Diginix last edited by

                                  @diginix sagte in JavaScript 7.9.0 - Neue Objekt- und HTTP-Bausteine:

                                  Bie diesem Block zum Reboot eines Sonoff mit Tasmota FW

                                  Welche FW Version? Dann kann ich das mal testen.

                                  PS: Warum nicht per MQTT? 🙂

                                  Diginix 1 Reply Last reply Reply Quote 0
                                  • J
                                    jwerlsdf @haus-automatisierung last edited by

                                    @haus-automatisierung
                                    Den timeout auf z.b. 4000 zu erhöhen, bringt leider auch nichts. Hast du noch eine andere Idee?

                                    haus-automatisierung 1 Reply Last reply Reply Quote 0
                                    • haus-automatisierung
                                      haus-automatisierung Developer Most Active @jwerlsdf last edited by

                                      @jwerlsdf sagte in JavaScript 7.9.0 - Neue Objekt- und HTTP-Bausteine:

                                      Hast du noch eine andere Idee?

                                      Schauen warum der Request so lange läuft und z.B. mal mit curl testen was zurück kommt (und wann).

                                      J 1 Reply Last reply Reply Quote 0
                                      • Diginix
                                        Diginix @haus-automatisierung last edited by Diginix

                                        @haus-automatisierung FW: 13.4.0(lite) und die Sonoff hängen alle am sonoff Adapter und nicht am mqtt. Hab noch nicht geschaut ob es da auch ein Topic gibt den man für den Reboot schreiben kann.

                                        Konnte auf die Schnelle kein Objekt unter sonoff.0.%device% für reboot finden.

                                        1 Reply Last reply Reply Quote 0
                                        • haus-automatisierung
                                          haus-automatisierung Developer Most Active @Diginix last edited by

                                          @diginix sagte in JavaScript 7.9.0 - Neue Objekt- und HTTP-Bausteine:

                                          Bie diesem Block zum Reboot eines Sonoff mit Tasmota FW kommt eine Fehlermeldung

                                          Sieht so aus als wäre das ein Bug in Axios, wenn die Verbindung einfach geschlossen wird (was scheinbar beim Restart passiert). Das heißt, Tasmota antwortet da nicht sauber. Siehe auch

                                          https://github.com/axios/axios/issues/5286

                                          Wenn ich das mit curl mache, dann wartet der auch ewig auf ein Ergebnis, ohne dass die Verbindung sauber geschlossen wird. Muss ich dann manuell abbrechen.

                                          Kann ich also nicht beheben - muss Tasmota tun.

                                          curl -vvv "http://10.10.9.241/cm?cmnd=Restart%2099"
                                          *   Trying 10.10.9.241:80...
                                          * Connected to 10.10.9.241 (10.10.9.241) port 80 (#0)
                                          > GET /cm?cmnd=Restart%2099 HTTP/1.1
                                          > Host: 10.10.9.241
                                          > User-Agent: curl/7.88.1
                                          > Accept: */*
                                          > 
                                          < HTTP/1.1 200 OK
                                          < Content-Type: application/json
                                          < Server: Tasmota/13.4.0 (ESP8285N08)
                                          < Cache-Control: no-cache, no-store, must-revalidate
                                          < Pragma: no-cache
                                          < Expires: -1
                                          < Accept-Ranges: none
                                          < Transfer-Encoding: chunked
                                          < Connection: close
                                          < 
                                          
                                          ^C
                                          
                                          amirAlamian created this issue in axios/axios

                                          open maxContentLength size of -1 exceeded when response status is 204 #5286

                                          haus-automatisierung 1 Reply Last reply Reply Quote 0
                                          • haus-automatisierung
                                            haus-automatisierung Developer Most Active @haus-automatisierung last edited by

                                            Wenn ich Restart 1 (1 = restart device with configuration saved to flash) nutze, klappt das übrigens und ich bekomme auch einen vernünftigen Response:

                                            {"Restart":"Restarting"

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            791
                                            Online

                                            31.7k
                                            Users

                                            79.8k
                                            Topics

                                            1.3m
                                            Posts

                                            24
                                            148
                                            16591
                                            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