Node.status using multiple variables

I would like to be able to use the status node to show the status of multiple variables in my function. I can easily show one variable and have looked for examples but have not found any yet. The function:

node.status({text:("Radio"+ " Client: "+ clientStatus)+ " Meter: "+ Meter,fill:red, shape:"dot"});

shows this output:
image

I have 3 variables (Radio, Client, and Meter) and I would like to have the ability to show a red/green dot depending on the variable. Has anyone created a node.status with more than one variable?

here is are two examplese using ternary conditional, you could use it in the node.status() or create a variable.

[{"id":"1ee4694e.f87fe7","type":"inject","z":"5a245aa1.510164","name":"","props":[{"p":"payload"},{"p":"meter","v":"5","vt":"num"},{"p":"clientStatus","v":"2","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":4320,"wires":[["7c38c87d.12ec4","f1483d45.a51088"]]},{"id":"7c38c87d.12ec4","type":"function","z":"5a245aa1.510164","name":"","func":"let  clientStatus  = msg.clientStatus, \nMeter = msg.meter;\nnode.status({text:(\"Radio\"+ \" Client: \"+ clientStatus)+ \" Meter: \"+ Meter,fill:(clientStatus > 2 ? \"red\" : \"green\"), shape:\"dot\"});\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":310,"y":4320,"wires":[["e094f5ce.cd258"]]},{"id":"f1483d45.a51088","type":"function","z":"5a245aa1.510164","name":"","func":"let  clientStatus  = msg.clientStatus, \nMeter = msg.meter,\ncolour = (clientStatus > 2 ? \"red\" : \"green\");\nnode.status({text:(\"Radio\"+ \" Client: \"+ clientStatus)+ \" Meter: \"+ Meter,fill:colour, shape:\"dot\"});\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":290,"y":4380,"wires":[["f2f27d93.3e33e8"]]},{"id":"e094f5ce.cd258","type":"debug","z":"5a245aa1.510164","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":480,"y":4320,"wires":[]},{"id":"f147f1f1.912f58","type":"inject","z":"5a245aa1.510164","name":"","props":[{"p":"payload"},{"p":"meter","v":"5","vt":"num"},{"p":"clientStatus","v":"4","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":4380,"wires":[["7c38c87d.12ec4","f1483d45.a51088"]]},{"id":"f2f27d93.3e33e8","type":"debug","z":"5a245aa1.510164","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":460,"y":4380,"wires":[]}]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.