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

Interpreting json response


Question

Posted

Hello everybody

I'm trying to create a website where I could send the commands using the fibaro API. I don't know how to control the json file answer to display some values . Do I have to install a program ? Or a server? I can write little programs in php or python and know how to use html.

Thanks for help.

 

4 answers to this question

Recommended Posts

  • 1
Posted (edited)

Do you mean send API commands to Fibaro controller from website and to breakdown jSON tables received from Fibaro?

In general JSON response is a table represented as a string. You need to decode the string back to table and to retrieve data as standard table structure.

Please try send API command to fibaro using FIrefox browser. On left top side you have buttons to view received data as JSON or Raw data. Hope it will clarify JSON structure to you

 

Edited by cag014
  • 0
  • Inquirer
  • Posted

    Thanks cag014,

    Yes, it  is.

    But I receive directly the json file in the chrome window from witch I send the API command and don't know how to capture it. Sorry if it is a basic question. I use chrome as navigator because after I would work with a raspberry pi and a 7" screen.

    I'm 71 and don't want to die stupid.

    Thanks

    • 0
    Posted

    Admire your approach...

    As  I understand you're using chrome just to review the answer. afterword you'll use this on raspberry p, right?

    So start to write on raspberry

    send HTTP command

    Receive JSON

    Parse JSON

    Here is an example that you can try to use in HC2 Virtual device... just play with that....

    Please login or register to see this code.

    I know some users in this form using raspberry as well.... so anyone can send part of the code for JSON decoding?

     

     

    • 0
  • Inquirer
  • Posted

    Thanks so much. I'll try tomorrow.

    Good night

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