Replies: 4 comments 2 replies
-
Try adding |
Beta Was this translation helpful? Give feedback.
-
Thanks for your help. /app/node_modules/zigbee-herdsman-converters/index.js:172 I include the lib tuya: and added like you mentioned: |
Beta Was this translation helpful? Give feedback.
-
Hi @Koenkk const tuya = require('zigbee-herdsman-converters/lib/tuya'); const definition = { module.exports = definition; |
Beta Was this translation helpful? Give feedback.
-
I review my entire approach and make some changes on the code. const tuya = require('zigbee-herdsman-converters/lib/tuya'); const definition = { module.exports = definition; |
Beta Was this translation helpful? Give feedback.
-
I bought the avatto brand switch, TS0006 which is not yet supported by zigbee2mqtt. I read that it is possible to create an external conversion to work with the model.
I followed the step by step for models with more than 1 gang but it activates all gangs at once. Now it is showing an error when executing the code from index.js.
Are there any similar external conversion models that work?
Code:
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const definition = {
zigbeeModel: ['TS0006'],
model: '_TZ3000_cvis4qmw',
vendor: 'AVATTO',
description: '4x4 Smart Touch Switch whith Socket',
fromZigbee: [fz.ignore_basic_report, fz.tuya_switch,fz.on_off],
toZigbee: [tz.tuya_switch_state,tz.on_off],
meta: {multiEndpoint: true},
exposes: [e.switch().withEndpoint('l1').setAccess('state', ea.STATE_SET),
e.switch().withEndpoint('l2').setAccess('state', ea.STATE_SET),
e.switch().withEndpoint('l3').setAccess('state', ea.STATE_SET),
e.switch().withEndpoint('l4').setAccess('state', ea.STATE_SET),
e.switch().withEndpoint('l5').setAccess('state', ea.STATE_SET),
e.switch().withEndpoint('l6').setAccess('state', ea.STATE_SET)],
whiteLabel: [
{vendor: 'Norklmes', model: 'MKS-CM-W5'},
{vendor: 'Somgoms', model: 'ZSQB-SMB-ZB'},
{vendor: 'Moes', model: 'WS-EUB1-ZG'},
{vendor: 'AVATTO', model: 'ZGB-WS-EU'},
],
endpoint: (device) => {
// Endpoint selection is made in tuya_switch_state
return {'l1': 1, 'l2': 1, 'l3': 1, 'l4': 1, 'l5': 1, 'l6': 1};
}
};
module.exports = definition;
Beta Was this translation helpful? Give feedback.
All reactions