Skip to content

Commit 0fc84da

Browse files
authored
Merge pull request SmartThingsCommunity#2594 from SmartThingsCommunity/staging
Rolling up staging to production
2 parents aba9cd9 + 7f83c5a commit 0fc84da

File tree

10 files changed

+574
-27
lines changed

10 files changed

+574
-27
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/**
2+
* Curb Power Meter
3+
*
4+
* Copyright 2017 Curb
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
7+
* in compliance with the License. You may obtain a copy of the License at:
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
12+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
13+
* for the specific language governing permissions and limitations under the License.
14+
*
15+
*/
16+
17+
metadata {
18+
definition(name: "CURB Power Meter", namespace: "curb", author: "Curb") {
19+
capability "Power Meter"
20+
capability "Energy Meter"
21+
}
22+
23+
tiles {
24+
multiAttributeTile(name: "power", type: "lighting", width: 2, height: 2, canChangeIcon: false) {
25+
tileAttribute("device.power", key: "PRIMARY_CONTROL") {
26+
attributeState "power",
27+
label: '${currentValue} W',
28+
icon: 'st.switches.switch.off',
29+
backgroundColors: [
30+
[value: -1000, color: "#25c100"],
31+
[value: -500, color: "#76ce61"],
32+
[value: -100, color: "#bbedaf"],
33+
[value: 0, color: "#bcbbb5"],
34+
[value: 100, color: "#efc621"],
35+
[value: 1000, color: "#ed8c25"],
36+
[value: 2000, color: "#db5e1f"]
37+
]
38+
}
39+
tileAttribute ("device.energy", key: "SECONDARY_CONTROL") {
40+
attributeState "energy", label:'${currentValue} kWh this billing period'
41+
}
42+
}
43+
main(["power"])
44+
details(["power", "energy"])
45+
}
46+
}
47+
48+
mappings {
49+
50+
}
51+
52+
def handlePower(value) {
53+
sendEvent(name: "power", value: value)
54+
}
55+
56+
def handleKwhBilling(kwh) {
57+
sendEvent(name: "energy", value: kwh.round(3))
58+
}

devicetypes/smartthings/aeon-siren.src/aeon-siren.groovy

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,23 @@ def updated() {
9797
def parse(String description) {
9898
log.debug "parse($description)"
9999
def result = null
100-
def cmd = zwave.parse(description, [0x98: 1, 0x20: 1, 0x70: 1])
101-
if (cmd) {
102-
result = zwaveEvent(cmd)
100+
if (description.startsWith("Err")) {
101+
if (state.sec) {
102+
result = createEvent(descriptionText:description, displayed:false)
103+
} else {
104+
result = createEvent(
105+
descriptionText: "This device failed to complete the network security key exchange. If you are unable to control it via SmartThings, you must remove it from your network and add it again.",
106+
eventType: "ALERT",
107+
name: "secureInclusion",
108+
value: "failed",
109+
displayed: true,
110+
)
111+
}
112+
} else {
113+
def cmd = zwave.parse(description, [0x98: 1, 0x20: 1, 0x70: 1])
114+
if (cmd) {
115+
result = zwaveEvent(cmd)
116+
}
103117
}
104118
log.debug "Parse returned ${result?.inspect()}"
105119
return result

devicetypes/smartthings/momentary-button-tile.src/momentary-button-tile.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ metadata {
3030

3131
// UI tile definitions
3232
tiles(scale: 2){
33-
multiAttributeTile(name:"switch", type: "generic", width: 6, height: 4){
33+
multiAttributeTile(name:"switch", type: "generic", width: 6, height: 4, canChangeIcon: true){
3434
tileAttribute("device.switch", key: "PRIMARY_CONTROL") {
3535
attributeState("off", label: 'Push', action: "momentary.push", backgroundColor: "#ffffff", nextState: "on")
3636
attributeState("on", label: 'Push', action: "momentary.push", backgroundColor: "#00a0dc")

devicetypes/smartthings/zigbee-lock.src/zigbee-lock.groovy

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ def reloadAllCodes() {
243243
sendEvent(lockCodesEvent(lockCodes))
244244
def cmds = validateAttributes()
245245
if (isYaleLock()) {
246-
state.checkCode = 1
246+
state.checkCode = state.checkCode ?: 1
247247
} else {
248-
state.checkCode = 0
248+
state.checkCode = state.checkCode ?: 0
249249
}
250250
cmds += requestCode(state.checkCode)
251251

@@ -729,10 +729,15 @@ private def parseCommandResponse(String description) {
729729
// This will be applicable when a slot is found occupied during scanning of lock
730730
// Populating the 'lockCodes' attribute after scanning a code slot
731731
log.debug "Scanning lock - code $codeID is occupied"
732-
responseMap.value = "$codeID set"
733-
responseMap.descriptionText = "${getStatusForDescription('set')} \"$codeName\""
732+
def changeType = getChangeType(lockCodes, codeID)
733+
responseMap.value = "$codeID $changeType"
734+
responseMap.descriptionText = "${getStatusForDescription(changeType)} \"$codeName\""
734735
responseMap.data = [ codeName: codeName ]
735-
result << codeSetEvent(lockCodes, codeID, codeName)
736+
if ("set" == changeType) {
737+
result << codeSetEvent(lockCodes, codeID, codeName)
738+
} else {
739+
responseMap.displayed = false
740+
}
736741
}
737742
} else {
738743
// Code slot is empty - can happen when code creation fails or a slot is empty while scanning the lock
@@ -759,7 +764,6 @@ private def parseCommandResponse(String description) {
759764
// Code slot is empty - can happen when a slot is found empty while scanning the lock
760765
responseMap.value = "$codeID unset"
761766
responseMap.descriptionText = "Code slot $codeID found empty during scanning"
762-
responseMap.isStateChange = false
763767
responseMap.displayed = false
764768
}
765769
}

devicetypes/smartthings/zwave-dimmer-switch-generic.src/zwave-dimmer-switch-generic.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*/
1414
metadata {
15-
definition (name: "Z-Wave Dimmer Switch Generic", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") {
15+
definition (name: "Z-Wave Dimmer Switch Generic", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light", runLocally: true, minHubCoreVersion: '000.019.00012', executeCommandsLocally: true) {
1616
capability "Switch Level"
1717
capability "Actuator"
1818
capability "Health Check"

devicetypes/smartthings/zwave-lock.src/zwave-lock.groovy

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -769,14 +769,14 @@ def zwaveEvent(UserCodeReport cmd) {
769769
} else {
770770
// We'll land here during scanning of codes
771771
codeName = getCodeName(lockCodes, codeID)
772+
def changeType = getChangeType(lockCodes, codeID)
772773
if (!lockCodes[codeID]) {
773-
map.value = "$codeID set"
774774
result << codeSetEvent(lockCodes, codeID, codeName)
775775
} else {
776-
map.value = "$codeID changed"
777-
map.isStateChange = false
776+
map.displayed = false
778777
}
779-
map.descriptionText = "${getStatusForDescription('set')} \"$codeName\""
778+
map.value = "$codeID $changeType"
779+
map.descriptionText = "${getStatusForDescription(changeType)} \"$codeName\""
780780
map.data = [ codeName: codeName, lockName: deviceName ]
781781
}
782782
} else if(userIdStatus == 254 && isSchlageLock()) {
@@ -806,7 +806,7 @@ def zwaveEvent(UserCodeReport cmd) {
806806
result << codeDeletedEvent(lockCodes, codeID)
807807
} else {
808808
map.value = "$codeID unset"
809-
map.isStateChange = false
809+
map.displayed = false
810810
map.data = [ lockName: deviceName ]
811811
}
812812
}
@@ -1184,7 +1184,7 @@ def reloadAllCodes() {
11841184
sendEvent(name: "scanCodes", value: "Scanning", descriptionText: "Code scan in progress", displayed: false)
11851185
def lockCodes = loadLockCodes()
11861186
sendEvent(lockCodesEvent(lockCodes))
1187-
state.checkCode = 1
1187+
state.checkCode = state.checkCode ?: 1
11881188

11891189
def cmds = []
11901190
// Not calling validateAttributes() here because userNumberGet command will be added twice
@@ -1196,7 +1196,7 @@ def reloadAllCodes() {
11961196
cmds << secure(zwave.userCodeV1.usersNumberGet())
11971197
} else {
11981198
sendEvent(name: "maxCodes", value: state.codes, displayed: false)
1199-
cmds << requestCode(1)
1199+
cmds << requestCode(state.checkCode)
12001200
}
12011201
if(cmds.size() > 1) {
12021202
cmds = delayBetween(cmds, 4200)

devicetypes/smartthings/zwave-relay.src/zwave-relay.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ metadata {
3737

3838
// tile definitions
3939
tiles(scale: 2){
40-
multiAttributeTile(name:"switch", type: "generic", width: 6, height: 4){
40+
multiAttributeTile(name:"switch", type: "generic", width: 6, height: 4, canChangeIcon: true){
4141
tileAttribute("device.switch", key: "PRIMARY_CONTROL") {
4242
attributeState("on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#00a0dc")
4343
attributeState("off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff")

devicetypes/smartthings/zwave-switch-generic.src/zwave-switch-generic.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*/
1414
metadata {
15-
definition (name: "Z-Wave Switch Generic", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") {
15+
definition (name: "Z-Wave Switch Generic", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch", runLocally: true, minHubCoreVersion: '000.019.00012', executeCommandsLocally: true) {
1616
capability "Actuator"
1717
capability "Health Check"
1818
capability "Switch"
@@ -64,6 +64,7 @@ metadata {
6464
def installed(){
6565
// Device-Watch simply pings if no device events received for checkInterval duration of 32min = 2 * 15min + 2min lag time
6666
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"])
67+
response(refresh())
6768
}
6869

6970
def updated(){

devicetypes/zenwithin/zen-thermostat.src/zen-thermostat.groovy

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Author: Zen Within
55
* Date: 2015-02-21
66
* Updated by SmartThings
7-
* Date: 2017-10-12
7+
* Date: 2017-11-12
88
*/
99
metadata {
1010
definition (name: "Zen Thermostat", namespace: "zenwithin", author: "ZenWithin") {
@@ -23,7 +23,7 @@ metadata {
2323
// To please some of the thermostat SmartApps
2424
command "poll"
2525

26-
fingerprint profileId: "0104", endpointId: "01", inClusters: "0000,0001,0003,0004,0005,0020,0201,0202,0204,0B05", outClusters: "000A, 0019", manufacturer: "Zen Within", model: "Zen-01", deviceJoinName: "Zen Thermostat"
26+
fingerprint profileId: "0104", endpointId: "01", inClusters: "0000,0001,0003,0004,0005,0020,0201,0202,0204,0B05", outClusters: "000A, 0019", manufacturer: "Zen Within", model: "Zen-01", deviceJoinName: "Zen Thermostat"
2727
}
2828

2929
tiles {
@@ -89,8 +89,12 @@ metadata {
8989
section {
9090
input("systemModes", "enum",
9191
title: "Thermostat configured modes\nSelect the modes the thermostat has been configured for, as displayed on the thermostat",
92-
description: "off, heat, cool", defaultValue: "1", required: true, multiple: false,
93-
options:["1":"off, heat, cool", "2":"off, auto, heat, cool", "3":"off, emergency heat, heat, cool"]
92+
description: "off, heat, cool", defaultValue: "3", required: true, multiple: false,
93+
options:["1":"off, heat",
94+
"2":"off, cool",
95+
"3":"off, heat, cool",
96+
"4":"off, auto, heat, cool",
97+
"5":"off, emergency heat, heat, cool"]
9498
)
9599
}
96100
}
@@ -126,9 +130,11 @@ def getSupportedModes() {
126130

127131
def getSupportedModesMap() {
128132
[
129-
"1":["off", "heat", "cool"],
130-
"2":["off", "auto", "heat", "cool"],
131-
"3":["off", "emergency heat", "heat", "cool"]
133+
"1":["off", "heat"],
134+
"2":["off", "cool"],
135+
"3":["off", "heat", "cool"],
136+
"4":["off", "auto", "heat", "cool"],
137+
"5":["off", "emergency heat", "heat", "cool"]
132138
]
133139
}
134140

0 commit comments

Comments
 (0)