Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 e = exposes.presets;
- const ea = exposes.access;
- const tuya = require('zigbee-herdsman-converters/lib/tuya');
- const definition = {
- // Since a lot of TuYa devices use the same modelID, but use different datapoints
- // it's necessary to provide a fingerprint instead of a zigbeeModel
- fingerprint: [
- {
- // The model ID from: Device with modelID 'TS0601' is not supported
- // You may need to add \u0000 at the end of the name in some cases
- modelID: 'TS0601',
- // The manufacturer name from: Device with modelID 'TS0601' is not supported.
- manufacturerName: '_TZE204_znvwzxkq',
- },
- ],
- model: 'TS0601',
- vendor: '_TZE204_znvwzxkq',
- description: 'Smart Dimming 3 Gang Switch (3 Gang)',
- fromZigbee: [tuya.fz.datapoints],
- toZigbee: [tuya.tz.datapoints],
- //onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
- configure: tuya.configureMagicPacket,
- exposes: [
- tuya.exposes.lightBrightnessWithMinMax().withEndpoint('l1'),
- tuya.exposes.lightBrightnessWithMinMax().withEndpoint('l2'),
- tuya.exposes.lightBrightnessWithMinMax().withEndpoint('l3'),
- tuya.exposes.countdown().withEndpoint('l1'),
- tuya.exposes.countdown().withEndpoint('l2'),
- tuya.exposes.countdown().withEndpoint('l3'),
- tuya.exposes.lightType().withEndpoint('l1'),
- tuya.exposes.lightType().withEndpoint('l2'),
- tuya.exposes.lightType().withEndpoint('l3'),
- ],
- meta: {
- multiEndpoint: true,
- tuyaDatapoints: [
- [1, 'state_l1', tuya.valueConverter.onOff, {skip: tuya.skip.stateOnAndBrightnessPresent}],
- [2, 'brightness_l1', tuya.valueConverter.scale0_254to0_1000],
- [3, 'min_brightness_l1', tuya.valueConverter.scale0_254to0_1000],
- [4, 'light_type_l1', tuya.valueConverter.lightType],
- [5, 'max_brightness_l1', tuya.valueConverter.scale0_254to0_1000],
- [6, 'countdown_l1', tuya.valueConverter.countdown],
- //
- [7, 'state_l2', tuya.valueConverter.onOff, {skip: tuya.skip.stateOnAndBrightnessPresent}],
- [8, 'brightness_l2', tuya.valueConverter.scale0_254to0_1000],
- [9, 'min_brightness_l2', tuya.valueConverter.scale0_254to0_1000],
- [10, 'light_type_l2', tuya.valueConverter.lightType],
- [11, 'max_brightness_l2', tuya.valueConverter.scale0_254to0_1000],
- [12, 'countdown_l2', tuya.valueConverter.countdown],
- //
- [15, 'state_l3', tuya.valueConverter.onOff, {skip: tuya.skip.stateOnAndBrightnessPresent}],
- [16, 'brightness_l3', tuya.valueConverter.scale0_254to0_1000],
- [17, 'min_brightness_l3', tuya.valueConverter.scale0_254to0_1000],
- [18, 'light_type_l3', tuya.valueConverter.lightType],
- [19, 'max_brightness_l3', tuya.valueConverter.scale0_254to0_1000],
- [12, 'countdown_l3', tuya.valueConverter.countdown],
- ],
- },
- endpoint: (device) => {
- return {'l1': 1, 'l2': 1, 'l3': 1};
- },
- };
- module.exports = definition;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement