Hello,
I am modifying the published Z-Wave Metering Dimmer DTH so that it can modify device parameters to change/control the actual behavior of the physical device. I have created a custom function called setParam(int, int, int) to perform this task using the zwave.configurationV1.configurationSet command. However, I can never get the actual parameters on the dimmers to change when using the setParam function.
def setParam(paramID, paramVal, paramSize) {
log.debug “setParameter(int, int, int): Setting parameters(paramID=$paramID, paramVal=$paramVal, paramSize=$paramSize)”
//delayBetween([
// zwave.configurationV1.configurationSet(parameterNumber: paramID, size:1, scaledConfigurationValue: paramVal.toInteger()).format(),
// zwave.configurationV1.configurationGet().format(),
//], 1000)
delayBetween([
zwave.configurationV1.configurationSet(parameterNumber: 125, size: 1, scaledConfigurationValue: rampRate.toInteger()).format(),
zwave.configurationV1.configurationSet(parameterNumber: 131, size: 1, scaledConfigurationValue: minBrightness.toInteger()).format(),
zwave.configurationV1.configurationSet(parameterNumber: 132, size: 1, scaledConfigurationValue: maxBrightness.toInteger()).format(),
zwave.configurationV1.configurationGet().format(),
], 1000)
log.debug “done”
}
However, when I take the exact same configurationSet commands and put them into a different function called strobe(), the expected behavior is applied to the physical dimmer successfully.
def strobe()
{ log.debug "$rampRate, $minBrightness, $maxBrightness"
delayBetween([
zwave.configurationV1.configurationSet(parameterNumber: 125, size: 1, scaledConfigurationValue: rampRate.toInteger()).format(),
zwave.configurationV1.configurationSet(parameterNumber: 131, size: 1, scaledConfigurationValue: minBrightness.toInteger()).format(),
zwave.configurationV1.configurationSet(parameterNumber: 132, size: 1, scaledConfigurationValue: maxBrightness.toInteger()).format(),
zwave.configurationV1.configurationGet().format(),
], 1000)
//setParameter(125, rampRate, 1)
//setParameter(131, minBrightness, 1)
//setParam(132, maxBrightness, 1)
}
Eventually, I need to uncomment the code in the setParams function so I can set multiple parameters using this function, but I cant seem to identify why the exact same code functions differently in two different functions.