diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 7a510406d8443..424a07b9bd5bb 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1801,6 +1801,38 @@ const converters = { return {action: `${direction}`}; }, }, + ZYCT202_on: { + cid: 'genOnOff', + type: 'cmdOn', + convert: (model, msg, publish, options) => { + return {action: 'on', action_group: msg.groupid}; + }, + }, + ZYCT202_off: { + cid: 'genOnOff', + type: 'cmdOffWithEffect', + convert: (model, msg, publish, options) => { + return {action: 'off', action_group: msg.groupid}; + }, + }, + ZYCT202_stop: { + cid: 'genLevelCtrl', + type: 'cmdStop', + convert: (model, msg, publish, options) => { + return {action: 'stop', action_group: msg.groupid}; + }, + }, + ZYCT202_up_down: { + cid: 'genLevelCtrl', + type: 'cmdMove', + convert: (model, msg, publish, options) => { + const value = msg.data.data['movemode']; + let action = null; + if (value === 0) action = {'action': 'up-press', 'action_group': msg.groupid}; + else if (value === 1) action = {'action': 'down-press', 'action_group': msg.groupid}; + return action ? action : null; + }, + }, cover_position: { cid: 'genLevelCtrl', type: 'devChange', diff --git a/devices.js b/devices.js index f77ae086cd39a..3a3c1a30ef939 100644 --- a/devices.js +++ b/devices.js @@ -1975,6 +1975,27 @@ const devices = [ }, // Trust + { + zigbeeModel: ['\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000'+ + '\u0000\u0000\u0000\u0000\u0000'], + model: 'ZYCT-202', + vendor: 'Trust', + description: 'Remote control', + supports: 'on, off, stop, up-press, down-press', + fromZigbee: [ + fz.ZYCT202_on, fz.ZYCT202_off, fz.ZYCT202_stop, fz.ZYCT202_up_down, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; + const actions = [ + (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, + }, { zigbeeModel: ['ZLL-DimmableLigh'], model: 'ZLED-2709',