for line in event:
extractedEvents.write(line)
event.close()
- elif eventMap[i] == "switch.on":
- event = open("eventSimulator/switchOnEvent.groovy", "r")
- for line in event:
- extractedEvents.write(line)
- event.close()
- elif eventMap[i] == "switch.off":
- event = open("eventSimulator/switchOffEvent.groovy", "r")
- for line in event:
- extractedEvents.write(line)
- event.close()
elif eventMap[i] == "nfcTouch":
event = open("eventSimulator/nfcTouchEvent.groovy", "r")
for line in event:
for line in event:
extractedEvents.write(line)
event.close()
+ elif eventMap[i] == "motion":
+ #Write two events subsequently
+ event = open("eventSimulator/motionActiveEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ extractedEvents.write("\t\t\tbreak\n")
+ eventCounter = eventCounter + 1
+ extractedEvents.write("\t\tcase %d:\n" % eventCounter)
+ event = open("eventSimulator/motionInactiveEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ elif eventMap[i] == "smoke":
+ #Write three events subsequently
+ event = open("eventSimulator/smokeClearEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ extractedEvents.write("\t\t\tbreak\n")
+ eventCounter = eventCounter + 1
+ extractedEvents.write("\t\tcase %d:\n" % eventCounter)
+ event = open("eventSimulator/smokeDetectedEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ extractedEvents.write("\t\t\tbreak\n")
+ eventCounter = eventCounter + 1
+ extractedEvents.write("\t\tcase %d:\n" % eventCounter)
+ event = open("eventSimulator/smokeTestedEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ elif eventMap[i] == "carbonMonoxide":
+ #Write three events subsequently
+ event = open("eventSimulator/carbonMonoxideClearEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ extractedEvents.write("\t\t\tbreak\n")
+ eventCounter = eventCounter + 1
+ extractedEvents.write("\t\tcase %d:\n" % eventCounter)
+ event = open("eventSimulator/carbonMonoxideDetectedEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ extractedEvents.write("\t\t\tbreak\n")
+ eventCounter = eventCounter + 1
+ extractedEvents.write("\t\tcase %d:\n" % eventCounter)
+ event = open("eventSimulator/carbonMonoxideTestedEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ elif eventMap[i] == "battery":
+ event = open("eventSimulator/batteryChargeEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ elif eventMap[i] == "thermostatMode":
+ #Write five events subsequently
+ event = open("eventSimulator/thermostatAutoModeEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ extractedEvents.write("\t\t\tbreak\n")
+ eventCounter = eventCounter + 1
+ extractedEvents.write("\t\tcase %d:\n" % eventCounter)
+ event = open("eventSimulator/thermostatCoolModeEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ extractedEvents.write("\t\t\tbreak\n")
+ eventCounter = eventCounter + 1
+ extractedEvents.write("\t\tcase %d:\n" % eventCounter)
+ event = open("eventSimulator/thermostatEmergencyHeatModeEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ extractedEvents.write("\t\t\tbreak\n")
+ eventCounter = eventCounter + 1
+ extractedEvents.write("\t\tcase %d:\n" % eventCounter)
+ event = open("eventSimulator/thermostatHeatModeEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ extractedEvents.write("\t\t\tbreak\n")
+ eventCounter = eventCounter + 1
+ extractedEvents.write("\t\tcase %d:\n" % eventCounter)
+ event = open("eventSimulator/thermostatOffModeEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ elif eventMap[i] == "switch":
+ #Write two events subsequently
+ event = open("eventSimulator/switchOnEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ extractedEvents.write("\t\t\tbreak\n")
+ eventCounter = eventCounter + 1
+ extractedEvents.write("\t\tcase %d:\n" % eventCounter)
+ event = open("eventSimulator/switchOffEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ elif eventMap[i] == "Location":
+ #Write three events subsequently
+ event = open("eventSimulator/locationHomeEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ extractedEvents.write("\t\t\tbreak\n")
+ eventCounter = eventCounter + 1
+ extractedEvents.write("\t\tcase %d:\n" % eventCounter)
+ event = open("eventSimulator/locationAwayEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ extractedEvents.write("\t\t\tbreak\n")
+ eventCounter = eventCounter + 1
+ extractedEvents.write("\t\tcase %d:\n" % eventCounter)
+ event = open("eventSimulator/locationNightEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
eventCounter = eventCounter + 1
###TODO: Add more events later
- appObject.setValue([name: "Touched", value: "Touched", deviceId: 0, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: []])
+ appObject.setValue([name: "Touched", value: "touched", deviceId: "touchedSensorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
--- /dev/null
+ smokeDetectorObject.setValue([name: "battery", value: "5"/*A number between 0 to 100 as a charge*/, deviceId: "smokeDetectorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
- aeonKeyFobObject.setValue([name: "button", value: "held", deviceId: 0, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "held"]])
+ aeonKeyFobObject.setValue([name: "button", value: "held", deviceId: "aeonKeyFobID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
- aeonKeyFobObject.setValue([name: "button", value: "pushed", deviceId: 0, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "pushed"]])
+ aeonKeyFobObject.setValue([name: "button", value: "pushed", deviceId: "aeonKeyFobID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ smokeDetectorObject.setValue([name: "carbonMonoxide", value: "clear", deviceId: "smokeDetectorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ smokeDetectorObject.setValue([name: "carbonMonoxide", value: "detected", deviceId: "smokeDetectorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ smokeDetectorObject.setValue([name: "carbonMonoxide", value: "tested", deviceId: "smokeDetectorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
- contactObject.setValue([name: "contact.closed", value: "closed", deviceId: 0, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "closed"]])
+ contactObject.setValue([name: "contact.closed", value: "closed", deviceId: "contactSensorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
- contactObject.setValue([name: "contact.open", value: "closed", deviceId: 0, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "open"]])
+ contactObject.setValue([name: "contact.open", value: "open", deviceId: "contactSensorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
- doorControlObject.setValue([name: "doorState", value: "closed", deviceId: 0, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "closed"]])
+ doorControlObject.setValue([name: "doorState", value: "closed", deviceId: "doorControlID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
- doorControlObject.setValue([name: "doorState", value: "open", deviceId: 0, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "open"]])
+ doorControlObject.setValue([name: "doorState", value: "open", deviceId: "doorControlID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
--- /dev/null
+ locationObject.setValue([name: "Location", value: "away", deviceId: "locationID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ locationObject.setValue([name: "Location", value: "home", deviceId: "locationID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ locationObject.setValue([name: "Location", value: "night", deviceId: "locationID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
- lockObject.setValue([name: "lock", value: "locked", deviceId: 0, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "locked"]])
+ lockObject.setValue([name: "lock", value: "locked", deviceId: "lockID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
--- /dev/null
+ motionSensorObject.setValue([name: "motion", value: "active", deviceId: "motionSensorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ motionSensorObject.setValue([name: "motion", value: "inactive", deviceId: "motionSensorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
- appObject.setValue([name: "nfcTouch", value: "Touched", deviceId: 0, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "Touched"]])
+ appObject.setValue([name: "nfcTouch", value: "touched", deviceId: "nfcSensorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
- presenceSensorObject.setValue([name: "presence", value: "not present", deviceId: 0, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "not present"]])
+ presenceSensorObject.setValue([name: "presence", value: "not present", deviceId: "presenceSensorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
- presenceSensorObject.setValue([name: "presence", value: "present", deviceId: 0, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "present"]])
+ presenceSensorObject.setValue([name: "presence", value: "present", deviceId: "presenceSensorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ smokeDetectorObject.setValue([name: "smoke", value: "clear", deviceId: "smokeDetectorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ smokeDetectorObject.setValue([name: "smoke", value: "detected", deviceId: "smokeDetectorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ smokeDetectorObject.setValue([name: "smoke", value: "tested", deviceId: "smokeDetectorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ switchObject.setValue([name: "switch", value: "off", deviceId: "switchID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ switchObject.setValue([name: "switch", value: "on", deviceId: "switchID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ thermostatObject.setValue([name: "thermostatMode", value: "auto", deviceId: "thermostatID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ thermostatObject.setValue([name: "thermostatMode", value: "cool", deviceId: "thermostatID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ thermostatObject.setValue([name: "thermostatMode", value: "emergencyHeat", deviceId: "thermostatID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ thermostatObject.setValue([name: "thermostatMode", value: "heat", deviceId: "thermostatID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
--- /dev/null
+ thermostatObject.setValue([name: "thermostatMode", value: "off", deviceId: "thermostatID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
\ No newline at end of file
- lockObject.setValue([name: "unlock", value: "unlocked ", deviceId: 0, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "locked"]])
+ lockObject.setValue([name: "unlock", value: "unlocked ", deviceId: "lockID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])