First off, I’m very new to Zigbee development and Homey. I made a device with firmware from ptvo.info that just has 4 inputs (for buttons/switches), that can each do single, double, triple, and hold/release clicks. However, if I change genOnOffSwitchCfg to 0x00 instead of 0x02, it will instead act like an on/off switch (like for a lamp). My device works in Homey right now locally, and I can send the single, double, triple, and hold/release for all 4 buttons, but I am unsure how I can change the functionality of the device via Homey directly on the device itself.
I tried making my own capability called “multiclick” as a boolean and then call:
this.registerMultipleCapabilityListener(
["multiclick.1", "multiclick.2", "multiclick.3", "multiclick.4"], async (value) => {
this.log("MULTICLICK", value);
}
);
but nothing shows up in the UI. I was hoping I could make a toggle switch for each button, so I can change the behavior of each input on the device, but maybe this is already implemented in Homey, if I somehow listen on the correct clusters?
I use multistateInput (cluster 18).
My device is already in Zigbee2MQTT: https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/src/devices/custom_devices_diy.ts#L1289-L1311
This is what Zigbee2MQTT does when I change to multi-click and then back to switch:
//this is for multi-click
Write 0x00124b00279e70d3/4 genOnOffSwitchCfg({"switchType":2}
//this is for switch
Write 0x00124b00279e70d3/4 genOnOffSwitchCfg({"switchType":0}
And this is how the clusters look like in Zigbee2MQTT: