Hi,
is his possible in a function to read the msg.payload
with a variable identifier ?
eg.
var tagname = node.name;
// Get name of node eg. LSH3-1.0 (level switch high)
// in the msg.payload there is a value
// LSH_3_1_0 : 40
// So var value could be
// value = msg.payload.LSH_3_1_0
var tag
tag = tagname.replace(".", "");
tag = tag.replace("-", "");
var value = msg.payload[tag];
var ON = (value & (1 << 27)) === 0 ? 0 : 1;
msg.payload = {};
msg.payload = ON;
msg.value = value;
msg.tagname = tagname;
return msg;
Whats is the correct syntax for this ?
Gr.