Gawan
1
Hi,
is there a chance to extract a value from a string, e.g.
tele/SP111_131308/#
(i need the value between the slashes)
and would like to use it as a global Variable:
global.set ("SP111_131308.State", msg.payload.Switch_State);
Is this even possible in NR ?
BR
Gawan
E1cid
2
let topic = msg.topic.split("/")[1];
global.set (topic + ".State", msg.payload.Switch_State);
2 Likes
system
Closed
3
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.