Created
June 23, 2015 17:02
-
-
Save mager/069b63f15563d330a935 to your computer and use it in GitHub Desktop.
Controlling Sonos from SmartThings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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