Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. [gelöst] Wert (JSON) an URL senden

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    [gelöst] Wert (JSON) an URL senden

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

      @tofriedrich Dann müssen wir mal drüber nachdenken, ich weiß nicht mehr was ich noch ändern kann. Morgen (Später heute) können wir weiter machen.

      T 1 Reply Last reply Reply Quote 0
      • T
        tofriedrich @MCU last edited by

        @mcu irgendeine Möglichkeit gibt es bestimmt. Vielleicht kann der Entwickler von der Home Assistant Geschichte noch einen Tipp geben?

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

          @tofriedrich
          Sonst versuch mal das Script von paul und nimm ein javascript
          9b7556f2-3aa1-43e1-950c-e9d435cfcaad-image.png
          Kopier es rein und lass es laufen.
          Dies reagiert dann wieder auf Änderung von Set_Level.

          T 1 Reply Last reply Reply Quote 0
          • T
            tofriedrich @MCU last edited by

            @mcu das setzt der burn_level wert auch auf 0

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

              @tofriedrich

              on('0_userdata.0.Kamin.Set_Level', function(dp) {
                  request({
                      method: 'POST',
                      url: 'http://192.168.178.24/set_burn_level',
                      body: {"level":dp.state.val}
                  }, function(error, respnse, body) {
                      if(error) log(error, 'warn');
                  });
              });
              
              
              M paul53 2 Replies Last reply Reply Quote 0
              • M
                MCU @MCU last edited by

                @tofriedrich Wie bekommst du das JSON?
                Auch per http-Abfrage?

                M T 2 Replies Last reply Reply Quote 0
                • M
                  MCU @MCU last edited by MCU

                  @mcu Kann es sein das die Nachtabsenkung den Wert immer wieder auf 0 stellt:
                  Nachtabsenkung stellt das System automatisch auf „Level 0“
                  https://www.hwam.de/pub/media/hwam/manuals/smartcontrol/53-1102_App_IHS_gen2_DE.pdf

                  T 1 Reply Last reply Reply Quote 0
                  • T
                    tofriedrich @MCU last edited by

                    @mcu die Nachtabsenkung ist bei mir deaktiviert und wird nur selten genutzt. Normalerweise bleibt der Kamin immer auf dem zuletzt genutzten Level stehen.

                    1 Reply Last reply Reply Quote 0
                    • T
                      tofriedrich @MCU last edited by tofriedrich

                      @mcu so hole ich mir die Daten und schreibe sie in die Datenpunkte:

                      1D9B527E-359B-4CEA-8E82-8B86B83B6EC4.png

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

                        My German isn't great, so I'll type in English instead.
                        I'm the developer of the Home Assistant hwam_stove integration (https://github.com/mvn23/hwam_stove) and the pystove library it depends on (https://github.com/mvn23/pystove). All information required for the development of these projects was obtained by sniffing the HTTP traffic to and from the stove (it's completely unencrypted) and by disassembling the official Android app.

                        First of all, while going through this thread, I saw a few attempts with "{'level':5}" as payload. Please note that JSON is very picky with the type of quotes being used. All strings - and thus dictionary keys - must be enclosed in double quotes, i.e. '{"level":5}'.

                        To mimic the Android app and my pystove library, the following header should be included in your request: "Accept: application/json". This is present in all requests sent by pystove. If I remember correctly (it's been a while since I coded that) it was required to make the stove respond correctly. I can't think of another reason why I would have included it in pystove at the time 😉

                        1 Reply Last reply Reply Quote 2
                        • paul53
                          paul53 @MCU last edited by paul53

                          @mcu
                          Oder so?

                          on('0_userdata.0.Kamin.Set_Level', function(dp) {
                              request({
                                  method: 'POST',
                                  url: 'http://192.168.178.24/set_burn_level',
                                  json: true,
                                  body: {level: dp.state.val}
                              }, function(error, response, body) {
                                  if(error) log(error, 'warn');
                              });
                          });
                          

                          Laut Doku:

                          body - entity body for PATCH, POST and PUT requests. Must be a Buffer, String or ReadStream. If json is true, then body must be a JSON-serializable object.
                          json - sets body to JSON representation of value and adds Content-type: application/json header. Additionally, parses the response body as JSON.

                          T 1 Reply Last reply Reply Quote 2
                          • T
                            tofriedrich @paul53 last edited by

                            @paul53 kaum zu glauben… es funktioniert! Vielen vielen Dank euch allen für die Hilfe 🙏

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

                              @tofriedrich sagte: es funktioniert!

                              Dann markiere bitte das Thema in der Überschrift des ersten Beitrags als [Gelöst].

                              @tofriedrich sagte in Wert (JSON) an URL senden:

                              so hole ich mir die Daten und schreibe sie in die Datenpunkte:

                              Die Wandlungen "nach Zahl" und "nach Logikwert" bei "doorOpen" kann man weglassen.

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

                                @paul53 anderes Gerät, aber auch JSON an URL senden.

                                c4419a2c-f3bf-4d87-ae92-d6ea05ddda91-image.png
                                Der Befehl ist wie folgt :

                                curl -i -d '{"method": "getSystemInformation","id": 65,"params": [],"version": "1.4"}' http://192.168.1.254:10000/sony/system
                                

                                Eine Antwort erhalte ich, somit funktioniert die Kommunikation.

                                Nun versuche ich aber, einen anderen Befehl zu senden, welche ich auf folgender Seite finde:
                                API reference

                                Als Beispiel folgender JSON:

                                {
                                 "method":"notifyPowerStatus",
                                 "params":[
                                  {
                                   "status":"standby"
                                  }
                                 ],
                                 "version":"1.0"
                                }
                                

                                Nun habe ich folgenden exec-Befehl probiert:

                                curl -i -d '{"method": "notifyPowerStatus","params":[{"status":"standby"}],"version": "1.0" }' http://192.168.1.254:10000/sony/system
                                

                                Folgender Fehler erscheint jetzt:

                                HTTP/1.1 200 OK Connection: close Content-Length: 28 Content-Type: application/json {"error":[5,"Illegal JSON"]}
                                

                                Kann mir jemand weiterhelfen?

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

                                Support us

                                ioBroker
                                Community Adapters
                                Donate

                                911
                                Online

                                31.7k
                                Users

                                79.7k
                                Topics

                                1.3m
                                Posts

                                6
                                82
                                4185
                                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