No announcement yet.

Client: Get Status Change of Device

  • Filter
  • Time
  • Show
Clear All
new posts

  • Client: Get Status Change of Device

    I am trying to drop HSTouch and instead write my own web-based client by creating some aspx pages. I am at the stage where I can control light switches using hs.CAPIControlHandler(hs.CAPIGetSingleControl(id, true, isOn? "Off":"On", false, false)). Immediately after that I get the status with hs.CAPIGetStatus(id). The problem is that at this time the status reported is still the old status. Apparently, changing the status isn't a blocking call, which makes sense. So then how can I display the REAL status in my client, i.e. not assuming that the command was successful? I guess the best way would be if on the server side I monitor changes to devices somehow. However, even if I manage to do that, the server can't really push status changes, or can it? What is the best way to do this?