I'm pulling in my alarm bits (8 of them) from modbus. Each bit represents a different fault (so there are 8 possible faults). Any combination of these bits may turn on at a time. if I have 2 faults, 2 messages will be displayed. If I have 1 fault, only 1 will be displayed.
Here I have 2 faults.
The problem I'm having each bit is its own msg.payload. So I have to combine them into a msg array for the ui-table. Then if no fault, I have to remove that bit from the array so it doesn't show in the ui-table.
below is where I'm at right now.
[{"id":"59f3e1c6.409f8","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"b2b00574.9c0b38","type":"ui_table","z":"59f3e1c6.409f8","group":"37b5f1bd.773eae","name":"","order":1,"width":"6","height":"4","columns":[],"outputs":1,"cts":true,"x":1170,"y":280,"wires":[["96345a40.ecad88"]]},{"id":"96345a40.ecad88","type":"function","z":"59f3e1c6.409f8","name":"add to schedule","func":"var x;\nvar msg1;\n\n\n\nmsg1 = {payload: flow.get(\"fault1\")}; msg1.payload[1] = flow.get(\"fault2\")[0];\n//msg1.payload[0] = flow.get(\"fault1\");\n//msg1.payload[1] = flow.get(\"fault2\");\n//msg1.payload[1] = flow.get(\"fault2\");\n\nreturn msg1; \n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":980,"y":280,"wires":[["b2b00574.9c0b38","ec1a2fbd.07bf8"]]},{"id":"6b658f0a.879d6","type":"change","z":"59f3e1c6.409f8","name":"construct alarm 2 payload","rules":[{"t":"set","p":"fault2","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":420,"wires":[["96345a40.ecad88"]]},{"id":"59065549.56f70c","type":"change","z":"59f3e1c6.409f8","name":"construct alarm 1 payload","rules":[{"t":"set","p":"fault1","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":200,"wires":[["96345a40.ecad88","582dbdf1.99e134"]]},{"id":"ec1a2fbd.07bf8","type":"debug","z":"59f3e1c6.409f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1160,"y":220,"wires":[]},{"id":"ab231ba7.903f98","type":"comment","z":"59f3e1c6.409f8","name":"combines all messages","info":"prepare payload of alarms to deliver to table","x":980,"y":320,"wires":[]},{"id":"582dbdf1.99e134","type":"debug","z":"59f3e1c6.409f8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1030,"y":160,"wires":[]},{"id":"2735c37.ffcca3c","type":"switch","z":"59f3e1c6.409f8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":490,"y":380,"wires":[["6b658f0a.879d6"],[]]},{"id":"d3f6eaa.ff1e418","type":"switch","z":"59f3e1c6.409f8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":470,"y":220,"wires":[["59065549.56f70c"],[]]},{"id":"1c809828.7cd998","type":"inject","z":"59f3e1c6.409f8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"alarm","v":"all_fault","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"fault2","payload":"1","payloadType":"str","x":140,"y":360,"wires":[["2ca744e2.8e662c"]]},{"id":"f11e3bc1.526ce8","type":"inject","z":"59f3e1c6.409f8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"alarm","v":"all_fault","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"fault2","payload":"0","payloadType":"str","x":130,"y":440,"wires":[["2ca744e2.8e662c"]]},{"id":"206e7f9c.c0e69","type":"inject","z":"59f3e1c6.409f8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"alarm","v":"all_fault","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"fault1","payload":"1","payloadType":"str","x":130,"y":180,"wires":[["d90a5af8.507868"]]},{"id":"8570b6a8.7bc3c8","type":"inject","z":"59f3e1c6.409f8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"alarm","v":"all_fault","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"fault1","payload":"0","payloadType":"str","x":130,"y":240,"wires":[["d90a5af8.507868"]]},{"id":"d90a5af8.507868","type":"rbe","z":"59f3e1c6.409f8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":350,"y":220,"wires":[["d3f6eaa.ff1e418"]]},{"id":"2ca744e2.8e662c","type":"rbe","z":"59f3e1c6.409f8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":350,"y":380,"wires":[["2735c37.ffcca3c"]]},{"id":"73c9678e.36c628","type":"comment","z":"59f3e1c6.409f8","name":"alarm 1","info":"","x":70,"y":140,"wires":[]},{"id":"b77f12a.3e75df","type":"comment","z":"59f3e1c6.409f8","name":"alarm 2","info":"","x":90,"y":400,"wires":[]},{"id":"37b5f1bd.773eae","type":"ui_group","name":"1750+ 1 alarms","tab":"78efbcf6.3781f4","order":2,"disp":true,"width":"6","collapse":false},{"id":"78efbcf6.3781f4","type":"ui_tab","name":"Scheduler","icon":"autorenew","order":2,"disabled":false,"hidden":false}]