while(true) { def eventNumber = Verify.getInt(0,4) switch(eventNumber) { case 0: def event = Verify.getInt(0,1) if (event == 0) { lockObject.setValue([name: "lock", value: "locked", deviceId: "lockID0", descriptionText: "", displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) } else { lockObject.setValue([name: "lock", value: "unlocked", deviceId: "lockID0", descriptionText: "", displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) } break case 1: lockObject.setValue([name: "unlock", value: "unlocked ", deviceId: "lockID0", descriptionText: "", displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) break case 2: contactObject.setValue([name: "contact.open", value: "open", deviceId: "contactSensorID0", descriptionText: "", displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) break case 3: contactObject.setValue([name: "contact.closed", value: "closed", deviceId: "contactSensorID0", descriptionText: "", displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) break case 4: appObject.setValue([name: "Touched", value: "touched", deviceId: "touchedSensorID0", descriptionText: "", displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) break } }