Tuya PN6 unsupported #26487
Replies: 7 comments 2 replies
|
The support for this device was in fact included in the last release of Zigbee2mqtt but my device was showing a different vendor name. I simply reused the existing converter and modified the vendor name. |
|
Sorry @bidonMarc for my late reply. In /opt/zigbee2mqtt/data/external_converters, create a new js file (ex: tuya_pn6.js) containing this 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 modernExtend = require('zigbee-herdsman-converters/lib/modernExtend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const definition = {
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE204_l8xiyymq'}],
model: 'PN6',
vendor: 'Tuya',
description: '6-way controller',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
configure: tuya.configureMagicPacket,
exposes: [
tuya.exposes.switch(),
tuya.exposes.switchMode2().withEndpoint('l1_l2').withLabel('1-2 channels'),
tuya.exposes.switch().withEndpoint('l1'),
tuya.exposes.switch().withEndpoint('l2'),
tuya.exposes.switchMode2().withEndpoint('l3_l4').withLabel('3-4 channels'),
tuya.exposes.switch().withEndpoint('l3'),
tuya.exposes.switch().withEndpoint('l4'),
tuya.exposes.switchMode2().withEndpoint('l5_l6').withLabel('5-6 channels'),
tuya.exposes.switch().withEndpoint('l5'),
tuya.exposes.switch().withEndpoint('l6'),
tuya.exposes.switchType(),
e.power_on_behavior(['off', 'on']).withAccess(ea.STATE_SET),
],
endpoint: (device) => {
return {l1: 1, l2: 1, l3: 1, l4: 1, l5: 1, l6: 1, state: 1, l1_l2: 1, l3_l4: 1, l5_l6: 1};
},
meta: {
multiEndpoint: true,
tuyaDatapoints: [
[1, 'state_l1', tuya.valueConverter.onOff],
[2, 'state_l2', tuya.valueConverter.onOff],
[3, 'state_l3', tuya.valueConverter.onOff],
[4, 'state_l4', tuya.valueConverter.onOff],
[5, 'state_l5', tuya.valueConverter.onOff],
[6, 'state_l6', tuya.valueConverter.onOff],
[13, 'state', tuya.valueConverter.onOff],
[14, 'power_on_behavior', tuya.valueConverter.powerOnBehaviorEnum],
[107, 'switch_type', tuya.valueConverter.switchType],
[113, 'switch_mode_l1_l2', tuya.valueConverter.switchMode2],
[114, 'switch_mode_l3_l4', tuya.valueConverter.switchMode2],
[115, 'switch_mode_l5_l6', tuya.valueConverter.switchMode2],
]
},
extend: []
};
module.exports = definition;If the manufacturer name is not "_TZE204_l8xiyymq" in your case, simply replace it with the name being showed from the zigbee2mqtt web interface. After that, restart zigbee2mqtt. |
Yes. Try deleting the device and register it again. |
|
So, now i figured out some more things ;-). The folder has to be directly under zigbee2mqtt, no more data-dir, i tnow looks like this: /homeassistant/zigbee2mqtt/external_converters/tuya_pn6.js But it changes nothing to my PN6 actore, also "not supported". If i rename the file to tuya_pn6.mjs and restart the zigbee, this file is renamed to tuya_pn6.mjs.invalid. So it seems the path is working but somethings wrong with the .js file :-( With debug level i see this: z2m: Loaded external converter 'tuya_pn6.js' |
|
Can someone help, i have same issue. I do everything what @dberenguer write, but still same issues. |


Uh oh!
There was an error while loading. Please reload this page.
I recently found this device in the list of supported devices, so I decided to give it a try and order one of these from Aliexpress. The device is shown however as unsupported. Could it be due to the fact that the vendor name being reported is "_TZE204_l8xiyymq" and not "ZSVIOT"? The vendor name is being shown as Unsupported in the frontend. Otherwise, have I to redefine the whole device? (Never did it before...)
Thanks for your time!
All reactions