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

JSON4LUA in next version ?


Question

Posted

Hi Krystian, is there a chance to have JSON library in the next version 3.xx ? Thx.

18 answers to this question

Recommended Posts

  • 0
Posted

Please specify directly what functionality are you have in mind because it is a little bit overall question.

  • 0
  • Inquirer
  • Posted

    For exemple:

    i would like to parse data acquired by Netatmo Weather Stations (

    Please login or register to see this link.

    Please login or register to see this link.

    ), all HTTP responses are JSON encoded.

    Please login or register to see this code.

    I don't want use external script (on another server) to retrieve and use informations.

    JSON parser in Fibaro HC2 product could improve many interactions because more and more third API uses JSON in place of XML, support both would be great

    Please login or register to see this image.

    /emoticons/default_icon_biggrin.gif" alt=":-D" />

    • 0
    Posted

    Krikroff, we will release such functionality but right now it is under construction.

    • 0
  • Inquirer
  • Posted
    Krikroff, we will release such functionality but right now it is under construction.

    this feature will it be present in v3.xx ? Thx

    • 0
    Posted

    It will be in 3.xx version. Not 100% sure that in first beta, but it will be in final version.

    • 0
    Posted

    Hi Krystian,

    You mention "in first beta". I thought we were getting a finalised V3 instead of V2.beta? I think we were also led to believe that this would be in december, is this not the case?

    • 0
    Guest Futuretech
    Posted
    Hi Krystian,

    You mention "in first beta". I thought we were getting a finalised V3 instead of V2.beta? I think we were also led to believe that this would be in december, is this not the case?

    +1

    • 0
    Guest vayher
    Posted
    Hi Krystian,

    You mention "in first beta". I thought we were getting a finalised V3 instead of V2.beta? I think we were also led to believe that this would be in december, is this not the case?

    +1

    We've released v3.311 beta version today and it's going to be finalised soon. Answering the question - we've just finished JSON parsing library for our Lua scripting and it will be added to our engine after testing.

    • 0
  • Inquirer
  • Posted

    I'am pleased to read that, thx for your investment, hope Hc2 will reveal its full potential.

    Regards.

    • 0
    Guest cedriclocqueneu
    Posted

    Hi,

    Is it possible, now ?

    • 0
  • Inquirer
  • Posted

    Hi Cédric, you can find JSON specification at docs.fibaro.com

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" /> its custom fibaro LUA package as Net.*

    • 0
    Guest cedriclocqueneu
    Posted

    Ok, thanks !

    • 0
    Guest deraaij
    Posted
    Hi Cédric, you can find JSON specification at docs.fibaro.com

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" /> its custom fibaro LUA package as Net.*

    To avoid misunderstanding, these libraries are only available in virtual devices (for now).

    • 0
    Guest cedriclocqueneu
    Posted

    OK. With this, is it possible to catch a value from json and put it in a virtual device ? Per example to catch weather information from a weather station like Netatmo ?

    • 0
  • Inquirer
  • Posted

    You can easily request netatmo JSON, parse results and store few value in global variable for use later in scene...

    I don't know if it possible to store LUA table or JSON object in fibaro global variable ?

    • 0
    Posted

    Yes you can use fibaro:getGlobalValue and fibaro:setGlobal to write in he variable.

    • 0
  • Inquirer
  • Posted

    Yes I know all that but my question was whether it is possible to save an object or a table directly in the variable to avoid creating too many variables :->

    edit: in fact I'm going to try it will be easier

    • 0
    Guest jrkalf
    Posted
    Yes I know all that but my question was whether it is possible to save an object or a table directly in the variable to avoid creating too many variables :->

    edit: in fact I'm going to try it will be easier

    During some tests, I haven't been able to do so

    Please login or register to see this image.

    /emoticons/default_sad.png" alt=":(" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    It looks like the global variables are integers, not strings or tables.

    Can any1 elaborate on this?

    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...