--- /dev/null
+// Generate a random variable
+Random random = new Random(1131)
+int nextRandom = 10
+
+// Touch events
+new Thread() {
+ @Override
+ public void run() {
+ while(true) {
+ appObject.setValue([name: "Touched", value: "Touched", deviceId: 0, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: []])
+ Thread.sleep(random.nextInt(nextRandom));
+
+ }
+ }
+}.start()
+
+// Lock events
+new Thread() {
+
+ @Override
+ public void run() {
+ while(true) {
+ lockObject.setValue([name: "lock", value: "locked", deviceId: 0, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: []])
+ Thread.sleep(random.nextInt(nextRandom));
+ }
+ }
+}.start()
+
+new Thread() {
+
+ @Override
+ public void run() {
+ while(true) {
+ lockObject.setValue([name: "unlock", value: "unlocked", deviceId: 0, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: []])
+ Thread.sleep(random.nextInt(nextRandom));
+ }
+ }
+}.start()
+
+// Contact sensor events
+new Thread() {
+
+ @Override
+ public void run() {
+ while(true) {
+ contactObject.setValue([name: "contact.open", value: "open", deviceId: 0, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: []])
+ Thread.sleep(random.nextInt(nextRandom));
+
+ }
+ }
+}.start()
+
+new Thread() {
+
+ @Override
+ public void run() {
+ while(true) {
+ contactObject.setValue([name: "contact.closed", value: "closed", deviceId: 0, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: []])
+ Thread.sleep(random.nextInt(nextRandom));
+
+ }
+ }
+}.start()