this.coolingSetpoint = coolingSetpoint
this.currentCoolingSetpoint = currentCoolingSetpoint
println("Cooling set point for the thermostat with id:$id is changed to $coolingSetpoint!")
+ sendEvent([name: "coolingSetpoint", value: "$coolingSetpoint", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "$coolingSetpoint"]])
}
def setHeatingSetpoint(int heatingSetpoint) {
this.heatingSetpoint = heatingSetpoint
this.currentHeatingSetpoint = currentHeatingSetpoint
println("Heating set point for the thermostat with id:$id is changed to $heatingSetpoint!")
+ sendEvent([name: "heatingSetpoint", value: "$heatingSetpoint", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "$heatingSetpoint"]])
}
def setSchedule() {
def setThermostatFanMode(String thermostatFanMode) {
this.thermostatFanMode = thermostatFanMode
println("Fan mode of the thermostat with id:$id is changed to $thermostatFanMode!")
+ sendEvent([name: "thermostatFanMode", value: "$thermostatFanMode", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "$thermostatFanMode"]])
}
def setThermostatMode(String thermostatMode) {
this.thermostatMode = thermostatMode
this.currentThermostatMode = currentThermostatMode
println("Mode of the thermostat with id:$id is changed to $thermostatMode!")
+ sendEvent([name: "thermostatMode", value: "$thermostatMode", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "$thermostatMode"]])
}
def cool() {
this.thermostatMode = "cool"
this.currentThermostatMode = "cool"
println("Mode of the thermostat with id:$id is changed to cool!")
+ sendEvent([name: "cool", value: "cool", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "cool"]])
}
def heat() {
this.thermostatMode = "heat"
this.currentThermostatMode = "heat"
println("Mode of the thermostat with id:$id is changed to heat!")
+ sendEvent([name: "heat", value: "heat", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "heat"]])
}
def auto() {
this.thermostatMode = "auto"
this.currentThermostatMode = "auto"
println("Mode of the thermostat with id:$id is changed to auto!")
+ sendEvent([name: "auto", value: "auto", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "auto"]])
}
def off() {
this.thermostatMode = "off"
this.currentThermostatMode = "off"
println("Mode of the thermostat with id:$id is changed to off!")
+ sendEvent([name: "off", value: "off", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [value: "off"]])
}
def setClimate(String info, String givenClimateName) {
}
//By Model Checker
- def setValue(String value) {
- println("the thermostat with id:$id is $value!")
- this.thermostatMode = value
- this.currentThermostatMode = value
+ def setValue(String value, String name) {
+ if (name == "temperature") {
+ println("the temperature is $value!")
+ this.temperature = value
+ } else if (name == "heatingSetpoint") {
+ println("the heating set point of the thermostat with id:$id is $value!")
+ this.heatingSetpoint = value
+ } else if (name == "coolingSetpoint") {
+ println("the cooling set point of the thermostat with id:$id is $value!")
+ this.coolingSetpoint = value
+ } else if (name == "thermostatSetpoint") {
+ println("the set point of the thermostat with id:$id is $value!")
+ this.thermostatSetpoint = value
+ } else if (name == "thermostatMode") {
+ println("the mode of the thermostat with id:$id is $value!")
+ this.thermostatMode = value
+ } else if (name == "thermostatFanMode") {
+ println("the fan mode of the thermostat with id:$id is $value!")
+ this.thermostatFanMode = value
+ } else if (name == "thermostatOperatingState") {
+ println("the operating state of the thermostat with id:$id is $value!")
+ this.thermostatOperatingState = value
+ }
}
}