Yesterday, 07:36
data16 must sent as a byte array.
Try this, you might need to swap b1 and b2 if the byte order is incorrect:
Try this, you might need to swap b1 and b2 if the byte order is incorrect:
Code:
local mode = event.getvalue()
local b1 = bit.band(bit.rshift(mode, 8), 0xFF)
local b2 = bit.band(mode, 0xFF)
local data = { b1, b2 }
local res, err = zb.cmdsync('setrawattribute', address, 64513, 0, data, 'data16', manufcode)