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

    • Neuer Blog: Fotos und Eindrücke aus Solingen

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

    • ioBroker goes Matter ... Matter Adapter in Stable

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

    This topic has been deleted. Only users with topic management privileges can see it.
    • arteck
      arteck Developer Most Active @tofriedrich last edited by

      @tofriedrich

      da stimmt was nicht

      {
        "updating": 0,
        "message_id": 224,
        "phase": 5,
        "night_lowering": 0,
        "new_fire_wood_hours": 0,
        "new_fire_wood_minutes": 0,
        "burn_level": 2,
        "operation_mode": 2,
        "maintenance_alarms": 0,
        "safety_alarms": 0,
        "refill_alarm": 0,
        "remote_refill_alarm": 1,
        "time_since_remote_msg": 152,
        "version_major": 1,
        "version_minor": 12,
        "version_build": 0,
        "remote_version_major": 1,
        "remote_version_minor": 2,
        "remote_version_build": 0,
        "day": 11,
        "month": 9,
        "year": 2021,
        "hours": 22,
        "minutes": 21,
        "seconds": 34,
        "night_begin_hour": 22,
        "night_begin_minute": 0,
        "night_end_hour": 6,
        "night_end_minute": 0,
        "stove_temperature": 1100,
        "room_temperature": 2300,
        "oxygen_level": 0,
        "valve1_position": 0,
        "valve2_position": 2,
        "valve3_position": 2,
        "algorithm": "TEST DATA",
        "doorOpen": false
      }
      

      hier ist dein level nicht drin ... wo soll der den hingeschrieben werden.. oder setzt du den bei dir und willst den nur senden ?

      T 2 Replies Last reply Reply Quote 0
      • T
        tofriedrich @arteck last edited by tofriedrich

        @arteck ich habe den Punkt set_Level für mich angelegt um darüber den Wert an den Kamin zusenden. Der Wert ist burn_level.

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

          @arteck ich würde den Wert von Set_Level gern an http://192.168.178.24/set_level senden. Laut dem Entwickler kann man darüber den Wert burn_level ändern.

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

            @tofriedrich sagte: Wert von Set_Level gern an http://192.168.178.24/set_level senden.

            Versuche es mal so:

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

              @paul53 als JavaScript oder wie kriege ich das abgebildet? Ich habe bis jetzt nur mit Blockly gearbeitet.

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

                @tofriedrich Kurze Zwischenfrage: Die angegebene IP (192.168.178.24) ist vom Ofen?

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

                  @mcu genau, die IP ist vom Kamin

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

                    @tofriedrich Laut Programm ist die Funktion aber nicht "set_level" sondern "set_burn_level".
                    https://github.com/mvn23/hwam_stove/blob/master/pystove/pystove.py

                    Zeile 166: STOVE_BURN_LEVEL_URL = '/set_burn_level'
                    
                    T 1 Reply Last reply Reply Quote 0
                    • T
                      tofriedrich @MCU last edited by

                      @mcu Sorry, da hat sich bei mir ein Fehler eingeschlichen. Du hast recht 👍

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

                        @tofriedrich
                        Schon mal so eine Variante probiert:

                         http://192.168.178.24/set_burn_level?level=5 
                        
                        T 1 Reply Last reply Reply Quote 0
                        • T
                          tofriedrich @MCU last edited by tofriedrich

                          @mcu ja, da bekomme ich {"response":"unknown route"} angezeigt. Wie kann ich den Code von Paul in Blockly nutzen? Vielleicht klappt es.

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

                            @tofriedrich

                            http://192.168.178.24/set_burn_level?burn_level=5
                            
                            T 1 Reply Last reply Reply Quote 0
                            • T
                              tofriedrich @MCU last edited by

                              @mcu auch hier {"response":"unknown route"}

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

                                @tofriedrich Funktionen -> Javascript-Funktion etwas tun

                                Da wird es verarbeitet:

                                json_str = await self._post('http://' + self.stove_host
                                                                    + STOVE_BURN_LEVEL_URL, data)
                                

                                d3915d69-78d3-41f7-ab63-c33ace53a3c7-image.png

                                8260b754-0a69-4079-8a61-fbfd4b04dafe-image.png

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

                                  Mit dem Script passiert leider nichts

                                  8DF68CA8-5468-4277-BB04-17AA7A288E59.png

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

                                    @tofriedrich Was steht denn in der Funktion? s.o.

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

                                      @mcu ```

                                      request({
                                          method: 'POST',
                                          url: 'http://192.168.178.24/set_burn_level',
                                          body: {"level":Level}
                                      }, function(error, respnse, body) {
                                          if(error) log(error, 'warn');
                                      });
                                      
                                      M 1 Reply Last reply Reply Quote 0
                                      • M
                                        MCU @tofriedrich last edited by MCU

                                        @tofriedrich ok? und jetzt? Zeig nochmal Dein Blockly.

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

                                          @mcu 895880E5-2BD2-4DCB-ACDD-6C9CAA24F2D8.png

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

                                            Der Wert wird nicht geändert egal ob ich mit Level arbeite oder wie in meinem Screenshot. Die Instanz wird sogar deaktiviert.

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            761
                                            Online

                                            31.9k
                                            Users

                                            80.1k
                                            Topics

                                            1.3m
                                            Posts

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