Hi all,
I have created the code below to indicate when a RFID tag has been scanned to trigger a relay. I have also managed to source a scrolling text UI showing all the tags I have scanned.
I would like to be able to change the colour of the text for the tag that is "Unrecognizable" from black to red. Would anyone be able to point me in the right direction with some advice?
Many thanks,
Reece
[{"id":"39874e85.6db4b2","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"f2c62674.f686f8","type":"function","z":"39874e85.6db4b2","name":"Add word to scrolling table","func":"let pay = msg.payload.epc.value;\n\n// Read scrolling table from context\nlet sctab = flow.get(\"sctab\");\n\n// Modify scrolling table by adding msg.payload as first element\nlet size = sctab.unshift(pay);\n\n// Remove last element from scrolling table\nif (size >14) sctab.pop();\n\n// Update context for scrolling text\nflow.set(\"sctab\",sctab);\n\n// Shalow copy updated scrolling table to msg.payload\nmsg.payload.epc.value = [...sctab];\n\nreturn msg;","outputs":1,"noerr":0,"x":1000,"y":680,"wires":[["c828b07d.27622"]]},{"id":"c828b07d.27622","type":"ui_template","z":"39874e85.6db4b2","group":"3bddc066.5a7d3","name":"Scrolling feed","order":3,"width":"0","height":"0","format":"<style>\n\n #tex1 {\n \n font-weight:normal;\n font-size: 10;\n letter-spacing: 4px;\n fill: black;\n \n }\n #tex2 {\n \n font-weight:normal;\n font-size: 10;\n letter-spacing: 4px;\n fill: red;\n \n }\n</style>\n\n\n<svg height=\"300\" width=\"700\" >\n\n<text id=\"tex1\" x=\"10\" y=\"30\" > {{msg.payload.epc.value[0]}} </text>\n<text id=\"tex1\" x=\"10\" y=\"50\" > {{msg.payload.epc.value[1]}} </text>\n<text id=\"tex1\" x=\"10\" y=\"70\" > {{msg.payload.epc.value[2]}} </text>\n<text id=\"tex1\" x=\"10\" y=\"90\" > {{msg.payload.epc.value[3]}} </text>\n<text id=\"tex1\" x=\"10\" y=\"110\" > {{msg.payload.epc.value[4]}} </text>\n<text id=\"tex1\" x=\"10\" y=\"130\" > {{msg.payload.epc.value[5]}} </text>\n<text id=\"tex1\" x=\"10\" y=\"150\" > {{msg.payload.epc.value[6]}} </text>\n<text id=\"tex1\" x=\"10\" y=\"170\" > {{msg.payload.epc.value[7]}} </text>\n<text id=\"tex1\" x=\"10\" y=\"190\" > {{msg.payload.epc.value[8]}} </text>\n<text id=\"tex1\" x=\"10\" y=\"210\" > {{msg.payload.epc.value[9]}} </text>\n<text id=\"tex1\" x=\"10\" y=\"230\" > {{msg.payload.epc.value[10]}} </text>\n<text id=\"tex1\" x=\"10\" y=\"250\" > {{msg.payload.epc.value[11]}} </text>\n<text id=\"tex1\" x=\"10\" y=\"270\" > {{msg.payload.epc.value[12]}} </text>\n<text id=\"tex1\" x=\"10\" y=\"290\" > {{msg.payload.epc.value[13]}} </text>\n<text id=\"tex1\" x=\"10\" y=\"310\" > {{msg.payload.epc.value[14]}} </text>\n<text id=\"tex1\" x=\"10\" y=\"330\" > {{msg.payload.epc.value[15]}} </text>\n</svg>\n\n","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":1240,"y":680,"wires":[[]]},{"id":"85ac60b1.c2dda","type":"inject","z":"39874e85.6db4b2","name":"Unrecognized Tag","topic":"","payload":"{\"epc\":{\"value\":\"urn:epc:raw:96.x2017030608725A011A603D58\"},\"tag\":null,\"rawHex\":null,\"rawDecimal\":null,\"extension\":null}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":410,"y":740,"wires":[["f2c62674.f686f8"]]},{"id":"5dead3c1.354b8c","type":"inject","z":"39874e85.6db4b2","name":"Recognized Tag","topic":"","payload":"{\"epc\":{\"value\":\"urn:epc:raw:80.x66666666666666666666\"},\"tag\":null,\"rawHex\":null,\"rawDecimal\":null,\"extension\":null}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":420,"y":660,"wires":[["f2c62674.f686f8"]]},{"id":"3bddc066.5a7d3","type":"ui_group","z":"","name":"Teste","tab":"977b72ab.186b2","disp":false,"width":"6"},{"id":"977b72ab.186b2","type":"ui_tab","z":"","name":"LAB","icon":"dashboard"}]