Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Nested JSON help!!!


Question

Posted

Hi all!

 

My solar-device  has a json.file, but I am not able to read out certain values. For example, I want to obtain the value of "wNow" in the table "Production".

I know how to use "standard"-json-files, but this one I don't know. Maybe caused by the [ and ] ?

I hope there's someone to help me out!! It would really be appreciated!!

 

Below the json-file, I edited a little bit for readability only, the characters are 

 

Thanks!!

 

-------------------------------------------------------------------------

JSON-file:

 

 

{

"production":
    [

    {
    "type":    "inverters",
    "activeCount":4,
    "readingTime":1535205784,
    "wNow":95,
    "whLifetime":7508
    },


    {
    "type":"eim",
    "activeCount":1,
    "measurementType":"production",
    "readingTime":1535205880,
    "wNow":-1.868,
    "whLifetime":0.0,
    "varhLeadLifetime":0.064,
    "varhLagLifetime":9.769,
    "vahLifetime":4479.172,
    "rmsCurrent":0.129,
    "rmsVoltage":236.277,
    "reactPwr":-0.0,
    "apprntPwr":30.417,
    "pwrFactor":-0.17,
    "whToday":0.0,
    "whLastSevenDays":0.0,
    "vahToday":488.172,
    "varhLeadToday":0.064,
    "varhLagToday":1.769

    }

    ],

 

 

"consumption" :
    [

    {
    "type":"eim",
    "activeCount":1,
    "measurementType":"total-consumption",
    "readingTime":1535205880,
    "wNow":43.254,
    "whLifetime":70977.932,
    "varhLeadLifetime":97421.722,
    "varhLagLifetime":2149.543,
    "vahLifetime":150664.803,
    "rmsCurrent":2.048,
    "rmsVoltage":236.26,
    "reactPwr":-403.005,
    "apprntPwr":483.897,
    "pwrFactor":0.09,
    "whToday":2168.932,
    "whLastSevenDays":32076.932,
    "vahToday":9835.803,
    "varhLeadToday":5817.722,
    "varhLagToday":432.543
    },

 

    {
    "type":"eim",
    "activeCount":1,
    "measurementType":"net-consumption",
    "readingTime":1535205880,
    "wNow":45.122,
    "whLifetime":75066.155,
    "varhLeadLifetime":97421.658,
    "varhLagLifetime":2139.774,
    "vahLifetime":150664.803,
    "rmsCurrent":1.919,
    "rmsVoltage":236.243,
    "reactPwr":-403.005,
    "apprntPwr":453.806,
    "pwrFactor":0.1,
    "whToday":0,
    "whLastSevenDays":0,
    "vahToday":0,
    "varhLeadToday":0,
    "varhLagToday":0
    }
    ],

 

"storage":
    [

    {
    "type":"acb",
    "activeCount":0,
    "readingTime":0,
    "wNow":0,
    "whNow":0,
    "state":"idle"
    }

    ]

 

    }

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

Looks like standard JSON table. Production section has two elements.

please try jsonfile.production[1].wNow

Edited by cag014
  • 0
  • Inquirer
  • Posted

    Woooow!!!!

    Thanks a lot dude!!!

    It works!

     

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...