Hey, I’m tinkering around device-handler and zwave devices, and I have an issue to understand the difference between:
def zwaveEvent(physicalgraph.zwave.commands.configurationv2.ConfigurationReport cmd) {
log.debug "${device.displayName} parameter '${cmd.parameterNumber}' with a byte size of '${cmd.size}' is set to '${cmd.configurationValue}'"
createEvent([name: "coin", value:"coin"])
}
def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
def level = cmd.batteryLevel > 0 ? cmd.batteryLevel.toString() : 1
createEvent([ name: "battery", unit: "%", displayed: false, value: level ])
}
def configure() {
def cmds = []
//this
cmds << zwave.configurationV1.configurationGet(parameterNumber: 24).format()
// and this
cmds << response(zwave.batteryV1.batteryGet())
delayBetween(cmds, 500)
}
When zwave.configurationV1.configurationGet is triggered, the device will send (when awake) an event which will be parsed and will call zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport to deal with the reponse.
But for response( ? what is the workflow ? response will return the result of the battery event callback ? (for example in this case).
What is the use case ?
What will contain cmds ?
Maybe @duncan could help me understanding this quite easily
I think that is a copy/paste mistake – response is meant to only be used from parse. I think it works fine as part of a list of actions returned from a command method, but is redundant.
Thanks for your response, I finally manage to understand and Yes I think this is a copy/paste mistake. I hope you don’t mind to be mentioned for Zwave related questions (nobody on IRC sound zwave skilled).