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

status from one device using http rest commands


Cleverson

Question

Hi, I need some help about one integration we are doing here!  with another system, my scenario is:

I have a Door Lock kaddas running perfectly on HC Lite, what I need is:

When I do that http Get requisition:  http://192.168.1.23/api/devices?id=299

 

We receive this Json Structure below and that's ok for me:

{"id":299,"name":"Porta Dos Fundos","roomID":4,"type":"com.fibaro.doorLock","baseType":"com.fibaro.securityMonitoring","enabled":true,"visible":true,"isPlugin":false,"parentId":298,"remoteGatewayId":0,"interfaces":["accessControlEvent","battery","fibaroFirmwareUpdate","pinCode","zwave","zwaveAlarm"],"properties":{"parameters":[],"pollingTimeSec":0,"zwaveCompany":"","zwaveInfo":"3,5,3","zwaveVersion":"3.1","alarmLevel":"0","alarmType":"0","batteryLevel":"58","batteryLowNotification":"true","categories":"[\"security\"]","configured":true,"dead":"false","deadReason":"","defInterval":"0","deviceControlType":"0","deviceIcon":"79","emailNotificationID":"0","emailNotificationType":"0","endPointId":"0","firmwareUpdate":"{\"info\":\"\",\"progress\":0,\"status\":\"UpToDate\",\"updateVersion\":\"3.1\"}","log":"","logTemp":"","manufacturer":"","markAsDead":"true","maxInterval":"0","maxUsers":"12","minInterval":"0","model":"","nodeId":"34","parametersTemplate":"0","productInfo":"2,29,0,3,0,1,3,1","pushNotificationID":"6","pushNotificationType":"0","remoteGatewayId":"0","saveLogs":"true","secured":"255","serialNumber":"h'52475a57444c414e81190401010c0056","smsNotificationID":"0","smsNotificationType":"0","stepInterval":"0","updateVersion":"","useTemplate":"false","userCodes":"[{\"id\":1,\"name\":\"User 1\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":2,\"name\":\"User 2\",\"status\":\"Occupied\",\"update\":\"Ok\"},{\"id\":3,\"name\":\"User 3\",\"status\":\"Occupied\",\"update\":\"Ok\"},{\"id\":4,\"name\":\"User 4\",\"status\":\"Occupied\",\"update\":\"Ok\"},{\"id\":5,\"name\":\"User 5\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":6,\"name\":\"User 6\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":7,\"name\":\"User 7\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":8,\"name\":\"User 8\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":9,\"name\":\"User 9\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":10,\"name\":\"User 10\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":11,\"name\":\"User 11\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":12,\"name\":\"User 12\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":13,\"name\":\"User 13\",\"status\":\"Unknown\",\"update\":\"Ok\"},{\"id\":14,\"name\":\"User 14\",\"status\":\"Unknown\",\"update\":\"Ok\"},{\"id\":15,\"name\":\"User 15\",\"status\":\"Unknown\",\"update\":\"Ok\"},{\"id\":16,\"name\":\"User 16\",\"status\":\"Unknown\",\"update\":\"Ok\"},{\"id\":17,\"name\":\"User 17\",\"status\":\"Unknown\",\"update\":\"Ok\"},{\"id\":18,\"name\":\"User 18\",\"status\":\"Unknown\",\"update\":\"Ok\"},{\"id\":19,\"name\":\"User 19\",\"status\":\"Unknown\",\"update\":\"Ok\"},{\"id\":20,\"name\":\"User 20\",\"status\":\"Unknown\",\"update\":\"Ok\"}]","userDescription":"","value":"true"},"actions":{"abortUpdate":1,"getMaxUsers":0,"getUserCode":1,"reconfigure":0,"retryUpdate":1,"secure":0,"setInterval":1,"setUserCode":4,"startUpdate":1,"unsecure":0,"updateFirmware":1},"created":1651407264,"modified":1651407264,"sortOrder":51}

 

what I need to do is exactly what field on this structure is about the real state of the door right now, or in other words, if is open or not!! 

 

i have tried compare two situations with the door open and close, but the information is the same!! is there a better way to do that:  get the status on one device via http Requisition ? 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
On 5/3/2022 at 10:45 PM, Cleverson said:

Hi, I need some help about one integration we are doing here!  with another system, my scenario is:

I have a Door Lock kaddas running perfectly on HC Lite, what I need is:

When I do that http Get requisition:  http://192.168.1.23/api/devices?id=299

 

We receive this Json Structure below and that's ok for me:

{"id":299,"name":"Porta Dos Fundos","roomID":4,"type":"com.fibaro.doorLock","baseType":"com.fibaro.securityMonitoring","enabled":true,"visible":true,"isPlugin":false,"parentId":298,"remoteGatewayId":0,"interfaces":["accessControlEvent","battery","fibaroFirmwareUpdate","pinCode","zwave","zwaveAlarm"],"properties":{"parameters":[],"pollingTimeSec":0,"zwaveCompany":"","zwaveInfo":"3,5,3","zwaveVersion":"3.1","alarmLevel":"0","alarmType":"0","batteryLevel":"58","batteryLowNotification":"true","categories":"[\"security\"]","configured":true,"dead":"false","deadReason":"","defInterval":"0","deviceControlType":"0","deviceIcon":"79","emailNotificationID":"0","emailNotificationType":"0","endPointId":"0","firmwareUpdate":"{\"info\":\"\",\"progress\":0,\"status\":\"UpToDate\",\"updateVersion\":\"3.1\"}","log":"","logTemp":"","manufacturer":"","markAsDead":"true","maxInterval":"0","maxUsers":"12","minInterval":"0","model":"","nodeId":"34","parametersTemplate":"0","productInfo":"2,29,0,3,0,1,3,1","pushNotificationID":"6","pushNotificationType":"0","remoteGatewayId":"0","saveLogs":"true","secured":"255","serialNumber":"h'52475a57444c414e81190401010c0056","smsNotificationID":"0","smsNotificationType":"0","stepInterval":"0","updateVersion":"","useTemplate":"false","userCodes":"[{\"id\":1,\"name\":\"User 1\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":2,\"name\":\"User 2\",\"status\":\"Occupied\",\"update\":\"Ok\"},{\"id\":3,\"name\":\"User 3\",\"status\":\"Occupied\",\"update\":\"Ok\"},{\"id\":4,\"name\":\"User 4\",\"status\":\"Occupied\",\"update\":\"Ok\"},{\"id\":5,\"name\":\"User 5\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":6,\"name\":\"User 6\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":7,\"name\":\"User 7\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":8,\"name\":\"User 8\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":9,\"name\":\"User 9\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":10,\"name\":\"User 10\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":11,\"name\":\"User 11\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":12,\"name\":\"User 12\",\"status\":\"Available\",\"update\":\"Ok\"},{\"id\":13,\"name\":\"User 13\",\"status\":\"Unknown\",\"update\":\"Ok\"},{\"id\":14,\"name\":\"User 14\",\"status\":\"Unknown\",\"update\":\"Ok\"},{\"id\":15,\"name\":\"User 15\",\"status\":\"Unknown\",\"update\":\"Ok\"},{\"id\":16,\"name\":\"User 16\",\"status\":\"Unknown\",\"update\":\"Ok\"},{\"id\":17,\"name\":\"User 17\",\"status\":\"Unknown\",\"update\":\"Ok\"},{\"id\":18,\"name\":\"User 18\",\"status\":\"Unknown\",\"update\":\"Ok\"},{\"id\":19,\"name\":\"User 19\",\"status\":\"Unknown\",\"update\":\"Ok\"},{\"id\":20,\"name\":\"User 20\",\"status\":\"Unknown\",\"update\":\"Ok\"}]","userDescription":"","value":"true"},"actions":{"abortUpdate":1,"getMaxUsers":0,"getUserCode":1,"reconfigure":0,"retryUpdate":1,"secure":0,"setInterval":1,"setUserCode":4,"startUpdate":1,"unsecure":0,"updateFirmware":1},"created":1651407264,"modified":1651407264,"sortOrder":51}

 

what I need to do is exactly what field on this structure is about the real state of the door right now, or in other words, if is open or not!! 

 

i have tried compare two situations with the door open and close, but the information is the same!! is there a better way to do that:  get the status on one device via http Requisition ? 

Refer to the field value in properties...

value=true  means the door is open (sensor has  breached) 

value=false means the door is closed (sensor in safe mode)

Edited by cag014
Link to comment
Share on other sites

  • 0
  • Inquirer
  • OK! BUT Wich value?  is corresponding to open or closed?  because there is a lot of true or false vaues inside theis json structure, could you give-me more directions?  after what string is wrote: armer or disarmed?   i can'T see !!  

    Link to comment
    Share on other sites

    • 0

    in this table as I marked in red "value":"true"  ( have marked the properties also)

    By the way this is the only parameter called value in entire structure.

    Anyhow for example data=http://192.168.1.23/api/devices?id=299

    then use

    if data.properties.value ==true  then ...... end 

    if data.properties.value== false  then .... end 

    Edited by cag014
    Link to comment
    Share on other sites

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