Skip to content

Commit b74361c

Browse files
ALamchaSgreens
authored andcommitted
Added support for Eaton Master Switch [DEVC-567] and Eaton Receptacle… (SmartThingsCommunity#2784)
* Added support for Eaton Master Switch [DEVC-567] and Eaton Receptacle [DEVC-569] to generic z-wave switch DTH. * Reduced code duplication, reverted changes to updateDataValue() calls, removed trailing space from deviceJoinName. * [DEVC-582] Eaton Appliance Plug-In Module integration
1 parent 2cdd9f8 commit b74361c

File tree

2 files changed

+40
-52
lines changed

2 files changed

+40
-52
lines changed

devicetypes/smartthings/zwave-switch-generic.src/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Works with:
1111
* [Leviton 15A Switch (VRS15-1LZ)](https://www.smartthings.com/works-with-smartthings/lighting-and-switches/leviton-15a-switch)
1212
* [Enerwave Duplex Receptacle (ZW15R)](https://www.smartthings.com/works-with-smartthings/outlets/enerwave-duplex-receptacle)
1313
* [Enerwave On/Off Switch (ZW15S)](https://www.smartthings.com/works-with-smartthings/lighting-and-switches/enerwave-onoff-switch)
14+
* [Eaton Wireless Receptacle](http://www.cooperindustries.com/content/public/en/wiring_devices/products/lighting_controls/aspire_rf_wireless/aspire_rf_15a_tamper_resistant_split_control_duplex_receptacle_rftr9505_t.html)
15+
* [Eaton Master Switch](http://www.cooperindustries.com/content/public/en/wiring_devices/products/lighting_controls/aspire_rf_wireless/switches/aspire_rf_15a_wireless_switch_rf9501.html)
1416

1517
## Table of contents
1618

@@ -48,4 +50,4 @@ Instructions related to pairing, resetting and removing the device from SmartThi
4850
* [Leviton Switch (DZS15-1LZ) Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/206171053-How-to-connect-Leviton-Z-Wave-devices)
4951
* [Leviton 15A Switch (VRS15-1LZ) Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/206171053-How-to-connect-Leviton-Z-Wave-devices)
5052
* [Enerwave Duplex Receptacle (ZW15R) Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/204854176-How-to-connect-Enerwave-switches-and-dimmers)
51-
* [Enerwave On/Off Switch (ZW15S) Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/204854176-How-to-connect-Enerwave-switches-and-dimmers)
53+
* [Enerwave On/Off Switch (ZW15S) Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/204854176-How-to-connect-Enerwave-switches-and-dimmers)

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

Lines changed: 37 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,39 @@
1212
*
1313
*/
1414
metadata {
15-
definition (name: "Z-Wave Switch Generic", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch", runLocally: true, minHubCoreVersion: '000.019.00012', executeCommandsLocally: true) {
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"
18-
capability "Switch"
18+
capability "Switch"
1919
capability "Polling"
2020
capability "Refresh"
2121
capability "Sensor"
2222
capability "Light"
2323

2424
fingerprint inClusters: "0x25", deviceJoinName: "Z-Wave Switch"
25-
fingerprint mfr:"001D", prod:"1A02", model:"0334", deviceJoinName: "Leviton Appliance Module"
26-
fingerprint mfr:"0063", prod:"4F50", model:"3031", deviceJoinName: "GE Plug-in Outdoor Switch"
27-
fingerprint mfr:"001D", prod:"1D04", model:"0334", deviceJoinName: "Leviton Outlet"
28-
fingerprint mfr:"001D", prod:"1C02", model:"0334", deviceJoinName: "Leviton Switch"
29-
fingerprint mfr:"001D", prod:"0301", model:"0334", deviceJoinName: "Leviton 15A Switch"
30-
fingerprint mfr:"001D", prod:"0F01", model:"0334", deviceJoinName: "Leviton 5A Incandescent Switch"
31-
fingerprint mfr:"001D", prod:"1603", model:"0334", deviceJoinName: "Leviton 15A Split Duplex Receptacle"
32-
fingerprint mfr:"011A", prod:"0101", model:"0102", deviceJoinName: "Enerwave On/Off Switch"
33-
fingerprint mfr:"011A", prod:"0101", model:"0603", deviceJoinName: "Enerwave Duplex Receptacle"
34-
fingerprint mfr:"0039", prod:"5052", model:"3038", deviceJoinName: "Honeywell Z-Wave Plug-in Switch"
35-
fingerprint mfr:"0039", prod:"5052", model:"3033", deviceJoinName: "Honeywell Z-Wave Plug-in Switch (Dual Outlet)"
36-
fingerprint mfr:"0039", prod:"4F50", model:"3032", deviceJoinName: "Honeywell Z-Wave Plug-in Outdoor Smart Switch"
37-
fingerprint mfr:"0039", prod:"4952", model:"3036", deviceJoinName: "Honeywell Z-Wave In-Wall Smart Switch"
38-
fingerprint mfr:"0039", prod:"4952", model:"3037", deviceJoinName: "Honeywell Z-Wave In-Wall Smart Toggle Switch"
39-
fingerprint mfr:"0039", prod:"4952", model:"3133", deviceJoinName: "Honeywell Z-Wave In-Wall Tamper Resistant Duplex Receptacle"
25+
fingerprint mfr: "001D", prod: "1A02", model: "0334", deviceJoinName: "Leviton Appliance Module"
26+
fingerprint mfr: "0063", prod: "4F50", model: "3031", deviceJoinName: "GE Plug-in Outdoor Switch"
27+
fingerprint mfr: "001D", prod: "1D04", model: "0334", deviceJoinName: "Leviton Outlet"
28+
fingerprint mfr: "001D", prod: "1C02", model: "0334", deviceJoinName: "Leviton Switch"
29+
fingerprint mfr: "001D", prod: "0301", model: "0334", deviceJoinName: "Leviton 15A Switch"
30+
fingerprint mfr: "001D", prod: "0F01", model: "0334", deviceJoinName: "Leviton 5A Incandescent Switch"
31+
fingerprint mfr: "001D", prod: "1603", model: "0334", deviceJoinName: "Leviton 15A Split Duplex Receptacle"
32+
fingerprint mfr: "011A", prod: "0101", model: "0102", deviceJoinName: "Enerwave On/Off Switch"
33+
fingerprint mfr: "011A", prod: "0101", model: "0603", deviceJoinName: "Enerwave Duplex Receptacle"
34+
fingerprint mfr: "0039", prod: "5052", model: "3038", deviceJoinName: "Honeywell Z-Wave Plug-in Switch"
35+
fingerprint mfr: "0039", prod: "5052", model: "3033", deviceJoinName: "Honeywell Z-Wave Plug-in Switch (Dual Outlet)"
36+
fingerprint mfr: "0039", prod: "4F50", model: "3032", deviceJoinName: "Honeywell Z-Wave Plug-in Outdoor Smart Switch"
37+
fingerprint mfr: "0039", prod: "4952", model: "3036", deviceJoinName: "Honeywell Z-Wave In-Wall Smart Switch"
38+
fingerprint mfr: "0039", prod: "4952", model: "3037", deviceJoinName: "Honeywell Z-Wave In-Wall Smart Toggle Switch"
39+
fingerprint mfr: "0039", prod: "4952", model: "3133", deviceJoinName: "Honeywell Z-Wave In-Wall Tamper Resistant Duplex Receptacle"
40+
fingerprint mfr: "001A", prod: "5244", deviceJoinName: "Eaton RF Receptacle"
41+
fingerprint mfr: "001A", prod: "534C", model: "0000", deviceJoinName: "Eaton RF Master Switch"
42+
fingerprint mfr: "001A", prod: "5354", model: "0003", deviceJoinName: "Eaton RF Appliance Plug-In Module"
4043
}
4144

4245
// simulator metadata
4346
simulator {
44-
status "on": "command: 2003, payload: FF"
47+
status "on": "command: 2003, payload: FF"
4548
status "off": "command: 2003, payload: 00"
4649

4750
// reply messages
@@ -51,29 +54,29 @@ metadata {
5154

5255
// tile definitions
5356
tiles(scale: 2) {
54-
multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
55-
tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
57+
multiAttributeTile(name: "switch", type: "lighting", width: 6, height: 4, canChangeIcon: true) {
58+
tileAttribute("device.switch", key: "PRIMARY_CONTROL") {
5659
attributeState "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#00A0DC"
5760
attributeState "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
5861
}
5962
}
6063

6164
standardTile("refresh", "device.switch", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
62-
state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
65+
state "default", label: '', action: "refresh.refresh", icon: "st.secondary.refresh"
6366
}
6467

6568
main "switch"
66-
details(["switch","refresh"])
69+
details(["switch", "refresh"])
6770
}
6871
}
6972

70-
def installed(){
73+
def installed() {
7174
// Device-Watch simply pings if no device events received for checkInterval duration of 32min = 2 * 15min + 2min lag time
7275
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"])
7376
response(refresh())
7477
}
7578

76-
def updated(){
79+
def updated() {
7780
// Device-Watch simply pings if no device events received for checkInterval duration of 32min = 2 * 15min + 2min lag time
7881
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"])
7982
}
@@ -113,22 +116,15 @@ def zwaveEvent(physicalgraph.zwave.commands.switchbinaryv1.SwitchBinaryReport cm
113116
[name: "switch", value: cmd.value ? "on" : "off", type: "digital"]
114117
}
115118

116-
def zwaveEvent(physicalgraph.zwave.commands.configurationv1.ConfigurationReport cmd) {
117-
def value = "when off"
118-
if (cmd.configurationValue[0] == 1) {value = "when on"}
119-
if (cmd.configurationValue[0] == 2) {value = "never"}
120-
[name: "indicatorStatus", value: value, display: false]
121-
}
122-
123119
def zwaveEvent(physicalgraph.zwave.commands.hailv1.Hail cmd) {
124120
[name: "hail", value: "hail", descriptionText: "Switch button was pressed", displayed: false]
125121
}
126122

127123
def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd) {
128-
log.debug "manufacturerId: ${cmd.manufacturerId}"
129-
log.debug "manufacturerName: ${cmd.manufacturerName}"
130-
log.debug "productId: ${cmd.productId}"
131-
log.debug "productTypeId: ${cmd.productTypeId}"
124+
log.debug "manufacturerId: $cmd.manufacturerId"
125+
log.debug "manufacturerName: $cmd.manufacturerName"
126+
log.debug "productId: $cmd.productId"
127+
log.debug "productTypeId: $cmd.productTypeId"
132128
def msr = String.format("%04X-%04X-%04X", cmd.manufacturerId, cmd.productTypeId, cmd.productId)
133129
updateDataValue("MSR", msr)
134130
updateDataValue("manufacturer", cmd.manufacturerName)
@@ -165,10 +161,7 @@ def off() {
165161
}
166162

167163
def poll() {
168-
delayBetween([
169-
zwave.switchBinaryV1.switchBinaryGet().format(),
170-
zwave.manufacturerSpecificV1.manufacturerSpecificGet().format()
171-
])
164+
refresh()
172165
}
173166

174167
/**
@@ -179,17 +172,10 @@ def ping() {
179172
}
180173

181174
def refresh() {
182-
delayBetween([
183-
zwave.switchBinaryV1.switchBinaryGet().format(),
184-
zwave.manufacturerSpecificV1.manufacturerSpecificGet().format()
185-
])
186-
}
187-
188-
def invertSwitch(invert=true) {
189-
if (invert) {
190-
zwave.configurationV1.configurationSet(configurationValue: [1], parameterNumber: 4, size: 1).format()
191-
}
192-
else {
193-
zwave.configurationV1.configurationSet(configurationValue: [0], parameterNumber: 4, size: 1).format()
175+
def commands = []
176+
commands << zwave.switchBinaryV1.switchBinaryGet().format()
177+
if (getDataValue("MSR") == null) {
178+
commands << zwave.manufacturerSpecificV1.manufacturerSpecificGet().format()
194179
}
180+
delayBetween(commands)
195181
}

0 commit comments

Comments
 (0)