I’m using Inovelli dimmer switches and the device handler supports setLevel with an optional duration parameter. This is a hardware fade-over-time built in to the switch firmware and also appears to be a standard zwaveV2 command that supports it zwave.switchMultilevelV2.switchMultilevelSet(value,duration)
In Hubitat Rule Machine I can issue the device command for either setLevel(value) or setLevel(value,duration). In other words, Hubitat Rule Machine allows the device command to have either 1 or 2 parameters and accepts it either way. If only one value is sent, the dimmer gets immediately set to that level. If two values are sent, then the dimmer fades to the 1st value with a time duration based on the 2nd value.
In WebCore, it appears that the setLevel() command can only take 1 value. Is there a way to tell WebCore that setLevel() can accept two values? If not, what other method can I send this device command with two parameters?
Here are the two commands inside the device handler
def setLevel(value, duration) { if (infoEnable) log.info "${device.label?device.label:device.name}: setLevel($value, $duration)" state.lastRan = now() def dimmingDuration = duration < 128 ? duration : 128 + Math.round(duration / 60) commands([ zwave.switchMultilevelV2.switchMultilevelSet(value: value < 100 ? value : 99, dimmingDuration: dimmingDuration) ]) } def setLevel(value) { if (infoEnable) log.info "${device.label?device.label:device.name}: setLevel($value)" state.lastRan = now() commands([ zwave.switchMultilevelV2.switchMultilevelSet(value: value < 100 ? value : 99) ]) }
And here are the setLevel() command options showing in WebCore (just one “level” parameter with no option to add additional parameters)