//Create a class for smoke detector package SmokeDetector import SmartThing.SmartThings public class SmokeDetectors extends SmartThings { List smokeDetectors = new ArrayList() SmokeDetectors(Closure sendEvent, boolean init) { // Only initialize one time since we only have one device for each capability smokeDetectors = smartThings // Initialization String id = "smokeDetectorID0" String label = "smoke" String displayName = "smokeDetector" String smoke if (init) smoke = "clear" else smoke = "detected" smokeDetectors.add(new SmokeDetector(sendEvent, id, label, displayName, smoke)) } }