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

Helo : need to retrive temperature via API from Linux BOX


Question

Posted

Hello,

I want to disable my scene that run each minute in order to retrive some temperature value and put it in ThingSpeak.

So i want to migrate it in a Linux Box , using API to retrive temperature

As far as i know , the URL for retrive a device value is : IPADDR/api/devices?id=xx

Here you are my question :

1) - This URL give all devices parameter .... is there a way to get only the temperature value ?

2) - Have someone try to do the same from a linux BOX ?

3) - If point2=yes .... what do you use to parse output of API ? Awk ? sed ? Is there an example ?

Thank you in advance

Crippa Andrea

3 answers to this question

Recommended Posts

  • 0
Posted

candrea77, API is accessible from other devices as long as you authenticate connection. You can also use virtual device to send specific value to the box, e.g. with PUT. This way you can easily use json.decode and use field you are interested in (temperature in your case).

  • 0
  • Inquirer
  • Posted
    candrea77, API is accessible from other devices as long as you authenticate connection. You can also use virtual device to send specific value to the box, e.g. with PUT. This way you can easily use json.decode and use field you are interested in (temperature in your case).

    Thank you for the reply.

    Actually i'm sending value to ThingSpeak through HC2 with virtual device ..... and it work w/o problem.

    But i want to stop all specific scene that run each minute , and load this process to my linux box ...... So i don't want a virtual device that send data to linux box (I just have virtual device that send data to thing speak !!!!) ..... I want a linux box that with shell script / wget and some other grab value using API from HC2.

    So the question is :

    1) - This URL give all devices parameter (IPADDR/api/devices?id=xx ) .... is there a way to get only the temperature value with a single URL for a specific temperature device like a Aeon4in1 that is my case ?

    • 0
    Posted

    1) - This URL give all devices parameter (IPADDR/api/devices?id=xx ) .... is there a way to get only the temperature value with a single URL for a specific temperature device like a Aeon4in1 that is my case ?

    No. But since it is JSON it is easy to parse on a linux box. Python/PHP/etc all have modules for this purpose.

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