Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. JSON aus Victron VRM-API auslesen

    NEWS

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

    • Neues Video über Aliase, virtuelle Geräte und Kategorien

    • Wir empfehlen: Node.js 22.x

    JSON aus Victron VRM-API auslesen

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

      Ich bekomme aus der Victron VRM-API Inhalte per MQTT übermittelt. Nun möchte ich diese Inhalte gerne so auf eigene Datenpunkte schreiben, dass ich damit weiterarbeiten kann.
      Leider fehlt mir momentan der Ansatz, um den Wert ganz unten in einen eigenen Datenpunkt zu schreiben:

       "totals": {
          "solar_yield_forecast": 27034.51933080215
      },
      

      Im Folgenden ein Beispiel für den gesamten übermittelten Inhalt:

      {
        "success": true,
        "records": {
          "solar_yield_forecast": [
            [
              1758060000000,
              0
            ],
            [
              1758063600000,
              0
            ],
            [
              1758067200000,
              0
            ],
            [
              1758070800000,
              0
            ],
            [
              1758074400000,
              0
            ],
            [
              1758078000000,
              0
            ],
            [
              1758081600000,
              0
            ],
            [
              1758085200000,
              0
            ],
            [
              1758088800000,
              774.342774495485
            ],
            [
              1758092400000,
              1746.011426292364
            ],
            [
              1758096000000,
              2191.4526636302526
            ],
            [
              1758099600000,
              2808.0283493697716
            ],
            [
              1758103200000,
              4069.159240201126
            ],
            [
              1758106800000,
              3839.711232221407
            ],
            [
              1758110400000,
              2914.2978214621617
            ],
            [
              1758114000000,
              3574.4003099799247
            ],
            [
              1758117600000,
              2777.8536331057617
            ],
            [
              1758121200000,
              1735.830304756765
            ],
            [
              1758124800000,
              603.4315752871349
            ],
            [
              1758128400000,
              0
            ],
            [
              1758132000000,
              0
            ],
            [
              1758135600000,
              0
            ],
            [
              1758139200000,
              0
            ],
            [
              1758142800000,
              0
            ]
          ]
        },
        "totals": {
          "solar_yield_forecast": 27034.51933080215
        },
        "options": {}
      }
      
      icebear 1 Reply Last reply Reply Quote 0
      • icebear
        icebear @YellowFlash last edited by

        @yellowflash

        Ich probiers mal.

        Erstelle dir ein Blockly so wie auf dem Bild

        json.png

        bei Objekt ID Json Stats = der DP wo deine JSON liegt

        JSONata Ausdruck = $."totals"."solar_yield_forecast"

        aktualisiere 'DP wo du es hin schreiben willst'

        1 Reply Last reply Reply Quote 0
        • Y
          YellowFlash last edited by

          Vielen Dank. Da ich nicht auf eine Änderung des Objektes warten woltle, habe ich einen zeitlichen Trigger eingebaut.
          49b9c562-3f3e-458c-8542-00816343c226-grafik.png
          Dabei erscheint die Fehlermeldung

          TypeError: liste.slice is not a function
          
          paul53 2 Replies Last reply Reply Quote 0
          • paul53
            paul53 @YellowFlash last edited by

            @yellowflash sagte: zeitlichen Trigger eingebaut.

            Du möchtest nur den Gesamtwert in einem Datenpunkt?

            Blockly_temp.JPG

            1 Reply Last reply Reply Quote 0
            • Y
              YellowFlash last edited by

              Vielen Dank, das hat gut funktioneirt.

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

                @yellowflash sagte: Da ich nicht auf eine Änderung des Objektes warten woltle

                Endgültig besser so:

                Blockly_temp.JPG

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

                Support us

                ioBroker
                Community Adapters
                Donate

                979
                Online

                32.1k
                Users

                80.7k
                Topics

                1.3m
                Posts

                3
                6
                54
                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