Skip to content

Commit 4124c21

Browse files
authored
Merge pull request SmartThingsCommunity#52908 from SmartThingsCommunity/staging
Rolling up staging to acceptance
2 parents a769e89 + 2036f6d commit 4124c21

File tree

8 files changed

+175
-36
lines changed

8 files changed

+175
-36
lines changed

devicetypes/smartthings/aeon-home-energy-meter.src/aeon-home-energy-meter.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def configure() {
163163
encap(zwave.configurationV1.configurationSet(parameterNumber: 102, size: 4, scaledConfigurationValue: 0)), // disable group 2...
164164
encap(zwave.configurationV1.configurationSet(parameterNumber: 103, size: 4, scaledConfigurationValue: 0)), // disable group 3...
165165
encap(zwave.configurationV1.configurationSet(parameterNumber: 111, size: 4, scaledConfigurationValue: 300)), // ...every 5 min
166-
encap(zwave.configurationV1.configurationSet(parameterNumber: 90, size: 1, scaledConfigurationValue: 0)), // enabling automatic reports, disabled selective reporting...
166+
encap(zwave.configurationV1.configurationSet(parameterNumber: 3, size: 1, scaledConfigurationValue: 0)), // enabling automatic reports, disabled selective reporting...
167167
encap(zwave.configurationV1.configurationSet(parameterNumber: 13, size: 1, scaledConfigurationValue: 0)) //disable CRC16 encapsulation
168168
], 500)
169169
else if (isQubinoSmartMeter())

devicetypes/smartthings/viconics-schneider-room-controller.src/viconics-schneider-room-controller.groovy

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,10 @@ def fanCirculate() {
334334
}
335335

336336
def getThermostatFanModeCommands(mode) {
337-
if (mode) {
338-
delayBetween([
339-
zigbee.writeAttribute(THERMOSTAT_CLUSTER, CUSTOM_FAN_MODE, DataType.ENUM8, mode),
340-
zigbee.readAttribute(THERMOSTAT_CLUSTER, CUSTOM_FAN_MODE)
341-
], 500)
342-
}
337+
delayBetween([
338+
zigbee.writeAttribute(THERMOSTAT_CLUSTER, CUSTOM_FAN_MODE, DataType.ENUM8, mode),
339+
zigbee.readAttribute(THERMOSTAT_CLUSTER, CUSTOM_FAN_MODE)
340+
], 500)
343341
}
344342

345343
def setFanSpeed(speed) {
@@ -397,13 +395,11 @@ def off() {
397395
}
398396

399397
def getThermostatModeCommands(mode) {
400-
if (mode) {
401-
delayBetween([
402-
zigbee.writeAttribute(THERMOSTAT_CLUSTER, CUSTOM_THERMOSTAT_MODE, DataType.ENUM8, mode),
403-
zigbee.readAttribute(THERMOSTAT_CLUSTER, CUSTOM_THERMOSTAT_MODE),
404-
zigbee.readAttribute(THERMOSTAT_CLUSTER, CUSTOM_THERMOSTAT_OPERATING_STATE)
405-
], 500)
406-
}
398+
delayBetween([
399+
zigbee.writeAttribute(THERMOSTAT_CLUSTER, CUSTOM_THERMOSTAT_MODE, DataType.ENUM8, mode),
400+
zigbee.readAttribute(THERMOSTAT_CLUSTER, CUSTOM_THERMOSTAT_MODE),
401+
zigbee.readAttribute(THERMOSTAT_CLUSTER, CUSTOM_THERMOSTAT_OPERATING_STATE)
402+
], 500)
407403
}
408404

409405
def ping() {

devicetypes/smartthings/zigbee-dimmer-power.src/zigbee-dimmer-power.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ metadata {
3434

3535
// Sengled
3636
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0702, 0B05", outClusters: "0019", manufacturer: "sengled", model: "Z01-CIA19NAE26", deviceJoinName: "Sengled Light" //Sengled Element touch
37+
38+
// Enbrighten/Jasco
39+
fingerprint manufacturer: "Jasco Products", model: "43082", deviceJoinName: "Enbrighten Switch" //Enbrighten, in-Wall Smart Dimmer With Energy Monitoring 43082, Raw Description: 01 0104 0101 00 08 0000 0003 0004 0005 0006 0008 0702 0B05 02 000A 0019
3740
}
3841

3942
tiles(scale: 2) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
/**
2+
* Copyright 2019 SmartThings
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at:
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
10+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
11+
* for the specific language governing permissions and limitations under the License.
12+
*
13+
*/
14+
import physicalgraph.zigbee.zcl.DataType
15+
16+
metadata {
17+
definition (name: "Zigbee Metering Plug Power Consumption Report", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.smartplug", mnmn: "SmartThings", vid: "generic-switch-power-energy") {
18+
capability "Energy Meter"
19+
capability "Power Meter"
20+
capability "Actuator"
21+
capability "Switch"
22+
capability "Refresh"
23+
capability "Health Check"
24+
capability "Sensor"
25+
capability "Configuration"
26+
capability "Power Consumption Report"
27+
28+
fingerprint manufacturer: "DAWON_DNS", model: "PM-B430-ZB", deviceJoinName: "Dawon Outlet" // DAWON DNS Smart Plug
29+
fingerprint manufacturer: "DAWON_DNS", model: "PM-B530-ZB", deviceJoinName: "Dawon Outlet" // DAWON DNS Smart Plug
30+
fingerprint manufacturer: "DAWON_DNS", model: "PM-C140-ZB", deviceJoinName: "Dawon Outlet" // DAWON DNS In-Wall Outlet
31+
fingerprint manufacturer: "DAWON_DNS", model: "PM-B540-ZB", deviceJoinName: "Dawon Outlet" // DAWON DNS Smart Plug
32+
fingerprint manufacturer: "DAWON_DNS", model: "ST-B550-ZB", deviceJoinName: "Dawon Outlet" // DAWON DNS Smart Plug
33+
fingerprint manufacturer: "DAWON_DNS", model: "PM-C150-ZB", deviceJoinName: "Dawon Outlet" // DAWON DNS In-Wall Outlet
34+
fingerprint manufacturer: "DAWON_DNS", model: "PM-C250-ZB", deviceJoinName: "Dawon Outlet" // DAWON DNS In-Wall Outlet
35+
fingerprint manufacturer: "DAWON_DNS", model: "PM-B440-ZB", deviceJoinName: "Dawon Outlet" // DAWON DNS Smart Plug
36+
}
37+
}
38+
39+
def getATTRIBUTE_READING_INFO_SET() { 0x0000 }
40+
def getATTRIBUTE_HISTORICAL_CONSUMPTION() { 0x0400 }
41+
42+
def parse(String description) {
43+
log.debug "description is $description"
44+
def event = zigbee.getEvent(description)
45+
def descMap = zigbee.parseDescriptionAsMap(description)
46+
47+
if (event) {
48+
log.info "event enter:$event"
49+
if (event.name == "switch" && !descMap.isClusterSpecific && descMap.commandInt == 0x0B) {
50+
log.info "Ignoring default response with desc map: $descMap"
51+
return [:]
52+
} else if (event.name== "power") {
53+
event.value = event.value/getPowerDiv()
54+
event.unit = "W"
55+
} else if (event.name== "energy") {
56+
event.value = event.value/getEnergyDiv()
57+
event.unit = "kWh"
58+
}
59+
log.info "event outer:$event"
60+
sendEvent(event)
61+
} else {
62+
List result = []
63+
log.debug "Desc Map: $descMap"
64+
65+
List attrData = [[clusterInt: descMap.clusterInt ,attrInt: descMap.attrInt, value: descMap.value]]
66+
descMap.additionalAttrs.each {
67+
attrData << [clusterInt: descMap.clusterInt, attrInt: it.attrInt, value: it.value]
68+
}
69+
70+
attrData.each {
71+
def map = [:]
72+
if (it.value && it.clusterInt == zigbee.SIMPLE_METERING_CLUSTER && it.attrInt == ATTRIBUTE_HISTORICAL_CONSUMPTION) {
73+
log.debug "power"
74+
map.name = "power"
75+
map.value = zigbee.convertHexToInt(it.value)/getPowerDiv()
76+
map.unit = "W"
77+
}
78+
else if (it.value && it.clusterInt == zigbee.SIMPLE_METERING_CLUSTER && it.attrInt == ATTRIBUTE_READING_INFO_SET) {
79+
log.debug "energy"
80+
map.name = "energy"
81+
map.value = zigbee.convertHexToInt(it.value)/getEnergyDiv()
82+
map.unit = "kWh"
83+
84+
def currentEnergy = map.value
85+
def currentPowerConsumption = device.currentState("powerConsumption")?.value
86+
Map previousMap = currentPowerConsumption ? new groovy.json.JsonSlurper().parseText(currentPowerConsumption) : [:]
87+
def deltaEnergy = calculateDelta (currentEnergy, previousMap)
88+
Map reportMap = [:]
89+
reportMap["energy"] = currentEnergy
90+
reportMap["deltaEnergy"] = deltaEnergy
91+
sendEvent("name": "powerConsumption", "value": reportMap.encodeAsJSON(), displayed: false)
92+
}
93+
94+
if (map) {
95+
result << createEvent(map)
96+
}
97+
log.debug "Parse returned $map"
98+
}
99+
return result
100+
}
101+
}
102+
103+
def off() {
104+
def cmds = zigbee.off()
105+
return cmds
106+
}
107+
108+
def on() {
109+
def cmds = zigbee.on()
110+
return cmds
111+
}
112+
113+
/**
114+
* PING is used by Device-Watch in attempt to reach the Device
115+
* */
116+
def ping() {
117+
return refresh()
118+
}
119+
120+
def refresh() {
121+
log.debug "refresh"
122+
zigbee.onOffRefresh() +
123+
zigbee.electricMeasurementPowerRefresh() +
124+
zigbee.readAttribute(zigbee.SIMPLE_METERING_CLUSTER, ATTRIBUTE_READING_INFO_SET)
125+
}
126+
127+
def configure() {
128+
// this device will send instantaneous demand and current summation delivered every 1 minute
129+
sendEvent(name: "checkInterval", value: 2 * 60 + 10 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])
130+
log.debug "Configuring Reporting"
131+
return refresh() +
132+
zigbee.onOffConfig() +
133+
zigbee.configureReporting(zigbee.SIMPLE_METERING_CLUSTER, ATTRIBUTE_READING_INFO_SET, DataType.UINT48, 1, 600, 1) +
134+
zigbee.electricMeasurementPowerConfig(1, 600, 1) +
135+
zigbee.simpleMeteringPowerConfig()
136+
}
137+
138+
private int getPowerDiv() {
139+
1
140+
}
141+
142+
private int getEnergyDiv() {
143+
1000
144+
}
145+
146+
BigDecimal calculateDelta (BigDecimal currentEnergy, Map previousMap) {
147+
if (previousMap?.'energy' == null) {
148+
return 0;
149+
}
150+
BigDecimal lastAcumulated = BigDecimal.valueOf(previousMap ['energy']);
151+
return currentEnergy.subtract(lastAcumulated).max(BigDecimal.ZERO);
152+
}

devicetypes/smartthings/zigbee-metering-plug.src/zigbee-metering-plug.groovy

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ metadata {
3030
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0702, 0B04", outClusters: "0003", manufacturer: "REXENSE", model: "HY0104", deviceJoinName: "HONYAR Outlet" //HONYAR Smart Outlet
3131
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0009, 0702, 0B04", outClusters: "0003, 0019", manufacturer: "HEIMAN", model: "E_Socket", deviceJoinName: "HEIMAN Outlet" //HEIMAN Smart Outlet
3232
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0B04, 0702, FC82", outClusters: "0003, 000A, 0019", manufacturer: "sengled", model: "E1C-NB7", deviceJoinName: "Sengled Outlet" //Sengled Smart Plug with Energy Tracker
33-
fingerprint manufacturer: "DAWON_DNS", model: "PM-B430-ZB", deviceJoinName: "Dawon Outlet" // DAWON DNS Smart Plug PM-B430-ZB (10A), raw description: 01 0104 0051 01 07 0000, 0004, 0003, 0006, 0019, 0702, 0B04 07 0000, 0004, 0003, 0006, 0019, 0702, 0B04
34-
fingerprint manufacturer: "DAWON_DNS", model: "PM-B530-ZB", deviceJoinName: "Dawon Outlet" // DAWON DNS Smart Plug PM-B530-ZB (16A), raw description: 01 0104 0051 01 07 0000, 0004, 0003, 0006, 0019, 0702, 0B04 07 0000, 0004, 0003, 0006, 0019, 0702, 0B04
35-
fingerprint manufacturer: "DAWON_DNS", model: "PM-C140-ZB", deviceJoinName: "Dawon Outlet" // DAWON DNS In-Wall Outlet PM-C140-ZB, raw description: 01 0104 0051 01 0A 0000 0002 0003 0004 0006 0019 0702 0B04 0008 0009 0A 0000 0002 0003 0004 0006 0019 0702 0B04 0008 0009
36-
fingerprint profileId: "0104", inClusters: "0000, 0002, 0003, 0006, 0702, 0B04", outClusters: "0003, 0019", manufacturer: "DAWON_DNS", model: "PM-B540-ZB", deviceJoinName: "Dawon Outlet" // DAWON DNS Smart Plug
37-
fingerprint profileId: "0104", inClusters: "0000, 0002, 0003, 0006, 0702, 0B04", outClusters: "0003, 0019", manufacturer: "DAWON_DNS", model: "ST-B550-ZB", deviceJoinName: "Dawon Outlet" // DAWON DNS Smart Plug
38-
fingerprint profileId: "0104", inClusters: "0000, 0003, 0006, 0702, 0B04", outClusters: "0003, 0019", manufacturer: "DAWON_DNS", model: "PM-C150-ZB", deviceJoinName: "Dawon Outlet" // DAWON DNS In-Wall Outlet
39-
fingerprint profileId: "0104", inClusters: "0000, 0003, 0006, 0702, 0B04", outClusters: "0003, 0019", manufacturer: "DAWON_DNS", model: "PM-C250-ZB", deviceJoinName: "Dawon Outlet" // DAWON DNS In-Wall Outlet
4033
fingerprint profileId: "0104", manufacturer: "frient A/S", model: "SPLZB-131", deviceJoinName: "frient Outlet" // frient smart plug mini, raw description: 02 0104 0051 10 09 0000 0702 0003 0009 0B04 0006 0004 0005 0002 05 0000 0019 000A 0003 0406
4134
fingerprint profileId: "0104", manufacturer: "frient A/S", model: "SPLZB-132", deviceJoinName: "frient Outlet" // frient smart plug mini, raw description: 02 0104 0051 10 09 0000 0702 0003 0009 0B04 0006 0004 0005 0002 05 0000 0019 000A 0003 0406
4235
fingerprint profileId: "0104", manufacturer: "frient A/S", model: "SPLZB-134", deviceJoinName: "frient Outlet" // frient smart plug mini, raw description: 02 0104 0051 10 09 0000 0702 0003 0009 0B04 0006 0004 0005 0002 05 0000 0019 000A 0003 0406
@@ -171,19 +164,9 @@ private int getPowerDiv() {
171164
}
172165

173166
private int getEnergyDiv() {
174-
if (isDawonOutlet()) {
175-
1000
176-
} else if (isSengledOutlet()) {
177-
10000
178-
} else {
179-
100
180-
}
167+
isSengledOutlet() ? 10000 : 100
181168
}
182169

183170
private boolean isSengledOutlet() {
184171
device.getDataValue("model") == "E1C-NB7"
185172
}
186-
187-
private boolean isDawonOutlet() {
188-
device.getDataValue("manufacturer") == "DAWON_DNS"
189-
}

devicetypes/smartthings/zigbee-switch-power.src/zigbee-switch-power.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ metadata {
5454
fingerprint profileId: "0104", deviceId: "0051", inClusters: "0000, 0003, 0004, 0005, 0006, 0B04, 1000, 0702", outClusters: "0019", manufacturer: "AduroSmart Eria", model: "AD-SmartPlug3001", deviceJoinName: "Eria Switch" //Eria Zigbee Smart Plug
5555
fingerprint profileId: "0104", deviceId: "010A", inClusters: "0000, 0003, 0004, 0005, 0006, 1000", outClusters: "0019", manufacturer: "AduroSmart Eria", model: "BPU3", deviceJoinName: "Eria Switch" //Eria Zigbee On/Off Plug
5656
fingerprint profileId: "0104", deviceId: "0101", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 1000", outClusters: "0019", manufacturer: "AduroSmart Eria", model: "BDP3001", deviceJoinName: "Eria Switch" //Eria Zigbee Dimmable Plug
57+
58+
// Enbrighten
59+
fingerprint manufacturer: "Jasco Products", model: "43078", deviceJoinName: "Enbrighten Switch" //Enbrighten In-Wall Smart Switch With Energy Monitoring 43078, Raw Description: 01 0104 0100 00 07 0000 0003 0004 0005 0006 0702 0B05 02 000A 0019
60+
fingerprint manufacturer: "Jasco Products", model: "43095", deviceJoinName: "Enbrighten Switch" //Enbrighten Plug-in Smart Switch With Energy Monitoring 43095, Raw Description: 01 0104 0100 00 07 0000 0003 0004 0005 0006 0702 0B05 02 000A 0019
5761
}
5862

5963
tiles(scale: 2) {

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,10 @@ metadata {
101101

102102
// Enbrighten/Jasco
103103
fingerprint manufacturer: "Jasco Products", model: "43100", deviceJoinName: "Enbrighten Switch" //Enbrighten, Plug-in Outdoor Smart Switch, 43100, Raw Description: 01 0104 0100 00 06 0000 0003 0004 0005 0006 0B05 02 000A 0019
104-
fingerprint manufacturer: "Jasco Products", model: "43084", deviceJoinName: "Enbrighten Switch" //Enbrighten, In-Wall Smart Switch, Toggle, 43084, Raw Description: 01 0104 0100 00 06 0000 0003 0004 0005 0006 0B05 02 000A 0019
105-
fingerprint manufacturer: "Jasco Products", model: "43094", deviceJoinName: "Enbrighten Switch" //Enbrighten, Plug-in Smart Switch, 43094, Raw Description: 01 0104 0100 00 06 0000 0003 0004 0005 0006 0B05 02 000A 0019
106-
fingerprint manufacturer: "Jasco Products", model: "43102", deviceJoinName: "Enbrighten Switch" //Enbrighten, In-Wall Smart Outlet, 43102, Raw Description: 01 0104 0100 00 06 0000 0003 0004 0005 0006 0B05 02 000A 0019
104+
fingerprint manufacturer: "Jasco Products", model: "43084", deviceJoinName: "Enbrighten Switch" //Enbrighten, In-Wall Smart Switch Toggle, 43084, Raw Description: 01 0104 0100 00 06 0000 0003 0004 0005 0006 0B05 02 000A 0019
105+
fingerprint manufacturer: "Jasco Products", model: "43094", deviceJoinName: "Enbrighten Switch" //Enbrighten, Plug-in Smart Switch 43094, Raw Description: 01 0104 0100 00 06 0000 0003 0004 0005 0006 0B05 02 000A 0019
106+
fingerprint manufacturer: "Jasco Products", model: "43102", deviceJoinName: "Enbrighten Switch" //Enbrighten, In-Wall Smart Outlet 43102, Raw Description: 01 0104 0100 00 06 0000 0003 0004 0005 0006 0B05 02 000A 0019
107+
fingerprint manufacturer: "Jasco Products", model: "43076", deviceJoinName: "Enbrighten Switch" //Enbrighten, In-Wall Smart Switch 43076, Raw Description: 01 0104 0100 00 06 0000 0003 0004 0005 0006 0B05 02 000A 0019
107108
}
108109

109110
// simulator metadata

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ metadata {
4747
fingerprint mfr: "027A", prod: "0101", model: "000D", deviceJoinName: "Zooz Switch" //Zooz Power Switch
4848
fingerprint mfr: "0159", prod: "0002", model: "0054", deviceJoinName: "Qubino Outlet", ocfDeviceType: "oic.d.smartplug" //Qubino Smart Plug
4949
fingerprint mfr: "0371", prod: "0003", model: "00AF", deviceJoinName: "Aeotec Outlet", ocfDeviceType: "oic.d.smartplug" //EU //Aeotec Smart Switch 7
50-
fingerprint mfr: "0371", prod: "0103", model: "00AF", deviceJoinName: "Aeotec Outlet", ocfDeviceType: "oic.d.smartplug" //US //Aeotec Smart Switch 7
50+
fingerprint mfr: "0371", prod: "0103", model: "0017", deviceJoinName: "Aeotec Outlet", ocfDeviceType: "oic.d.smartplug" //US //Aeotec Smart Switch 7
5151
fingerprint mfr: "0060", prod: "0004", model: "000B", deviceJoinName: "Everspring Outlet", ocfDeviceType: "oic.d.smartplug" //US //Everspring Smart Plug
5252
fingerprint mfr: "031E", prod: "0002", model: "0001", deviceJoinName: "Inovelli Switch" //US //Inovelli Switch Red Series
5353
fingerprint mfr: "0154", prod: "0003", model: "000A", deviceJoinName: "POPP Outlet", ocfDeviceType: "oic.d.smartplug" //EU //POPP Smart Outdoor Plug

0 commit comments

Comments
 (0)