Skip to content

Instantly share code, notes, and snippets.

@mager
Created June 23, 2015 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mager/069b63f15563d330a935 to your computer and use it in GitHub Desktop.
Save mager/069b63f15563d330a935 to your computer and use it in GitHub Desktop.
Controlling Sonos from SmartThings
preferences {
section("Title") {
input "player", "capability.musicPlayer", title: "music player", required: true, multiple: false
input "frontDoor", "capability.contactSensor", title: "front door", required: true, multiple: false
}
}
def installed() {
subscribe(frontDoor, "contact", myHandler)
}
def myHandler(evt) {
if("open" == evt.value) {
player.playText("The front door is open")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment