//Create a class for speech synthesis package SpeechSynthesis import SmartThing.SmartThings public class SpeechSynthesises extends SmartThings { List speechSynthesises = new ArrayList() SpeechSynthesises(Closure sendEvent, boolean init) { // Only initialize one time since we only have one device for each capability speechSynthesises = smartThings // Initialization String id = "speechSynthesisID0" String label = "level" String displayName = "speechSynthesiser" Integer level if (init) level = 50 else level = 60 speechSynthesises.add(new SpeechSynthesis(sendEvent, id, label, displayName, level)) } // Methods to set values def setLevel(int level) { speechSynthesises[0].setLevel(level) } def speak(String message) { speechSynthesises[0].speak(message) } }