Jump to content

Address returned with REST response


swnewman

Recommended Posts

Posted

Would it be easy to return the address of the responding device when you send a command via REST?  Right now, we only see a success or failure message without any info tying the message to a particular device.  My use case is implementing the REST feedback into iRule.  Without identifying info in the response, iRule can't know which button to update.  Obviously, I can ask for the status of the device specifically, but that requires a second command to the ISY which does not work with a toggle (on/off) button in iRule.

 

For example, this is what would be nice:

-Send a REST on command to device aa.bb.cc

-Receive a REST response containing (success/failure) (command - in this case 'on') (address - in this case 'aa.bb.cc')

 

Hopefully that makes sense.  Basically just incorporate more of the status info into the response to a command.

Posted

Hello swnewman,

 

Unfortunately this is not how ISY was designed. Since REST commands are synchronous, don't you already know the address of the device for which the command is issued?

 

Also, to update status - and as far as I know - iRule already supports ISY subscriptions. So, status should come back to iRule if it's subscribed to ISY.

 

With kind regards,

Michel

Posted

I believe iRule only subscribes to ISY if you purchase their module, which is unfortunately limiting as far as how you can design with it.  The way the out-of-the-box iRule works is with feedbacks where you parse the ascii response.  So in order to know which feedback item to update (whether it is text or an image on the screen) I need to know which device has been successfully turned on.  iRule knows what button I pressed, but I want it to know the real time status of the devices.

 

I think I may have another way to do it.  The 'nodes' statement without a command seems like it may help.

Posted

Hi swnewman,

 

Thanks so very much for the details. Just as a background, the reason that status is not immediately sent back is because there might be communication errors. ISY sends status if the actual device state has changed OR if there's communication error, then you would get a node error event.

 

With kind regards,

Michel

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...