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


AutoFrank
 Share

Question

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

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

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.

Link to comment
Share on other sites

  • 0

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?

Link to comment
Share on other sites

  • 0
  • Inquirer
  • 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

    Link to comment
    Share on other sites

    • 0

    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.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 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

    Link to comment
    Share on other sites

    • 0

    Have fun!

    Please login or register to see this image.

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

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    ×
    ×
    • Create New...