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

Get door sensor going "safe" via REST API?


Question

Posted

I can query a device (a com.fibaro.doorSensor) via the API with a call to: http://fibaro/api/devices/<deviceID>

 

From this I can pull the properties.lastBreached value (an epoch count in seconds) which is the time the door was opened.

 

I can't see any way to pull the value of when the sensor went safe (when the door closed).  It must be somewhere, since the UI shows it.

 

Any ideas?

3 answers to this question

Recommended Posts

  • 0
Posted

Just pull properties.value same as you doing with properties.lastBreached .

By the way you can do it with standard commands.

fibaro:getValue(devID,"value")

fibaro:getValue(devID,"lastBreached")

  • 0
  • Inquirer
  • Posted

    Thanks - that got me the true/false to show if the sensor is currently breached, but I still can't see a way to determine when it closed?  So far I can pull a time for when opened, and if it is currently open or closed.  The UI exposes a time closed - but this doesn't appear in the API response.

     

    I'm using the REST API from a Node.js app that also does a bunch of other stuff, not from within the Fibaro interface itself.

     

    The time in the "safe" response in the UI seems to granular to be generated by polling, so is the exact time a door was closed exposed anywhere else?

     

    Thanks for your help so far - at least now I can grab current state properly!

     

    Howard

     

    • 0
    Posted

    OK... I see that you need latsModified and not lastBreached value.

    You can use

    fibaro:getModificationTime(devID , "value")

    or

    http://hc2/api/devices/<deviceID> /properties/value

    or

    value,  lastModified =  fibaro:get(devID,"value")

     

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