Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. gelöst - Blockly JSON auslesen und Wert in DP schreiben

    NEWS

    • Amazon Alexa - ioBroker Skill läuft aus ?

    • Monatsrückblick – September 2025

    • Neues Video "KI im Smart Home" - ioBroker plus n8n

    gelöst - Blockly JSON auslesen und Wert in DP schreiben

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

      Hallo,
      ich habe ein Python-Script das auf nem Server ausgeführt wird und über nen IR-Lesekopf meine Wärmemengezähler ausliest. Es schreibt die Daten dann über Simple_API in Iobroker in einen Datenpunkt. Das Problem ist es schreibt die Daten als JSON-String und ich muss über ein Blockly Script den Wert rausfiltern den ich haben will.
      Ich hatte ein Blockly das die ganze Zeit funktioniert hat, das Problem ist aber dass sich das Python Script geändert hat und jetzt die JSON-Datei etwas anders aufgebaut ist. Deswegen funktioniert das Auslesen jetzt nicht mehr. Kann mir einer sagen was ich ändern muss? Danke schonmal.

      Hier ein Bild von meinem aktuellen Blockly, das passt aber nur auf die alte JSON und muss irgendwie geändert werden 🙂
      0224aa19-a106-4ab2-82ec-53344f341be7-grafik.png

      Hier ist die JSON-Datei Struktur, wo der rote Wert ausgelesen werden soll.

      {
        "frame_info": {
          "a": "0x0",
          "c": "0x8",
          "start": "0x68",
          "stop": "0x16",
          "crc": "0xde",
          "length": "0x42"
        },
        "header": {
          "status": "0x0",
          "medium": "0x4",
          "access_no": 135,
          "sign": "0x0, 0x0",
          "version": "0x19",
          "identification": "0x80, 0x74, 0x12, 0x52",
          "type": "0x72",
          "manufacturer": "SEN"
        },
        "records": [
          {
            "function": "FunctionType.INSTANTANEOUS_VALUE",
            "type": "VIFUnit.ENERGY_WH",
            "%(#ff0000)[**value": 159620000,**]
            "unit": "MeasureUnit.WH"
          },
          {
            "function": "FunctionType.INSTANTANEOUS_VALUE",
            "type": "VIFUnit.VOLUME",
            "value": 30628.779000000002,
            "unit": "MeasureUnit.M3"
          },
          {
            "function": "FunctionType.INSTANTANEOUS_VALUE",
            "type": "VIFUnit.VOLUME_FLOW",
            "value": 0,
            "unit": "MeasureUnit.M3_H"
          },
          {
            "function": "FunctionType.INSTANTANEOUS_VALUE",
            "type": "VIFUnit.POWER_W",
            "value": 0,
            "unit": "MeasureUnit.W"
          },
          {
            "function": "FunctionType.INSTANTANEOUS_VALUE",
            "type": "VIFUnit.FLOW_TEMPERATURE",
            "value": 23.400000000000002,
            "unit": "MeasureUnit.C"
          },
          {
            "function": "FunctionType.INSTANTANEOUS_VALUE",
            "type": "VIFUnit.RETURN_TEMPERATURE",
            "value": 23.700000000000003,
            "unit": "MeasureUnit.C"
          },
          {
            "function": "FunctionType.INSTANTANEOUS_VALUE",
            "type": "VIFUnit.TEMPERATURE_DIFFERENCE",
            "value": 0,
            "unit": "MeasureUnit.K"
          },
          {
            "function": "FunctionType.INSTANTANEOUS_VALUE",
            "type": "VIFUnit.FABRICATION_NO",
            "value": 80741252,
            "unit": "MeasureUnit.NONE"
          },
          {
            "function": "FunctionType.INSTANTANEOUS_VALUE",
            "type": "VIFUnitExt.CUSTOMER_LOCATION",
            "value": 80741252,
            "unit": "MeasureUnit.NONE"
          },
          {
            "function": "FunctionType.MORE_RECORDS_FOLLOW",
            "type": "None",
            "value": null,
            "unit": "None"
          }
        ]
      }
      
      Atifan 1 Reply Last reply Reply Quote 0
      • Atifan
        Atifan @Atifan last edited by

        Habs gerade rausgefunden, statt "body.records" einfach nur "records", dann funktioniert es 🙂

        padrino 1 Reply Last reply Reply Quote 1
        • padrino
          padrino Most Active @Atifan last edited by

          @atifan
          Gut, dass Du Deine Lösung auch noch gepostet hast!
          Jetzt evtl. noch ein [gelöst] in den Titel des ersten Posts, das wäre 😎

          Atifan 1 Reply Last reply Reply Quote 0
          • Atifan
            Atifan @padrino last edited by

            @padrino Jo habs geändert 🙂

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

            Support us

            ioBroker
            Community Adapters
            Donate

            1.2k
            Online

            32.2k
            Users

            80.9k
            Topics

            1.3m
            Posts

            2
            4
            53
            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