From c45ea1da7b8c37d4b185439c9a1705878ace3661 Mon Sep 17 00:00:00 2001
From: PKacprowiczS
Date: Tue, 2 Jun 2020 12:33:38 +0200
Subject: [PATCH 1/8] Changes to Stelpro preferences
---
.../stelpro-ki-thermostat.groovy | 38 ++++++++++--------
.../stelpro-ki-zigbee-thermostat.groovy | 37 ++++++++---------
.../stelpro-maestro-thermostat.groovy | 40 ++++++++++---------
3 files changed, 61 insertions(+), 54 deletions(-)
diff --git a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
index 21d0355b679..f10da77a382 100644
--- a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
@@ -50,11 +50,12 @@ metadata {
preferences {
section {
- input("heatdetails", "enum", title: "Do you want a detailed operating state notification?", options: ["No", "Yes"], defaultValue: "No", required: true, displayDuringSetup: true)
+ input("heatdetails", "enum", title: "Do you want to see detailed operating state events in the activity history? There may be many.", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true)
}
section {
- input title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing).", displayDuringSetup: false, type: "paragraph", element: "paragraph"
- input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "[Do not use space](Blank = No Forecast)")
+ input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing)." +
+ "Do not use space. If you don't want a forecast, leave it blank.", displayDuringSetup: false, type: "paragraph", element: "paragraph")
+ input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "")
}
}
@@ -101,7 +102,7 @@ metadata {
[value: 84, color: "#f1d801"],
[value: 95, color: "#d04e00"],
[value: 96, color: "#bc2323"]
- ]
+ ]
}
standardTile("temperatureAlarm", "device.temperatureAlarm", decoration: "flat", width: 2, height: 2) {
state "default", label: 'No Alarm', icon: "st.alarm.temperature.normal", backgroundColor: "#ffffff"
@@ -201,7 +202,7 @@ def parse(String description) {
value: map.value,
unit: map.unit,
data: [thermostatSetpointRange: thermostatSetpointRange]
- ])
+ ])
}
log.debug "Parse returned $result"
@@ -279,7 +280,7 @@ def poll() {
zwave.thermostatModeV2.thermostatModeGet().format(),
zwave.thermostatSetpointV2.thermostatSetpointGet(setpointType: 1).format(),
zwave.sensorMultilevelV3.sensorMultilevelGet().format() // current temperature
- ], 100)
+ ], 100)
}
// Event Generation
@@ -290,7 +291,7 @@ def zwaveEvent(thermostatsetpointv2.ThermostatSetpointReport cmd) {
def map = [:]
if (cmd.scaledValue >= 327 ||
- cmd.setpointType != thermostatsetpointv2.ThermostatSetpointReport.SETPOINT_TYPE_HEATING_1) {
+ cmd.setpointType != thermostatsetpointv2.ThermostatSetpointReport.SETPOINT_TYPE_HEATING_1) {
return [:]
}
temp = convertTemperatureIfNeeded(cmd.scaledValue, cmdScale, cmd.precision)
@@ -365,9 +366,12 @@ def zwaveEvent(thermostatoperatingstatev1.ThermostatOperatingStateReport cmd) {
if (operatingState) {
map.name = "thermostatOperatingState"
map.value = operatingState
-
- if (settings.heatdetails == "No") {
- map.displayed = false
+ map.displayed = false
+ // If the user want to see each of the Idle and Heating events in the event history,
+ // Otherwise don't show them more frequently than 5 minutes.
+ if (settings.heatdetails == "Yes" ||
+ !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
+ map.displayed = true
}
} else {
log.trace "${device.displayName} sent invalid operating state $value"
@@ -393,9 +397,9 @@ def zwaveEvent(thermostatmodev2.ThermostatModeReport cmd) {
def zwaveEvent(associationv2.AssociationReport cmd) {
delayBetween([
- zwave.associationV1.associationRemove(groupingIdentifier:1, nodeId:0).format(),
- zwave.associationV1.associationSet(groupingIdentifier:1, nodeId:[zwaveHubNodeId]).format(),
- poll()
+ zwave.associationV1.associationRemove(groupingIdentifier:1, nodeId:0).format(),
+ zwave.associationV1.associationSet(groupingIdentifier:1, nodeId:[zwaveHubNodeId]).format(),
+ poll()
], 2300)
}
@@ -441,8 +445,8 @@ def setHeatingSetpoint(preciseDegrees) {
}
delayBetween([
- zwave.thermostatSetpointV2.thermostatSetpointSet(setpointType: setpointType, scale: deviceScale, precision: p, scaledValue: convertedDegrees).format(),
- zwave.thermostatSetpointV2.thermostatSetpointGet(setpointType: setpointType).format()
+ zwave.thermostatSetpointV2.thermostatSetpointSet(setpointType: setpointType, scale: deviceScale, precision: p, scaledValue: convertedDegrees).format(),
+ zwave.thermostatSetpointV2.thermostatSetpointGet(setpointType: setpointType).format()
], 1000)
} else {
log.debug "heatingSetpoint $preciseDegrees out of range! (supported: $minSetpoint - $maxSetpoint ${getTemperatureScale()})"
@@ -533,8 +537,8 @@ def cool() {
def setThermostatMode(value) {
if (supportedThermostatModes.contains(value)) {
delayBetween([
- zwave.thermostatModeV2.thermostatModeSet(mode: modeNumericMap[value]).format(),
- zwave.thermostatModeV2.thermostatModeGet().format()
+ zwave.thermostatModeV2.thermostatModeSet(mode: modeNumericMap[value]).format(),
+ zwave.thermostatModeV2.thermostatModeGet().format()
], 1000)
} else {
log.trace "${device.displayName} does not support $value mode"
diff --git a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
index 997addd618b..8d38414e748 100644
--- a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
@@ -53,11 +53,12 @@ metadata {
preferences {
section {
input("lock", "enum", title: "Do you want to lock your thermostat's physical keypad?", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: false)
- input("heatdetails", "enum", title: "Do you want a detailed operating state notification?", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true)
+ input("heatdetails", "enum", title: "Do you want to see detailed operating state events in the activity history? There may be many.", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true)
}
section {
- input title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing).", displayDuringSetup: false, type: "paragraph", element: "paragraph"
- input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "[Do not use space](Blank = No Forecast)")
+ input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing)." +
+ "Do not use space. If you don't want a forecast, leave it blank.", displayDuringSetup: false, type: "paragraph", element: "paragraph")
+ input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "")
}
}
@@ -106,7 +107,7 @@ metadata {
[value: 84, color: "#f1d801"],
[value: 95, color: "#d04e00"],
[value: 96, color: "#bc2323"]
- ]
+ ]
}
standardTile("temperatureAlarm", "device.temperatureAlarm", decoration: "flat", width: 2, height: 2) {
state "default", label: 'No Alarm', icon: "st.alarm.temperature.normal", backgroundColor: "#ffffff"
@@ -163,9 +164,9 @@ def getSetpointStep() {
}
def getModeMap() {[
- "00":"off",
- "04":"heat",
- "05":"eco"
+ "00":"off",
+ "04":"heat",
+ "05":"eco"
]}
def setupHealthCheck() {
@@ -221,7 +222,7 @@ def parameterSetting() {
if (valid_lock) {
log.debug "lock valid"
zigbee.writeAttribute(THERMOSTAT_UI_CONFIG_CLUSTER, ATTRIBUTE_KEYPAD_LOCKOUT, DataType.ENUM8, lockmode) +
- poll()
+ poll()
} else {
log.debug "nothing valid"
}
@@ -306,12 +307,12 @@ def parse(String description) {
} else {
map.value = "heating"
}
-
- // If the user does not want to see the Idle and Heating events in the event history,
- // don't show them. Otherwise, don't show them more frequently than 30 seconds.
- if (settings.heatdetails == "No" ||
- !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 30)) {
- map.displayed = false
+ map.displayed = false
+ // If the user want to see each of the Idle and Heating events in the event history,
+ // Otherwise don't show them more frequently than 5 minutes.
+ if (settings.heatdetails == "Yes" ||
+ !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
+ map.displayed = true
}
map = validateOperatingStateBugfix(map)
// Check to see if this was changed, if so make sure we have the correct heating setpoint
@@ -549,8 +550,8 @@ def setHeatingSetpoint(preciseDegrees) {
log.debug "setHeatingSetpoint({$degrees} ${temperatureScale})"
zigbee.writeAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_HEAT_SETPOINT, DataType.INT16, zigbee.convertToHexString(celsius * 100, 4)) +
- zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_HEAT_SETPOINT) +
- zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_PI_HEATING_STATE)
+ zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_HEAT_SETPOINT) +
+ zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_PI_HEATING_STATE)
} else {
log.debug "heatingSetpoint $preciseDegrees out of range! (supported: $minSetpoint - $maxSetpoint ${getTemperatureScale()})"
}
@@ -614,8 +615,8 @@ def setThermostatMode(value) {
}
zigbee.writeAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_SYSTEM_MODE, DataType.ENUM8, modeNumber) +
- zigbee.writeAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_MFR_SPEC_SETPOINT_MODE, DataType.ENUM8, setpointModeNumber, ["mfgCode": "0x1185"]) +
- poll()
+ zigbee.writeAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_MFR_SPEC_SETPOINT_MODE, DataType.ENUM8, setpointModeNumber, ["mfgCode": "0x1185"]) +
+ poll()
} else {
log.debug "Invalid thermostat mode $value"
}
diff --git a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
index 0a316f4de85..ceacd32dabf 100644
--- a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
@@ -54,11 +54,12 @@ metadata {
preferences {
section {
input("lock", "enum", title: "Do you want to lock your thermostat's physical keypad?", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: false)
- input("heatdetails", "enum", title: "Do you want a detailed operating state notification?", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true)
+ input("heatdetails", "enum", title: "Do you want to see detailed operating state events in the activity history? There may be many.", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true)
}
section {
- input title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing).", displayDuringSetup: false, type: "paragraph", element: "paragraph"
- input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "[Do not use space](Blank = No Forecast)")
+ input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing)." +
+ "Do not use space. If you don't want a forecast, leave it blank.", displayDuringSetup: false, type: "paragraph", element: "paragraph")
+ input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "")
}
/*
input("away_setpoint", "enum", title: "Away setpoint", options: ["5", "5.5", "6", "6.5", "7", "7.5", "8", "8.5", "9", "9.5", "10", "10.5", "11", "11.5", "12", "12.5", "13", "13.5", "14", "14.5", "15", "5.5", "15.5", "16", "16.5", "17", "17.5", "18", "18.5", "19", "19.5", "20", "20.5", "21", "21.5", "22", "22.5", "23", "24", "24.5", "25", "25.5", "26", "26.5", "27", "27.5", "28", "28.5", "29", "29.5", "30"], defaultValue: "21", required: true)
@@ -122,7 +123,7 @@ metadata {
[value: 84, color: "#f1d801"],
[value: 95, color: "#d04e00"],
[value: 96, color: "#bc2323"]
- ]
+ ]
}
standardTile("temperatureAlarm", "device.temperatureAlarm", decoration: "flat", width: 2, height: 2) {
state "default", label: 'No Alarm', icon: "st.alarm.temperature.normal", backgroundColor: "#ffffff"
@@ -233,7 +234,7 @@ def parameterSetting() {
if (valid_lock) {
log.debug "lock valid"
zigbee.writeAttribute(THERMOSTAT_UI_CONFIG_CLUSTER, ATTRIBUTE_KEYPAD_LOCKOUT, DataType.ENUM8, lockmode) +
- poll()
+ poll()
} else {
log.debug "nothing valid"
}
@@ -278,11 +279,12 @@ def parse(String description) {
map.value = "heating"
}
- // If the user does not want to see the Idle and Heating events in the event history,
- // don't show them. Otherwise, don't show them more frequently than 30 seconds.
- if (settings.heatdetails == "No" ||
- !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 30)) {
- map.displayed = false
+ map.displayed = false
+ // If the user want to see each of the Idle and Heating events in the event history,
+ // Otherwise don't show them more frequently than 5 minutes.
+ if (settings.heatdetails == "Yes" ||
+ !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
+ map.displayed = true
}
}
} else if (descMap.clusterInt == zigbee.RELATIVE_HUMIDITY_CLUSTER) {
@@ -349,12 +351,12 @@ def handleTemperature(descMap) {
if ((lastAlarm == "freeze" &&
map.value > FREEZE_ALARM_TEMP &&
lastTemp < map.value) ||
- (lastAlarm == "heat" &&
- map.value < HEAT_ALARM_TEMP &&
- lastTemp > map.value)) {
- log.debug "Clearing $lastAlarm temp alarm"
- sendEvent(name: "temperatureAlarm", value: "cleared")
- cleared = true
+ (lastAlarm == "heat" &&
+ map.value < HEAT_ALARM_TEMP &&
+ lastTemp > map.value)) {
+ log.debug "Clearing $lastAlarm temp alarm"
+ sendEvent(name: "temperatureAlarm", value: "cleared")
+ cleared = true
}
}
@@ -362,7 +364,7 @@ def handleTemperature(descMap) {
// just mask it.
if (!cleared &&
((lastAlarm == "freeze" && map.value > FREEZE_ALARM_TEMP) ||
- (lastAlarm == "heat" && map.value < HEAT_ALARM_TEMP))) {
+ (lastAlarm == "heat" && map.value < HEAT_ALARM_TEMP))) {
log.debug "Hiding stale temperature ${map.value} because of ${lastAlarm} alarm"
map.value = (lastAlarm == "freeze") ? FREEZE_ALARM_TEMP : HEAT_ALARM_TEMP
}
@@ -503,8 +505,8 @@ def setHeatingSetpoint(preciseDegrees) {
log.debug "setHeatingSetpoint({$degrees} ${temperatureScale})"
zigbee.writeAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_HEAT_SETPOINT, DataType.INT16, zigbee.convertToHexString(celsius * 100, 4)) +
- zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_HEAT_SETPOINT) +
- zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_PI_HEATING_STATE)
+ zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_HEAT_SETPOINT) +
+ zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_PI_HEATING_STATE)
} else {
log.debug "heatingSetpoint $preciseDegrees out of range! (supported: $minSetpoint - $maxSetpoint ${getTemperatureScale()})"
}
From 3143e9e02374b0fa0315354ce5a3f9d527edec24 Mon Sep 17 00:00:00 2001
From: PKacprowiczS
Date: Tue, 2 Jun 2020 13:34:30 +0200
Subject: [PATCH 2/8] fixup! Changes to Stelpro preferences
---
.../stelpro-ki-thermostat.groovy | 20 ++++++++---------
.../stelpro-ki-zigbee-thermostat.groovy | 18 +++++++--------
.../stelpro-maestro-thermostat.groovy | 22 +++++++++----------
3 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
index f10da77a382..4e01be1b9d0 100644
--- a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
@@ -102,7 +102,7 @@ metadata {
[value: 84, color: "#f1d801"],
[value: 95, color: "#d04e00"],
[value: 96, color: "#bc2323"]
- ]
+ ]
}
standardTile("temperatureAlarm", "device.temperatureAlarm", decoration: "flat", width: 2, height: 2) {
state "default", label: 'No Alarm', icon: "st.alarm.temperature.normal", backgroundColor: "#ffffff"
@@ -202,7 +202,7 @@ def parse(String description) {
value: map.value,
unit: map.unit,
data: [thermostatSetpointRange: thermostatSetpointRange]
- ])
+ ])
}
log.debug "Parse returned $result"
@@ -280,7 +280,7 @@ def poll() {
zwave.thermostatModeV2.thermostatModeGet().format(),
zwave.thermostatSetpointV2.thermostatSetpointGet(setpointType: 1).format(),
zwave.sensorMultilevelV3.sensorMultilevelGet().format() // current temperature
- ], 100)
+ ], 100)
}
// Event Generation
@@ -397,9 +397,9 @@ def zwaveEvent(thermostatmodev2.ThermostatModeReport cmd) {
def zwaveEvent(associationv2.AssociationReport cmd) {
delayBetween([
- zwave.associationV1.associationRemove(groupingIdentifier:1, nodeId:0).format(),
- zwave.associationV1.associationSet(groupingIdentifier:1, nodeId:[zwaveHubNodeId]).format(),
- poll()
+ zwave.associationV1.associationRemove(groupingIdentifier:1, nodeId:0).format(),
+ zwave.associationV1.associationSet(groupingIdentifier:1, nodeId:[zwaveHubNodeId]).format(),
+ poll()
], 2300)
}
@@ -445,8 +445,8 @@ def setHeatingSetpoint(preciseDegrees) {
}
delayBetween([
- zwave.thermostatSetpointV2.thermostatSetpointSet(setpointType: setpointType, scale: deviceScale, precision: p, scaledValue: convertedDegrees).format(),
- zwave.thermostatSetpointV2.thermostatSetpointGet(setpointType: setpointType).format()
+ zwave.thermostatSetpointV2.thermostatSetpointSet(setpointType: setpointType, scale: deviceScale, precision: p, scaledValue: convertedDegrees).format(),
+ zwave.thermostatSetpointV2.thermostatSetpointGet(setpointType: setpointType).format()
], 1000)
} else {
log.debug "heatingSetpoint $preciseDegrees out of range! (supported: $minSetpoint - $maxSetpoint ${getTemperatureScale()})"
@@ -537,8 +537,8 @@ def cool() {
def setThermostatMode(value) {
if (supportedThermostatModes.contains(value)) {
delayBetween([
- zwave.thermostatModeV2.thermostatModeSet(mode: modeNumericMap[value]).format(),
- zwave.thermostatModeV2.thermostatModeGet().format()
+ zwave.thermostatModeV2.thermostatModeSet(mode: modeNumericMap[value]).format(),
+ zwave.thermostatModeV2.thermostatModeGet().format()
], 1000)
} else {
log.trace "${device.displayName} does not support $value mode"
diff --git a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
index 8d38414e748..a6260f38d92 100644
--- a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
@@ -107,7 +107,7 @@ metadata {
[value: 84, color: "#f1d801"],
[value: 95, color: "#d04e00"],
[value: 96, color: "#bc2323"]
- ]
+ ]
}
standardTile("temperatureAlarm", "device.temperatureAlarm", decoration: "flat", width: 2, height: 2) {
state "default", label: 'No Alarm', icon: "st.alarm.temperature.normal", backgroundColor: "#ffffff"
@@ -164,9 +164,9 @@ def getSetpointStep() {
}
def getModeMap() {[
- "00":"off",
- "04":"heat",
- "05":"eco"
+ "00":"off",
+ "04":"heat",
+ "05":"eco"
]}
def setupHealthCheck() {
@@ -222,7 +222,7 @@ def parameterSetting() {
if (valid_lock) {
log.debug "lock valid"
zigbee.writeAttribute(THERMOSTAT_UI_CONFIG_CLUSTER, ATTRIBUTE_KEYPAD_LOCKOUT, DataType.ENUM8, lockmode) +
- poll()
+ poll()
} else {
log.debug "nothing valid"
}
@@ -550,8 +550,8 @@ def setHeatingSetpoint(preciseDegrees) {
log.debug "setHeatingSetpoint({$degrees} ${temperatureScale})"
zigbee.writeAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_HEAT_SETPOINT, DataType.INT16, zigbee.convertToHexString(celsius * 100, 4)) +
- zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_HEAT_SETPOINT) +
- zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_PI_HEATING_STATE)
+ zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_HEAT_SETPOINT) +
+ zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_PI_HEATING_STATE)
} else {
log.debug "heatingSetpoint $preciseDegrees out of range! (supported: $minSetpoint - $maxSetpoint ${getTemperatureScale()})"
}
@@ -615,8 +615,8 @@ def setThermostatMode(value) {
}
zigbee.writeAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_SYSTEM_MODE, DataType.ENUM8, modeNumber) +
- zigbee.writeAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_MFR_SPEC_SETPOINT_MODE, DataType.ENUM8, setpointModeNumber, ["mfgCode": "0x1185"]) +
- poll()
+ zigbee.writeAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_MFR_SPEC_SETPOINT_MODE, DataType.ENUM8, setpointModeNumber, ["mfgCode": "0x1185"]) +
+ poll()
} else {
log.debug "Invalid thermostat mode $value"
}
diff --git a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
index ceacd32dabf..6afafc842a3 100644
--- a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
@@ -123,7 +123,7 @@ metadata {
[value: 84, color: "#f1d801"],
[value: 95, color: "#d04e00"],
[value: 96, color: "#bc2323"]
- ]
+ ]
}
standardTile("temperatureAlarm", "device.temperatureAlarm", decoration: "flat", width: 2, height: 2) {
state "default", label: 'No Alarm', icon: "st.alarm.temperature.normal", backgroundColor: "#ffffff"
@@ -234,7 +234,7 @@ def parameterSetting() {
if (valid_lock) {
log.debug "lock valid"
zigbee.writeAttribute(THERMOSTAT_UI_CONFIG_CLUSTER, ATTRIBUTE_KEYPAD_LOCKOUT, DataType.ENUM8, lockmode) +
- poll()
+ poll()
} else {
log.debug "nothing valid"
}
@@ -351,12 +351,12 @@ def handleTemperature(descMap) {
if ((lastAlarm == "freeze" &&
map.value > FREEZE_ALARM_TEMP &&
lastTemp < map.value) ||
- (lastAlarm == "heat" &&
- map.value < HEAT_ALARM_TEMP &&
- lastTemp > map.value)) {
- log.debug "Clearing $lastAlarm temp alarm"
- sendEvent(name: "temperatureAlarm", value: "cleared")
- cleared = true
+ (lastAlarm == "heat" &&
+ map.value < HEAT_ALARM_TEMP &&
+ lastTemp > map.value)) {
+ log.debug "Clearing $lastAlarm temp alarm"
+ sendEvent(name: "temperatureAlarm", value: "cleared")
+ cleared = true
}
}
@@ -364,7 +364,7 @@ def handleTemperature(descMap) {
// just mask it.
if (!cleared &&
((lastAlarm == "freeze" && map.value > FREEZE_ALARM_TEMP) ||
- (lastAlarm == "heat" && map.value < HEAT_ALARM_TEMP))) {
+ (lastAlarm == "heat" && map.value < HEAT_ALARM_TEMP))) {
log.debug "Hiding stale temperature ${map.value} because of ${lastAlarm} alarm"
map.value = (lastAlarm == "freeze") ? FREEZE_ALARM_TEMP : HEAT_ALARM_TEMP
}
@@ -505,8 +505,8 @@ def setHeatingSetpoint(preciseDegrees) {
log.debug "setHeatingSetpoint({$degrees} ${temperatureScale})"
zigbee.writeAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_HEAT_SETPOINT, DataType.INT16, zigbee.convertToHexString(celsius * 100, 4)) +
- zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_HEAT_SETPOINT) +
- zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_PI_HEATING_STATE)
+ zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_HEAT_SETPOINT) +
+ zigbee.readAttribute(THERMOSTAT_CLUSTER, ATTRIBUTE_PI_HEATING_STATE)
} else {
log.debug "heatingSetpoint $preciseDegrees out of range! (supported: $minSetpoint - $maxSetpoint ${getTemperatureScale()})"
}
From d8f6136d1002adc50707c093424f6ef2efd631de Mon Sep 17 00:00:00 2001
From: Przemyslaw Kacprowicz
Date: Thu, 4 Jun 2020 11:52:21 +0200
Subject: [PATCH 3/8] Copied 'secondsPast' method from another DTH.
---
.../stelpro-ki-thermostat.groovy | 26 +++++++++++++++++--
.../stelpro-ki-zigbee-thermostat.groovy | 4 +--
.../stelpro-maestro-thermostat.groovy | 4 +--
3 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
index 4e01be1b9d0..be403666fa9 100644
--- a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
@@ -53,8 +53,8 @@ metadata {
input("heatdetails", "enum", title: "Do you want to see detailed operating state events in the activity history? There may be many.", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true)
}
section {
- input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing)." +
- "Do not use space. If you don't want a forecast, leave it blank.", displayDuringSetup: false, type: "paragraph", element: "paragraph")
+ input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing). Do not use space. If you don't want a forecast, leave it blank.",
+ displayDuringSetup: false, type: "paragraph", element: "paragraph")
input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "")
}
}
@@ -560,3 +560,25 @@ def fanCirculate() {
def setThermostatFanMode() {
log.trace "${device.displayName} does not support fan mode"
}
+
+/**
+ * Checks if the time elapsed from the provided timestamp is greater than the number of senconds provided
+ *
+ * @param timestamp: The timestamp
+ *
+ * @param seconds: The number of seconds
+ *
+ * @returns true if elapsed time is greater than number of seconds provided, else false
+ */
+private Boolean secondsPast(timestamp, seconds) {
+ if (!(timestamp instanceof Number)) {
+ if (timestamp instanceof Date) {
+ timestamp = timestamp.time
+ } else if ((timestamp instanceof String) && timestamp.isNumber()) {
+ timestamp = timestamp.toLong()
+ } else {
+ return true
+ }
+ }
+ return (now() - timestamp) > (seconds * 1000)
+}
\ No newline at end of file
diff --git a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
index a6260f38d92..3b1a55cb220 100644
--- a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
@@ -56,8 +56,8 @@ metadata {
input("heatdetails", "enum", title: "Do you want to see detailed operating state events in the activity history? There may be many.", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true)
}
section {
- input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing)." +
- "Do not use space. If you don't want a forecast, leave it blank.", displayDuringSetup: false, type: "paragraph", element: "paragraph")
+ input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing). Do not use space. If you don't want a forecast, leave it blank.",
+ displayDuringSetup: false, type: "paragraph", element: "paragraph")
input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "")
}
}
diff --git a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
index 6afafc842a3..442eb831a2a 100644
--- a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
@@ -57,8 +57,8 @@ metadata {
input("heatdetails", "enum", title: "Do you want to see detailed operating state events in the activity history? There may be many.", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true)
}
section {
- input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing)." +
- "Do not use space. If you don't want a forecast, leave it blank.", displayDuringSetup: false, type: "paragraph", element: "paragraph")
+ input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing). Do not use space. If you don't want a forecast, leave it blank.",
+ displayDuringSetup: false, type: "paragraph", element: "paragraph")
input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "")
}
/*
From 2f659a661c5935ccc2063979b46d20832ad48669 Mon Sep 17 00:00:00 2001
From: PKacprowiczS
Date: Tue, 7 Jul 2020 16:24:59 +0200
Subject: [PATCH 4/8] Switched back to old logic, with new preference
description and events time inverval
---
.../stelpro-ki-thermostat.groovy | 31 ++++++++++++++++---
.../stelpro-ki-zigbee-thermostat.groovy | 9 +++---
.../stelpro-maestro-thermostat.groovy | 10 +++---
3 files changed, 34 insertions(+), 16 deletions(-)
diff --git a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
index 4e01be1b9d0..1ae51df8b74 100644
--- a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
@@ -53,8 +53,7 @@ metadata {
input("heatdetails", "enum", title: "Do you want to see detailed operating state events in the activity history? There may be many.", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true)
}
section {
- input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing)." +
- "Do not use space. If you don't want a forecast, leave it blank.", displayDuringSetup: false, type: "paragraph", element: "paragraph")
+ input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing). Do not use space. If you don't want a forecast, leave it blank.", displayDuringSetup: false, type: "paragraph", element: "paragraph")
input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "")
}
}
@@ -366,12 +365,12 @@ def zwaveEvent(thermostatoperatingstatev1.ThermostatOperatingStateReport cmd) {
if (operatingState) {
map.name = "thermostatOperatingState"
map.value = operatingState
- map.displayed = false
+
// If the user want to see each of the Idle and Heating events in the event history,
// Otherwise don't show them more frequently than 5 minutes.
- if (settings.heatdetails == "Yes" ||
+ if (settings.heatdetails == "No" ||
!secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
- map.displayed = true
+ map.displayed = false
}
} else {
log.trace "${device.displayName} sent invalid operating state $value"
@@ -560,3 +559,25 @@ def fanCirculate() {
def setThermostatFanMode() {
log.trace "${device.displayName} does not support fan mode"
}
+
+/**
+ * Checks if the time elapsed from the provided timestamp is greater than the number of senconds provided
+ *
+ * @param timestamp: The timestamp
+ *
+ * @param seconds: The number of seconds
+ *
+ * @returns true if elapsed time is greater than number of seconds provided, else false
+ */
+private Boolean secondsPast(timestamp, seconds) {
+ if (!(timestamp instanceof Number)) {
+ if (timestamp instanceof Date) {
+ timestamp = timestamp.time
+ } else if ((timestamp instanceof String) && timestamp.isNumber()) {
+ timestamp = timestamp.toLong()
+ } else {
+ return true
+ }
+ }
+ return (now() - timestamp) > (seconds * 1000)
+}
diff --git a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
index a6260f38d92..0cf60f014d8 100644
--- a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
@@ -56,8 +56,7 @@ metadata {
input("heatdetails", "enum", title: "Do you want to see detailed operating state events in the activity history? There may be many.", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true)
}
section {
- input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing)." +
- "Do not use space. If you don't want a forecast, leave it blank.", displayDuringSetup: false, type: "paragraph", element: "paragraph")
+ input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing). Do not use space. If you don't want a forecast, leave it blank.", displayDuringSetup: false, type: "paragraph", element: "paragraph")
input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "")
}
}
@@ -307,12 +306,12 @@ def parse(String description) {
} else {
map.value = "heating"
}
- map.displayed = false
+
// If the user want to see each of the Idle and Heating events in the event history,
// Otherwise don't show them more frequently than 5 minutes.
- if (settings.heatdetails == "Yes" ||
+ if (settings.heatdetails == "No" ||
!secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
- map.displayed = true
+ map.displayed = false
}
map = validateOperatingStateBugfix(map)
// Check to see if this was changed, if so make sure we have the correct heating setpoint
diff --git a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
index 6afafc842a3..bed733b0a26 100644
--- a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
@@ -57,8 +57,7 @@ metadata {
input("heatdetails", "enum", title: "Do you want to see detailed operating state events in the activity history? There may be many.", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true)
}
section {
- input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing)." +
- "Do not use space. If you don't want a forecast, leave it blank.", displayDuringSetup: false, type: "paragraph", element: "paragraph")
+ input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing). Do not use space. If you don't want a forecast, leave it blank.", displayDuringSetup: false, type: "paragraph", element: "paragraph")
input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "")
}
/*
@@ -279,12 +278,11 @@ def parse(String description) {
map.value = "heating"
}
- map.displayed = false
// If the user want to see each of the Idle and Heating events in the event history,
// Otherwise don't show them more frequently than 5 minutes.
- if (settings.heatdetails == "Yes" ||
+ if (settings.heatdetails == "No" ||
!secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
- map.displayed = true
+ map.displayed = false
}
}
} else if (descMap.clusterInt == zigbee.RELATIVE_HUMIDITY_CLUSTER) {
@@ -364,7 +362,7 @@ def handleTemperature(descMap) {
// just mask it.
if (!cleared &&
((lastAlarm == "freeze" && map.value > FREEZE_ALARM_TEMP) ||
- (lastAlarm == "heat" && map.value < HEAT_ALARM_TEMP))) {
+ (lastAlarm == "heat" && map.value < HEAT_ALARM_TEMP))) {
log.debug "Hiding stale temperature ${map.value} because of ${lastAlarm} alarm"
map.value = (lastAlarm == "freeze") ? FREEZE_ALARM_TEMP : HEAT_ALARM_TEMP
}
From 7077e0e2e36baf25fd1ed4d403881b88b3847192 Mon Sep 17 00:00:00 2001
From: Przemyslaw Kacprowicz
Date: Thu, 9 Jul 2020 08:10:53 +0200
Subject: [PATCH 5/8] Forcing to show every changig current state event
---
.../stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy | 5 +++--
.../stelpro-ki-zigbee-thermostat.groovy | 5 +++--
.../stelpro-maestro-thermostat.groovy | 5 +++--
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
index b3ec059bfa0..82ba785d155 100644
--- a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
@@ -369,8 +369,9 @@ def zwaveEvent(thermostatoperatingstatev1.ThermostatOperatingStateReport cmd) {
// If the user want to see each of the Idle and Heating events in the event history,
// Otherwise don't show them more frequently than 5 minutes.
- if (settings.heatdetails == "No" ||
- !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
+ if ((settings.heatdetails == "No" ||
+ !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) &&
+ device.currentState("thermostatOperatingState").value == map.value) {
map.displayed = false
}
} else {
diff --git a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
index 0c89dbdc41c..d0cac9412d7 100644
--- a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
@@ -309,8 +309,9 @@ def parse(String description) {
// If the user want to see each of the Idle and Heating events in the event history,
// Otherwise don't show them more frequently than 5 minutes.
- if (settings.heatdetails == "No" ||
- !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
+ if ((settings.heatdetails == "No" ||
+ !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) &&
+ device.currentState("thermostatOperatingState").value == map.value) {
map.displayed = false
}
map = validateOperatingStateBugfix(map)
diff --git a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
index 3f5985f594e..5ae1efefab6 100644
--- a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
@@ -280,8 +280,9 @@ def parse(String description) {
// If the user want to see each of the Idle and Heating events in the event history,
// Otherwise don't show them more frequently than 5 minutes.
- if (settings.heatdetails == "No" ||
- !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
+ if ((settings.heatdetails == "No" ||
+ !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) &&
+ device.currentState("thermostatOperatingState").value == map.value) {
map.displayed = false
}
}
From a9eaeafec48a97424ea38e978d7ae364a7810d88 Mon Sep 17 00:00:00 2001
From: Przemyslaw Kacprowicz
Date: Tue, 14 Jul 2020 15:09:25 +0200
Subject: [PATCH 6/8] Revert "Forcing to show every changig current state
event"
This reverts commit 7077e0e2e36baf25fd1ed4d403881b88b3847192.
---
.../stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy | 5 ++---
.../stelpro-ki-zigbee-thermostat.groovy | 5 ++---
.../stelpro-maestro-thermostat.groovy | 5 ++---
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
index 82ba785d155..b3ec059bfa0 100644
--- a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
@@ -369,9 +369,8 @@ def zwaveEvent(thermostatoperatingstatev1.ThermostatOperatingStateReport cmd) {
// If the user want to see each of the Idle and Heating events in the event history,
// Otherwise don't show them more frequently than 5 minutes.
- if ((settings.heatdetails == "No" ||
- !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) &&
- device.currentState("thermostatOperatingState").value == map.value) {
+ if (settings.heatdetails == "No" ||
+ !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
map.displayed = false
}
} else {
diff --git a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
index d0cac9412d7..0c89dbdc41c 100644
--- a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
@@ -309,9 +309,8 @@ def parse(String description) {
// If the user want to see each of the Idle and Heating events in the event history,
// Otherwise don't show them more frequently than 5 minutes.
- if ((settings.heatdetails == "No" ||
- !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) &&
- device.currentState("thermostatOperatingState").value == map.value) {
+ if (settings.heatdetails == "No" ||
+ !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
map.displayed = false
}
map = validateOperatingStateBugfix(map)
diff --git a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
index 5ae1efefab6..3f5985f594e 100644
--- a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
@@ -280,9 +280,8 @@ def parse(String description) {
// If the user want to see each of the Idle and Heating events in the event history,
// Otherwise don't show them more frequently than 5 minutes.
- if ((settings.heatdetails == "No" ||
- !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) &&
- device.currentState("thermostatOperatingState").value == map.value) {
+ if (settings.heatdetails == "No" ||
+ !secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
map.displayed = false
}
}
From c798dc72b2c2fc28d0f7d98c810e293f440d87b5 Mon Sep 17 00:00:00 2001
From: PKacprowiczS
Date: Wed, 15 Jul 2020 12:40:14 +0200
Subject: [PATCH 7/8] Minor fixes
---
.../stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy | 4 ++--
.../stelpro-ki-zigbee-thermostat.groovy | 7 ++++---
.../stelpro-maestro-thermostat.groovy | 7 ++++---
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
index b3ec059bfa0..158e983b2fb 100644
--- a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
@@ -367,8 +367,8 @@ def zwaveEvent(thermostatoperatingstatev1.ThermostatOperatingStateReport cmd) {
map.name = "thermostatOperatingState"
map.value = operatingState
- // If the user want to see each of the Idle and Heating events in the event history,
- // Otherwise don't show them more frequently than 5 minutes.
+ // If the user wants to see each of the Idle and Heating events in the event history,
+ // otherwise don't show them more frequently than 5 minutes.
if (settings.heatdetails == "No" ||
!secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
map.displayed = false
diff --git a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
index 0c89dbdc41c..6aa85d3f7b9 100644
--- a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
@@ -55,7 +55,8 @@ metadata {
input("lock", "enum", title: "Do you want to lock your thermostat's physical keypad?", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: false)
input("heatdetails", "enum", title: "Do you want to see detailed operating state events in the activity history? There may be many.", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true)
}
- section {input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing). Do not use space. If you don't want a forecast, leave it blank.",
+ section {
+ input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing). Do not use space. If you don't want a forecast, leave it blank.",
displayDuringSetup: false, type: "paragraph", element: "paragraph")
input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "")
}
@@ -307,8 +308,8 @@ def parse(String description) {
map.value = "heating"
}
- // If the user want to see each of the Idle and Heating events in the event history,
- // Otherwise don't show them more frequently than 5 minutes.
+ // If the user wants to see each of the Idle and Heating events in the event history,
+ // otherwise don't show them more frequently than 5 minutes.
if (settings.heatdetails == "No" ||
!secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
map.displayed = false
diff --git a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
index 3f5985f594e..c7e3e0791d9 100644
--- a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
@@ -56,7 +56,8 @@ metadata {
input("lock", "enum", title: "Do you want to lock your thermostat's physical keypad?", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: false)
input("heatdetails", "enum", title: "Do you want to see detailed operating state events in the activity history? There may be many.", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true)
}
- section {input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing). Do not use space. If you don't want a forecast, leave it blank.",
+ section {
+ input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing). Do not use space. If you don't want a forecast, leave it blank.",
displayDuringSetup: false, type: "paragraph", element: "paragraph")
input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "")
}
@@ -278,8 +279,8 @@ def parse(String description) {
map.value = "heating"
}
- // If the user want to see each of the Idle and Heating events in the event history,
- // Otherwise don't show them more frequently than 5 minutes.
+ // If the user wants to see each of the Idle and Heating events in the event history,
+ // otherwise don't show them more frequently than 5 minutes.
if (settings.heatdetails == "No" ||
!secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
map.displayed = false
From 7b401eb3733bb18203f4e6ec4045b41d00abc78c Mon Sep 17 00:00:00 2001
From: PKacprowiczS
Date: Wed, 15 Jul 2020 15:57:32 +0200
Subject: [PATCH 8/8] Comment change
---
.../stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy | 4 ++--
.../stelpro-ki-zigbee-thermostat.groovy | 4 ++--
.../stelpro-maestro-thermostat.groovy | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
index 158e983b2fb..5d5ad2e97c3 100644
--- a/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-thermostat.src/stelpro-ki-thermostat.groovy
@@ -367,8 +367,8 @@ def zwaveEvent(thermostatoperatingstatev1.ThermostatOperatingStateReport cmd) {
map.name = "thermostatOperatingState"
map.value = operatingState
- // If the user wants to see each of the Idle and Heating events in the event history,
- // otherwise don't show them more frequently than 5 minutes.
+ // If the user does not want to see the Idle and Heating events in the event history,
+ // don't show them. Otherwise, don't show them more frequently than 5 minutes.
if (settings.heatdetails == "No" ||
!secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
map.displayed = false
diff --git a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
index 6aa85d3f7b9..7be4b28616a 100644
--- a/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-ki-zigbee-thermostat.src/stelpro-ki-zigbee-thermostat.groovy
@@ -308,8 +308,8 @@ def parse(String description) {
map.value = "heating"
}
- // If the user wants to see each of the Idle and Heating events in the event history,
- // otherwise don't show them more frequently than 5 minutes.
+ // If the user does not want to see the Idle and Heating events in the event history,
+ // don't show them. Otherwise, don't show them more frequently than 5 minutes.
if (settings.heatdetails == "No" ||
!secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
map.displayed = false
diff --git a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
index c7e3e0791d9..59f1aae7773 100644
--- a/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
+++ b/devicetypes/stelpro/stelpro-maestro-thermostat.src/stelpro-maestro-thermostat.groovy
@@ -279,8 +279,8 @@ def parse(String description) {
map.value = "heating"
}
- // If the user wants to see each of the Idle and Heating events in the event history,
- // otherwise don't show them more frequently than 5 minutes.
+ // If the user does not want to see the Idle and Heating events in the event history,
+ // don't show them. Otherwise, don't show them more frequently than 5 minutes.
if (settings.heatdetails == "No" ||
!secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) {
map.displayed = false