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

HCL how to send device info to external website?


Question

Posted

Hi, I'm very new to all of this world. I have an HCL and would like to know if is it possible to send device information to an external website. I suppose it should be done through a virtual device, but I can't figure the correct syntax out of the string text box.

I've been reading lot of examples doing GET HTTP requests for sending information, but anything about what I'm trying to do.

I guess that with an HC 2 it could be easier with a LUA script, but since HCL doesn't have LUA support, may be there are other options to achieve what I want to do.

Any suggestions or answers?, is it possible?

5 answers to this question

Recommended Posts

  • 0
Posted

eyp, with HCL you can also perform POST and PUT request. Maybe you can use them to achieve your goal.

  • 0
  • Inquirer
  • Posted
    eyp, with HCL you can also perform POST and PUT request. Maybe you can use them to achieve your goal.

    Thank you. Would someone mind to give me an example of how could I get the value of some property of a device from a virtual device then send it via POST?

    The POST would be:

    Please login or register to see this code.

    Is this right?

    But I don't know how to get the value of another device without using LUA

    Please login or register to see this image.

    /emoticons/default_icon_cry.gif" alt=":cry:" />

    • 0
    Posted

    What exactly is it you want to achieve?

    • 0
  • Inquirer
  • Posted
    What exactly is it you want to achieve?

    Hi, I want to get information from a device (for example through the REST API), then send that information using HTTP POST method to an external website, but I don't know the syntax I must use to do it in a virtual device in HCL.

    • 0
    Posted

    I think you probably need to have a look at this:

    Please login or register to see this link.

    Usually cross domain POST is not allowed for security reasons. You need the receiving end to execute the command when working accross servers. So you need the server on the other side to send a GET command (i.e. send a get command to retrieve the json from a HC2) and then process by means of a script on the receiving end.

    POST cross domain is not allowed as you could potentially use it to inject malicious code into the receiving server. a way to circumvene it is to send the data as jsonp, but I don't think Fibaro supports that. So for post, I guess you'll be fresh out of luck.

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