I sent you an email with some of the lower-level protocol information.
If you take the approach of creating a plugin instead, then here is an example of the hooks for catching device changes (note this includes all device property changes, not just state changes):
- Code: Select all
def deviceCreated(self, dev):
self.server.log(u"deviceCreated: \n" + str(dev))
indigo.PluginBase.deviceCreated(self, dev) # be sure and call parent function
# do something here
def deviceDeleted(self, dev):
self.server.log((u"deviceDeleted: \n" + str(dev))
indigo.PluginBase.deviceDeleted(self, dev) # be sure and call parent function
# do something here
def deviceUpdated(self, origDev, newDev):
self.server.log(u"deviceUpdated orig: \n" + str(origDev))
self.server.log(u"deviceUpdated new: \n" + str(newDev))
indigo.PluginBase.deviceUpdated(self, origDev, newDev) # be sure and call parent function
# do something here
# and somewhere in plugin initialization you'll want:
indigo.devices.subscribeToChanges()