@@ -22,11 +22,6 @@ metadata {
22
22
fingerprint deviceId : " 0x1006" , inClusters : " 0x25"
23
23
}
24
24
25
- preferences {
26
- input description : " After successful installation, please click the refresh tile to update device status" ,
27
- title : " Instructions" , displayDuringSetup : true , type : " paragraph" , element : " paragraph"
28
- }
29
-
30
25
// simulator metadata
31
26
simulator {
32
27
status " open" : " command: 2503, payload: FF"
@@ -58,6 +53,10 @@ metadata {
58
53
59
54
}
60
55
56
+ def updated () {
57
+ response(refresh())
58
+ }
59
+
61
60
def parse (String description ) {
62
61
log. trace " parse description : $description "
63
62
def result = null
@@ -70,7 +69,7 @@ def parse(String description) {
70
69
}
71
70
72
71
def zwaveEvent (physicalgraph.zwave.commands.basicv1.BasicReport cmd ) {
73
- def value = cmd. value == " on " || cmd . value == 0xFF ? " open" : cmd . value == " off " || cmd. value == 0x00 ? " closed" : " unknown"
72
+ def value = cmd. value == 0xFF ? " open" : cmd. value == 0x00 ? " closed" : " unknown"
74
73
[name : " contact" , value : value, descriptionText : " $device . displayName valve is $value " ]
75
74
}
76
75
@@ -89,7 +88,7 @@ def zwaveEvent(physicalgraph.zwave.commands.deviceresetlocallyv1.DeviceResetLoca
89
88
}
90
89
91
90
def zwaveEvent (physicalgraph.zwave.commands.switchbinaryv1.SwitchBinaryReport cmd ) {
92
- def value = cmd. value == " on " || cmd . value == 0xFF ? " open" : cmd . value == " off " || cmd. value == 0x00 ? " closed" : " unknown"
91
+ def value = cmd. value == 0xFF ? " open" : cmd. value == 0x00 ? " closed" : " unknown"
93
92
[name : " contact" , value : value, descriptionText : " $device . displayName valve is $value " ]
94
93
}
95
94
@@ -112,16 +111,14 @@ def close() {
112
111
}
113
112
114
113
def poll () {
115
- delayBetween([
116
- zwave. switchBinaryV1. switchBinaryGet(). format(),
117
- zwave. manufacturerSpecificV1. manufacturerSpecificGet(). format()
118
- ],100 )
114
+ zwave. switchBinaryV1. switchBinaryGet(). format()
119
115
}
120
116
121
117
def refresh () {
122
118
log. debug " refresh() is called"
123
- delayBetween([
124
- zwave. switchBinaryV1. switchBinaryGet(). format(),
125
- zwave. manufacturerSpecificV1. manufacturerSpecificGet(). format()
126
- ],100 )
119
+ def commands = [zwave. switchBinaryV1. switchBinaryGet(). format()]
120
+ if (getDataValue(" MSR" ) == null ) {
121
+ commands << zwave. manufacturerSpecificV1. manufacturerSpecificGet(). format()
122
+ }
123
+ delayBetween(commands,100 )
127
124
}
0 commit comments