Skip to content

Instantly share code, notes, and snippets.

@jimmyjames
Created July 7, 2015 19:04
Show Gist options
  • Save jimmyjames/532f1832e46af3ea2c7d to your computer and use it in GitHub Desktop.
Save jimmyjames/532f1832e46af3ea2c7d to your computer and use it in GitHub Desktop.
subscribe to events
def installed() {
subscribe(theDoor, "contact.open", doorOpenHandler)
}
def doorOpenHandler(evt) {
// ...
// send a notification that the door openend, maybe only when everyone is away
sendSms(phoneNumber, "The door is open!")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment