@iz3man hey man, i tried digging into the zigbee-herdsman converter but gave up yesterday because i didnt really have time. just looked back at it and im pretty sure i have a solution! will try to implement it today and i will let you know
edit: fully functional now with the following lines
i added my own converter for the 2 bottom buttons, everything works now but im thinking about re-doing the other 2 buttons from scratch so i can get a uniform payload-format.
my 2 files look like this now:
devices.js:
{
zigbeeModel: ['lumi.remote.b686opcn01'],
model: 'WXCJKG13LM',
vendor: 'Xiaomi',
description: 'Aqara OPPLE 6btn Switch',
supports: '6 buttons, single, double and long click',
fromZigbee: [ fz.WXCJKG13LM_raw, fz.tint404011_on, fz.tint404011_off, fz.tint404011_brightness_updown_hold, fz.tint404011_brightness_updown_click, fz.tint404011_brightness_updown_release, fz.WXKG02LM_click_multistate ],
toZigbee: [],
},
fromZigbee.js:
WXCJKG13LM_raw: {
cluster: 'lightingColorCtrl',
type: 'raw',
convert: (model, msg, publish, options) => {
// i dont know yet what all the numbers do, the ones i know are below. other ones are not neccesary imo?
// #2 is a counter that increments with each click
// #4 is the button, 1 is left and 3 is right
// #5 is the action, 69 as single click and 15 as hold.
// if #5 is 15 and the button is 0 it means the last button was released
const deviceID = msg.device.ieeeAddr;
const btn_lookup = {
0: 'btn_rls',
1: 'btn_l',
3: 'btn_r',
},
act_lookup = {
69: 'click',
15: 'hold',
},
button = btn_lookup[msg.data[3]],
action = act_lookup[msg.data[4]];
if (button && action) {
// Save last button for release event if action is hold, but not if its released
if (action == 'hold' && button != 'btn_rls'){
if (!store[deviceID]) {
store[deviceID] = {};
}
store[deviceID].button = button;
}
if (button == 'btn_rls'){
if (!store[deviceID]) {
return null;
}
return {'button': store[deviceID].button, 'action': 'release'};
}
return {'button': button, 'action': action};
}
},
},
i know the formatting is messed up right now but i see no point in fixing it if im gonna mess it up again will fix it once im done