Hello, I just started Node-RED recently and I want to display the ui text icon color to green or red depending on the condition set. I know that by using trigger, the icon color can change accordingly but when i replace trigger with Serial node, the icon color only display one color continuously. The data I am sending into Node-RED is from Arduino.
[{"id":"ed47d1a8.4d2a9","type":"serial in","z":"ff9f1009.524c3","name":"","serial":"1e7f3d61.5d2fd3","x":110,"y":220,"wires":[["d1ac1592.bb9128"]]},{"id":"de5a310a.d28bd","type":"ui_text","z":"ff9f1009.524c3","group":"ea91e9a2.78d668","order":0,"width":0,"height":0,"name":"","label":"text","format":"<font color={{msg.color}}><i class=\"fa fa-circle\" style= \"font-size:24px;\"></i></font>","layout":"row-spread","x":510,"y":220,"wires":[]},{"id":"d1ac1592.bb9128","type":"function","z":"ff9f1009.524c3","name":"Test","func":"msg.color=(msg.payload <='100') ?'red':'green';\nreturn msg;","outputs":1,"noerr":0,"x":350,"y":220,"wires":[["de5a310a.d28bd"]]},{"id":"1e7f3d61.5d2fd3","type":"serial-port","z":"","serialport":"COM3","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false,"responsetimeout":"10000"},{"id":"ea91e9a2.78d668","type":"ui_group","z":"","name":"Testing","tab":"951ba2b7.7b00b","disp":true,"width":"6","collapse":false},{"id":"951ba2b7.7b00b","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]