//Create a class for motion sensor package MotionSensor import SmartThing.SmartThings public class MotionSensors extends SmartThings { List motionSensors = new ArrayList() MotionSensors(Closure sendEvent, boolean init) { // Only initialize one time since we only have one device for each capability motionSensors = smartThings // Initialization String id = "motionSensorID0" String label = "motion" String displayName = "motionSensor" String motion if (init) motion = "inactive" else motion = "active" motionSensors.add(new MotionSensor(sendEvent, id, label, displayName, motion)) } }