writing a function node for 'null' input -
i have 3 inputs, , them using bool-gate modul. works ok: flag shows "true" or "false", , output passes payloads if condition "true". don't know how realize function node giving out "1" or "0" turn relay on.
for example:
if (node.status === true);{ return node.status;}
or
if (node.status === true);{ msg.payload="1";} else if(node.status !== true){ msg.payload="0";}
`
but haven't found way '1' if payload appears @ input (the 'true'-condition and-gate) or '0' if 'null' comes and-gate. have absolutely new in node-red , js.
Comments
Post a Comment