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

http string to read sensor value from device thru API


Question

Posted

Hi folks,

I'm trying to read the value of a temp sensor and display in a webpage

 

I was trying to use a http call (the device is is 871)

 

If I drop the following into a browser I get all the data back

Please login or register to see this code.

but I want to just display the 'value' field which contains the actual temp value

 

I tried the following and some versions

Please login or register to see this code.

but it didn't seem to work

 

Alternatively if somebody has some webpage code that reads some value thought the API and displays it, I could work with that as well

 

 

Any suggestions ?

 

Thanks

-F

 

6 answers to this question

Recommended Posts

  • 0
Posted

I'll post the lua code anyway

Please login or register to see this image.

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

 

Please login or register to see this code.

  • 0
Posted

Let's see if I understand. You have a HC2 and another device that can do a http request? And on that other device you want to get data from the HC2? If so, then the answer is: the result is JSON encoded, use whatever programming language that is available to extract the "value" field.

I can give you lua code to do that... Is your "other device" capable of running lua?

  • 0
  • Inquirer
  • Posted

    I'll post the lua code anyway

    Please login or register to see this image.

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

     

    Please login or register to see this code.

    perfect Peter ... I can work with this 

     

    One 'curiosity' question 

     

    What does this IP address refer to in the lua above

     

    Please login or register to see this link.

     

    Thx

    -Frank

    • 0
    Posted

    It runs the same service as the public IP but doesn't require authentication. A firewall rule prevents outside access, so your homecenter is safe.

    • 0
  • Inquirer
  • Posted

    It runs the same service as the public IP but doesn't require authentication. A firewall rule prevents outside access, so your homecenter is safe.

     

    thx

    • 0
    Posted

    Have fun!

    Please login or register to see this image.

    /emoticons/default_icon_smile.gif" alt=":-)" />

    Guest
    This topic is now closed to further replies.
    ×
    ×
    • Create New...