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

Json usage


Question

Posted

Hi!

Im new to this json coding to get information from Virtual devices.

I have played around with it when quering the HC2 but wondering if i can use it to get information from other VD´s.

For instance, i have 2 Smart TV´s and 2 PopCorn Hour i´d like to get some info from to be able to actually read out info and that i can use to control them in a VD.

Is it possible to query these units and actually get some info from them or do i need to know how their API´s are working to be able to get any information from them?

BR

747

3 answers to this question

Recommended Posts

  • 0
Posted

Best thing is to take a look at the API for sure and find out how to query the information directly from thr unit. I have experienced some issues with querying json using vds, mainly related to the fact that the vd will crash if the json ia malformed or you don't get a valid response. This means adding additional meassures to ensure the vd doesn't try to run invalid json.

But if the vd shows the status (i.e. Shows "on/off") then you can extract that fro the vd json like any other device by polling the url leading to the specific device id.

[ Added: 2014-12-02, 18:02 ]

Best thing is to take a look at the API for sure and find out how to query the information directly from thr unit. I have experienced some issues with querying json using vds, mainly related to the fact that the vd will crash if the json ia malformed or you don't get a valid response. This means adding additional meassures to ensure the vd doesn't try to run invalid json.

But if the vd shows the status (i.e. Shows "on/off") then you can extract that fro the vd json like any other device by polling the url leading to the specific device id.

  • 0
  • Inquirer
  • Posted

    Ok. So if the API is not "released public" we have no idea how its setup and we cant make known querys to it..

    The only way is trying to guess by testing [iPToVD][/API or other similar] in browser?

    [ Added: 2014-12-06, 18:03 ]

    I finally got it to work with my popcorn hour.

    I found the API and used REST Console to check how it was setup.

    Now im able to use a VD to send key and values to it but would like to parse the response in some way..

    The API is in XML format and i dont know how to parse it with Lua?

    • 0
    Posted

    Hi 747,

     

    Could you please post your VD here.

     

    many Thanks!

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