Creating a button pressed event from multi-button device?

I’m working on a device handler for a Leviton 4 button scene controller. I realize that there is one already but I want mine to just act like a set of buttons.

I’m able to parse the button press command from the device, but I’m not sure how to then create a button press event correctly. Is this correct?

The button variable holed 1 to 4, which is the button number parsed from the message:

    result << createEvent(name: "button", value: "pushed", data: [buttonNumber: $button], descriptionText: "$device.displayName button $button was pushed", isStateChange: true)

Or maybe it’s this (with the button number):

    result << createEvent(name: "button", value: $button, data: [buttonNumber: $button], descriptionText: "$device.displayName button $button was pushed", isStateChange: true)

Sorry for the simple question, I’m new to device handler development.

Why not start by copying the DTH for the Aeon Minimote??

1 Like

I’ll check that out.

1 Like

That was just what I needed, thanks!

I now have the lights in my living room working reliably for the first time in about 4 years. The lights are wired to 6 Leviton Z-Wave switches and dimmers which are hidden behind the flat screen TV. There are three Leviton 4 button scene controllers and years ago I set them up with the Leviton remote which has long been missing. This whole deal where those scene controllers talk directly to the Z-Wave dimmers never worked well. Now, these scene controllers just work like multi button remotes and CoRE does the rest!

So now, any mere mortal who is unfamiliar with the vagaries of Z-Wave can just push a button and actually turn on a light. Amazing :slight_smile:

1 Like