Advertisement
bdnstn

mg-zg04w.mjs

Jun 12th, 2025
1,047
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // This converter is based on converters MG-ZG01W, MG-ZG02W, MG-ZG03W
  2. // for the one, two and three gang switches which work with those
  3. // switches from the same supplier.
  4. // I copied the fingerprint from Zigbee Model and Manufacturer
  5. // found by Z2M in unsupported device.
  6.  
  7. import * as tuya from 'zigbee-herdsman-converters/lib/tuya';
  8. const e = exposes.presets;
  9.  
  10. export default {
  11.     fingerprint: tuya.fingerprint('TS0601', ['_TZE204_mexisfik']),
  12.     model: 'MG-ZG04W',
  13.     vendor: 'TuYa',
  14.     description: '4 gang switch',
  15.     fromZigbee: [tuya.fz.datapoints],
  16.     toZigbee: [tuya.tz.datapoints],
  17.     configure: tuya.configureMagicPacket,
  18.     exposes: [
  19.         e.switch().withEndpoint('l1').setAccess('state', ea.STATE_SET),
  20.         e.switch().withEndpoint('l2').setAccess('state', ea.STATE_SET),
  21.         e.switch().withEndpoint('l3').setAccess('state', ea.STATE_SET),
  22.         e.switch().withEndpoint('l4').setAccess('state', ea.STATE_SET),
  23.     ],
  24.     meta: {
  25.         multiEndpoint: true,
  26.         tuyaDatapoints: [
  27.             [1, 'state_l1', tuya.valueConverter.onOff],
  28.             [2, 'state_l2', tuya.valueConverter.onOff],
  29.             [3, 'state_l3', tuya.valueConverter.onOff],
  30.             [4, 'state_l4', tuya.valueConverter.onOff],
  31.         ],
  32.     },
  33.     endpoint: (device) => {
  34.         return {'l1': 1, 'l2': 1, 'l3': 1, 'l4': 1};
  35.     }
  36. }
Advertisement
Comments
  • responsive02
    8 days
    # text 0.27 KB | 0 0
    1.  
    2. https://bigwarp.io/jq3lr11jg7v3
    3.  
    4. https://bigwarp.io/oic40kp7dh27
    5.  
    6. https://bigwarp.io/xc13z8c97ulu
    7.  
    8. https://bigwarp.io/7quiw47fvo2p
    9.  
    10. https://bigwarp.io/15hyup7w20yd
    11.  
    12. https://bigwarp.io/oducs5mwo4jc
    13.  
    14. https://bigwarp.io/pa8cvmyhcwew
    15.  
    16. https://bigwarp.io/kp0k87pkrb80
Add Comment
Please, Sign In to add comment
Advertisement