Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. [gelöst] JSON Attribute ermitteln

    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] JSON Attribute ermitteln

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

      Hallo zusammen,
      ich möchte ein JSON-String auslesen und die Attribute (ist das richtig?) auslesen, bekomme aber nur die Daten!?

      f15f614c-4b8b-4e9a-832a-2c153671ea1e-image.png

      iobroker-javascript-json-Attribute-ermitteln.PNG

      Es werden mir aber nur die Daten angezeigt.
      Ziel ist es aus dem JSON-String:

      {"ID":"XXXXXXX","PUSHOVER_ID":"TAB2","CHANGE_REASON":"","APPS":{"appback":true,"apphome":false}}

      die einzelnen Attribute auszulesen -> ID,PushOver_ID usw.

      Weiß jemand was ich falsch mache? Oder gibt es einen besseren Weg?

      Vielen Dank

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

        @MCU
        Du möchtest sicherlich so etwas ähnliches wie hier ? Das ist mit Blockly schlecht (oder nicht) machbar. Aber mit einer Javascript-Funktion iter(id, obj) in Blockly mit folgendem Inhalt:

        for(let i in obj) {
            if(typeof obj[i] == 'object') iter(id + '.' + i, obj[i]);
            else {
                log(id + '.' + i + ': ' + obj[i]);
            }
        }
        

        Blockly_temp.JPG

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

          @paul53
          Hab es hinbekommen! Danke für die Hilfe.

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

          Support us

          ioBroker
          Community Adapters
          Donate

          826
          Online

          31.8k
          Users

          80.0k
          Topics

          1.3m
          Posts

          javascript
          2
          3
          535
          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