Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This converter is based on converters MG-ZG01W, MG-ZG02W, MG-ZG03W
- // for the one, two and three gang switches which work with those
- // switches from the same supplier.
- // I copied the fingerprint from Zigbee Model and Manufacturer
- // found by Z2M in unsupported device.
- import * as tuya from 'zigbee-herdsman-converters/lib/tuya';
- const e = exposes.presets;
- export default {
- fingerprint: tuya.fingerprint('TS0601', ['_TZE204_mexisfik']),
- model: 'MG-ZG04W',
- vendor: 'TuYa',
- description: '4 gang switch',
- fromZigbee: [tuya.fz.datapoints],
- toZigbee: [tuya.tz.datapoints],
- configure: tuya.configureMagicPacket,
- 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),
- ],
- 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],
- ],
- },
- endpoint: (device) => {
- return {'l1': 1, 'l2': 1, 'l3': 1, 'l4': 1};
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement