Delay between with commands broken in latest firmware

if you put the following in your code

delayBetween(commands.collect{ command(it) }, delay)

you errors like this in the logs.. it is actually appending the delay to the commands
ie

Care to share what it looks like when you add it to the code? Like a sample just so I make sure I'm implementing it correctly.

ive got two places in the code o f a device handler i had to comment out.. here was the original code.. was giving me errors
here
else {
myred=value.red >=128 ? 255 : 0
mygreen=value.green >=128 ? 255 : 0
myblue=value.blue>=128 ? 255 : 0
}
cmds << "200100"
// cmds << delay 250"
if (myred!=0) {
cmds << "33060002FF"
//cmds << "delay 150"
cmds << "330702"
}
if (mygreen!=0) {
cmds << "33060003FF"
//cmds << "delay 150"
cmds << "330703"
}
if (myblue!=0) {
cmds << "3306000400"
//cmds << "delay 150"
cmds << "330704"
}
// cmds << "delay 100"
cmds << zwave.basicV1.basicGet()

hexValue = rgbToHex([r:myred, g:mygreen, b:myblue])
if(hexValue) sendEvent(name: "color", value: hexValue, displayed: true)
commands(cmds)

}

and this one is also causing problems that i already posted

private commands(commands, delay=1000) {
delayBetween(commands.collect{ command(it) }, delay)
}

called via here

def configure() {
if (debugEnable) log.debug "OnTime=${settings.OnTime} OnLevel=${settings.OnLevel} TempAdj=${settings.TempAdj}"
def cmds = ([
zwave.configurationV1.configurationSet(parameterNumber: 1, size: 1, scaledConfigurationValue: checkOnTimeInput(settings.OnTime)),
zwave.configurationV1.configurationSet(parameterNumber: 2, size: 1, scaledConfigurationValue: checkOnLevelInput(settings.OnLevel)),
zwave.configurationV1.configurationSet(parameterNumber: 3, size: 1, scaledConfigurationValue: checkLiteTempInput(settings.LiteMin)),
zwave.configurationV1.configurationSet(parameterNumber: 4, size: 1, scaledConfigurationValue: checkLiteTempInput(settings.TempMin)),
zwave.configurationV1.configurationSet(parameterNumber: 5, size: 1, scaledConfigurationValue: checkTempAdjInput(settings.TempAdj)),
zwave.configurationV1.configurationGet(parameterNumber: 1),
zwave.configurationV1.configurationGet(parameterNumber: 2),
zwave.configurationV1.configurationGet(parameterNumber: 3),
zwave.configurationV1.configurationGet(parameterNumber: 4),
zwave.configurationV1.configurationGet(parameterNumber: 5)
])
//if (debugEnable) log.debug cmds
return commands(cmds)
}

or here

private command(hubitat.zwave.Command cmd) {
// log.debug "in command command = $cmd"
if (getDataValue("zwaveSecurePairingComplete") != "true") {
return cmd.format()
}
Short S2 = getDataValue("S2")?.toInteger()
// log.debug "s2 = $s2"
String encap = ""
String keyUsed = "S0"
if (S2 == null) { //S0 existing device
encap = "988100"
} else if ((S2 & 0x04) == 0x04) { //S2_ACCESS_CONTROL
keyUsed = "S2_ACCESS_CONTROL"
encap = "9F0304"
} else if ((S2 & 0x02) == 0x02) { //S2_AUTHENTICATED
keyUsed = "S2_AUTHENTICATED"
encap = "9F0302"
} else if ((S2 & 0x01) == 0x01) { //S2_UNAUTHENTICATED
keyUsed = "S2_UNAUTHENTICATED"
encap = "9F0301"
} else if ((S2 & 0x80) == 0x80) { //S0 on C7
encap = "988100"
}
return "${encap}${cmd.format()}"
}

private command(String cmd) {
// log.debug "in cmd 2 = $cmd"
if (getDataValue("zwaveSecurePairingComplete") != "true") {
return cmd
}
Short S2 = getDataValue("S2")?.toInteger()
// log.debug " s2 = $s2"
String encap = ""
String keyUsed = "S0"
if (S2 == null) { //S0 existing device
encap = "988100"
} else if ((S2 & 0x04) == 0x04) { //S2_ACCESS_CONTROL
keyUsed = "S2_ACCESS_CONTROL"
encap = "9F0304"
} else if ((S2 & 0x02) == 0x02) { //S2_AUTHENTICATED
keyUsed = "S2_AUTHENTICATED"
encap = "9F0302"
} else if ((S2 & 0x01) == 0x01) { //S2_UNAUTHENTICATED
keyUsed = "S2_UNAUTHENTICATED"
encap = "9F0301"
} else if ((S2 & 0x80) == 0x80) { //S0 on C7
encap = "988100"
}
return "${encap}${cmd}"
}

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.