Skip to content
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Logo
  1. ioBroker Community Home
  2. Deutsch
  3. ioBroker Allgemein
  4. JSON parsen

NEWS

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.1k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    1.8k

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    15
    1
    2.1k

JSON parsen

Scheduled Pinned Locked Moved ioBroker Allgemein
4 Posts 3 Posters 194 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Away
    L Away
    legro
    wrote on last edited by legro
    #1

    Für den FlexCharts-Adapter von @jrbwh möchte ich ein als JSON gespeichertes Chart mittels JSON.parse im RAM als Objekt anlagen. Leider gelingt es mir nicht (mehr). Der Inhalt des Datenpunktes mit dem Chart lautet ..

    title: {
      text: 'Tageswerte',
      top: '5%',
      left: '5%',
      textStyle: {
        fontSize: 20,
        fontWeight: 'bold',
        color: '#ffffff'
      },
    },
    legend: {
      data: [
          {
            name: 'Gas',
            itemStyle: {color: '#00ff00'}
          },
          {
            name: 'gH',
            itemStyle: {color: '#ff0000'}
          },
          {
            name: 'gW',
                    itemStyle: {color: '#0000ff'}
          },
          {
            name: 'pH',
            itemStyle: {color: '#ff7f7f'}
          },
          {
            name: 'pW',
            itemStyle: {color: '#7f7fff'}
          }
      ],
      orient: 'vertical',
      right: '10%'
    },
    tooltip: {},
    xAxis: {
      data: ['Gas','gH','gW','pH','pW']
    },
    yAxis: {
      axisLabel: {
        formatter: '{value} KWh',
        align: 'center'
      }
    },
    grid: {
      left: '5%',
      right: '5%',
      top: '15%',
      bottom: '5%'
    },
    series: [
      {
        name: 'Gas',
        type: 'bar',
        stack: 'one',
        data: [{value: 0.81, itemStyle: {color: '#00ff00'}},0,0,0,0]
      },
      {
        name: 'gH',
        type: 'bar',
        stack: 'one',
        data: [0,{value: 66.6, itemStyle: {color: '#ff7f7f'}},0,0,0]
      },
      {
        name: 'gW',
        type: 'bar',
        stack: 'one',
        data: [0,0,{value: 3.9, itemStyle: {color: '#7f7fff'}},0,0]
      },
      {
        name: 'pH',
        type: 'bar',
        stack: 'one',
        data: [0,0,0,{value: 14.9, itemStyle: {color: '#ff0000'}},0]
      },
      {
        name: 'pW',
        type: 'bar',
        stack: 'one',
        data: [0,0,0,0,{value: 1.4, itemStyle: {color: '#0000ff'}}]
      }
    ]
    

    cd93150b-98c5-41b7-9174-8210e32f105c-image.png

    Was mache ich bloß falsch? Muss ich am Ende alle Bezeichner in Anführungszeichen setzen?

    Nach über vier Jahren Leidenszeit unter Qivicon/MSH vor den Telekomikern zu ioBroker geflüchtet.
    Raspberry Pi 4 mit 8GB + ArgonOneM.2 + 120GB SSD + Coordinator CC26X2R1 + ioBroker + piVCCU3

    mickymM T 2 Replies Last reply
    0
    • L legro

      Für den FlexCharts-Adapter von @jrbwh möchte ich ein als JSON gespeichertes Chart mittels JSON.parse im RAM als Objekt anlagen. Leider gelingt es mir nicht (mehr). Der Inhalt des Datenpunktes mit dem Chart lautet ..

      title: {
        text: 'Tageswerte',
        top: '5%',
        left: '5%',
        textStyle: {
          fontSize: 20,
          fontWeight: 'bold',
          color: '#ffffff'
        },
      },
      legend: {
        data: [
            {
              name: 'Gas',
              itemStyle: {color: '#00ff00'}
            },
            {
              name: 'gH',
              itemStyle: {color: '#ff0000'}
            },
            {
              name: 'gW',
                      itemStyle: {color: '#0000ff'}
            },
            {
              name: 'pH',
              itemStyle: {color: '#ff7f7f'}
            },
            {
              name: 'pW',
              itemStyle: {color: '#7f7fff'}
            }
        ],
        orient: 'vertical',
        right: '10%'
      },
      tooltip: {},
      xAxis: {
        data: ['Gas','gH','gW','pH','pW']
      },
      yAxis: {
        axisLabel: {
          formatter: '{value} KWh',
          align: 'center'
        }
      },
      grid: {
        left: '5%',
        right: '5%',
        top: '15%',
        bottom: '5%'
      },
      series: [
        {
          name: 'Gas',
          type: 'bar',
          stack: 'one',
          data: [{value: 0.81, itemStyle: {color: '#00ff00'}},0,0,0,0]
        },
        {
          name: 'gH',
          type: 'bar',
          stack: 'one',
          data: [0,{value: 66.6, itemStyle: {color: '#ff7f7f'}},0,0,0]
        },
        {
          name: 'gW',
          type: 'bar',
          stack: 'one',
          data: [0,0,{value: 3.9, itemStyle: {color: '#7f7fff'}},0,0]
        },
        {
          name: 'pH',
          type: 'bar',
          stack: 'one',
          data: [0,0,0,{value: 14.9, itemStyle: {color: '#ff0000'}},0]
        },
        {
          name: 'pW',
          type: 'bar',
          stack: 'one',
          data: [0,0,0,0,{value: 1.4, itemStyle: {color: '#0000ff'}}]
        }
      ]
      

      cd93150b-98c5-41b7-9174-8210e32f105c-image.png

      Was mache ich bloß falsch? Muss ich am Ende alle Bezeichner in Anführungszeichen setzen?

      mickymM Online
      mickymM Online
      mickym
      Most Active
      wrote on last edited by
      #2

      @legro Ja bei einem sauberen JSON sind die Eigenschaften immer Strings in Anführungszeichen.

      Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

      1 Reply Last reply
      0
      • L legro

        Für den FlexCharts-Adapter von @jrbwh möchte ich ein als JSON gespeichertes Chart mittels JSON.parse im RAM als Objekt anlagen. Leider gelingt es mir nicht (mehr). Der Inhalt des Datenpunktes mit dem Chart lautet ..

        title: {
          text: 'Tageswerte',
          top: '5%',
          left: '5%',
          textStyle: {
            fontSize: 20,
            fontWeight: 'bold',
            color: '#ffffff'
          },
        },
        legend: {
          data: [
              {
                name: 'Gas',
                itemStyle: {color: '#00ff00'}
              },
              {
                name: 'gH',
                itemStyle: {color: '#ff0000'}
              },
              {
                name: 'gW',
                        itemStyle: {color: '#0000ff'}
              },
              {
                name: 'pH',
                itemStyle: {color: '#ff7f7f'}
              },
              {
                name: 'pW',
                itemStyle: {color: '#7f7fff'}
              }
          ],
          orient: 'vertical',
          right: '10%'
        },
        tooltip: {},
        xAxis: {
          data: ['Gas','gH','gW','pH','pW']
        },
        yAxis: {
          axisLabel: {
            formatter: '{value} KWh',
            align: 'center'
          }
        },
        grid: {
          left: '5%',
          right: '5%',
          top: '15%',
          bottom: '5%'
        },
        series: [
          {
            name: 'Gas',
            type: 'bar',
            stack: 'one',
            data: [{value: 0.81, itemStyle: {color: '#00ff00'}},0,0,0,0]
          },
          {
            name: 'gH',
            type: 'bar',
            stack: 'one',
            data: [0,{value: 66.6, itemStyle: {color: '#ff7f7f'}},0,0,0]
          },
          {
            name: 'gW',
            type: 'bar',
            stack: 'one',
            data: [0,0,{value: 3.9, itemStyle: {color: '#7f7fff'}},0,0]
          },
          {
            name: 'pH',
            type: 'bar',
            stack: 'one',
            data: [0,0,0,{value: 14.9, itemStyle: {color: '#ff0000'}},0]
          },
          {
            name: 'pW',
            type: 'bar',
            stack: 'one',
            data: [0,0,0,0,{value: 1.4, itemStyle: {color: '#0000ff'}}]
          }
        ]
        

        cd93150b-98c5-41b7-9174-8210e32f105c-image.png

        Was mache ich bloß falsch? Muss ich am Ende alle Bezeichner in Anführungszeichen setzen?

        T Do not disturb
        T Do not disturb
        ticaki
        wrote on last edited by
        #3

        @legro

        hab copilot gesagt er soll mal:

        {
          "title": {
            "text": "Tageswerte",
            "top": "5%",
            "left": "5%",
            "textStyle": {
              "fontSize": 20,
              "fontWeight": "bold",
              "color": "#ffffff"
            }
          },
          "legend": {
            "data": [
              {
                "name": "Gas",
                "itemStyle": {"color": "#00ff00"}
              },
              {
                "name": "gH",
                "itemStyle": {"color": "#ff0000"}
              },
              {
                "name": "gW",
                "itemStyle": {"color": "#0000ff"}
              },
              {
                "name": "pH",
                "itemStyle": {"color": "#ff7f7f"}
              },
              {
                "name": "pW",
                "itemStyle": {"color": "#7f7fff"}
              }
            ],
            "orient": "vertical",
            "right": "10%"
          },
          "tooltip": {},
          "xAxis": {
            "data": ["Gas", "gH", "gW", "pH", "pW"]
          },
          "yAxis": {
            "axisLabel": {
              "formatter": "{value} KWh",
              "align": "center"
            }
          },
          "grid": {
            "left": "5%",
            "right": "5%",
            "top": "15%",
            "bottom": "5%"
          },
          "series": [
            {
              "name": "Gas",
              "type": "bar",
              "stack": "one",
              "data": [
                {"value": 0.81, "itemStyle": {"color": "#00ff00"}},
                0,
                0,
                0,
                0
              ]
            },
            {
              "name": "gH",
              "type": "bar",
              "stack": "one",
              "data": [
                0,
                {"value": 66.6, "itemStyle": {"color": "#ff7f7f"}},
                0,
                0,
                0
              ]
            },
            {
              "name": "gW",
              "type": "bar",
              "stack": "one",
              "data": [
                0,
                0,
                {"value": 3.9, "itemStyle": {"color": "#7f7fff"}},
                0,
                0
              ]
            },
            {
              "name": "pH",
              "type": "bar",
              "stack": "one",
              "data": [
                0,
                0,
                0,
                {"value": 14.9, "itemStyle": {"color": "#ff0000"}},
                0
              ]
            },
            {
              "name": "pW",
              "type": "bar",
              "stack": "one",
              "data": [
                0,
                0,
                0,
                0,
                {"value": 1.4, "itemStyle": {"color": "#0000ff"}}
              ]
            }
          ]
        }
        

        Weather-Warnings Espresense NSPanel-Lovelace-ui Tagesschau

        Spenden

        L 1 Reply Last reply
        1
        • T ticaki

          @legro

          hab copilot gesagt er soll mal:

          {
            "title": {
              "text": "Tageswerte",
              "top": "5%",
              "left": "5%",
              "textStyle": {
                "fontSize": 20,
                "fontWeight": "bold",
                "color": "#ffffff"
              }
            },
            "legend": {
              "data": [
                {
                  "name": "Gas",
                  "itemStyle": {"color": "#00ff00"}
                },
                {
                  "name": "gH",
                  "itemStyle": {"color": "#ff0000"}
                },
                {
                  "name": "gW",
                  "itemStyle": {"color": "#0000ff"}
                },
                {
                  "name": "pH",
                  "itemStyle": {"color": "#ff7f7f"}
                },
                {
                  "name": "pW",
                  "itemStyle": {"color": "#7f7fff"}
                }
              ],
              "orient": "vertical",
              "right": "10%"
            },
            "tooltip": {},
            "xAxis": {
              "data": ["Gas", "gH", "gW", "pH", "pW"]
            },
            "yAxis": {
              "axisLabel": {
                "formatter": "{value} KWh",
                "align": "center"
              }
            },
            "grid": {
              "left": "5%",
              "right": "5%",
              "top": "15%",
              "bottom": "5%"
            },
            "series": [
              {
                "name": "Gas",
                "type": "bar",
                "stack": "one",
                "data": [
                  {"value": 0.81, "itemStyle": {"color": "#00ff00"}},
                  0,
                  0,
                  0,
                  0
                ]
              },
              {
                "name": "gH",
                "type": "bar",
                "stack": "one",
                "data": [
                  0,
                  {"value": 66.6, "itemStyle": {"color": "#ff7f7f"}},
                  0,
                  0,
                  0
                ]
              },
              {
                "name": "gW",
                "type": "bar",
                "stack": "one",
                "data": [
                  0,
                  0,
                  {"value": 3.9, "itemStyle": {"color": "#7f7fff"}},
                  0,
                  0
                ]
              },
              {
                "name": "pH",
                "type": "bar",
                "stack": "one",
                "data": [
                  0,
                  0,
                  0,
                  {"value": 14.9, "itemStyle": {"color": "#ff0000"}},
                  0
                ]
              },
              {
                "name": "pW",
                "type": "bar",
                "stack": "one",
                "data": [
                  0,
                  0,
                  0,
                  0,
                  {"value": 1.4, "itemStyle": {"color": "#0000ff"}}
                ]
              }
            ]
          }
          
          L Away
          L Away
          legro
          wrote on last edited by
          #4

          @ticaki

          Vielen Dank für deine Mühe. Ich habe deinen umgewandelten Text eingegeben, und was soll ich sagen, es funktioniert.👍

          Nach über vier Jahren Leidenszeit unter Qivicon/MSH vor den Telekomikern zu ioBroker geflüchtet.
          Raspberry Pi 4 mit 8GB + ArgonOneM.2 + 120GB SSD + Coordinator CC26X2R1 + ioBroker + piVCCU3

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          Support us

          ioBroker
          Community Adapters
          Donate
          FAQ Cloud / IOT
          HowTo: Node.js-Update
          HowTo: Backup/Restore
          Downloads
          BLOG

          528

          Online

          32.4k

          Users

          81.4k

          Topics

          1.3m

          Posts
          Community
          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
          ioBroker Community 2014-2025
          logo
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Recent
          • Tags
          • Unread 0
          • Categories
          • Unreplied
          • Popular
          • GitHub
          • Docu
          • Hilfe