To find index there is .findIndex() method
var idx = msg.payload.findIndex(e => e.mac == '1c:87:76:b0:2a:68');
msg.payload = idx;
return msg;
If not found, -1 returned
If there is more than one, index of first occurrence returned.
To find index there is .findIndex() method
var idx = msg.payload.findIndex(e => e.mac == '1c:87:76:b0:2a:68');
msg.payload = idx;
return msg;
If not found, -1 returned
If there is more than one, index of first occurrence returned.