Passing text string to Sliders

Hi,
My very first time here and obviously new to Node Red and this Forum.

I'm reading a text file ( here simulated by the inject node ). My goal is to adjust each Channel Slider according to the Value that is accompanied by a Channel Nr in that text file.
So in this example CH001 slider would set itself to the value of 106, CH002 to 158 and CH003 to 197. However all sliders end up getting set to the value 197 ( the last msg value ). I was hoping that filling out the Topic ( for example CH001 ) in the Slider Properties would separate message so that the value of topic CH001 would only be received by Slider CH001. What am I missing here?

Thanks for any input,
Carlo

[{"id":"5dbd6aae.3d5124","type":"ui_slider","z":"a840de6f.0b062","name":"","label":"CH 001","tooltip":"","group":"e272ee6a.44d86","order":3,"width":"5","height":"1","passthru":true,"outs":"all","topic":"\"CH001\"","min":0,"max":"255","step":1,"x":1120,"y":280,"wires":[["4746a8b0.444478"]]},{"id":"4746a8b0.444478","type":"ui_text","z":"a840de6f.0b062","group":"e272ee6a.44d86","order":4,"width":"1","height":"1","name":"T001","label":"","format":"{{msg.payload}}","layout":"row-right","x":1290,"y":280,"wires":[]},{"id":"8f74432b.8fa44","type":"ui_slider","z":"a840de6f.0b062","name":"","label":"CH 002","tooltip":"","group":"e272ee6a.44d86","order":5,"width":"5","height":"1","passthru":true,"outs":"all","topic":"CH002","min":0,"max":"255","step":1,"x":1120,"y":340,"wires":[["e9a618e.4341fe8"]]},{"id":"e9a618e.4341fe8","type":"ui_text","z":"a840de6f.0b062","group":"e272ee6a.44d86","order":6,"width":"1","height":"1","name":"T002","label":"","format":"{{msg.payload}}","layout":"row-right","x":1290,"y":340,"wires":[]},{"id":"d04a58a3.782b88","type":"ui_slider","z":"a840de6f.0b062","name":"","label":"CH 003","tooltip":"","group":"e272ee6a.44d86","order":7,"width":"5","height":"1","passthru":true,"outs":"all","topic":"CH003","min":0,"max":"255","step":1,"x":1120,"y":400,"wires":[["4893552d.3d735c"]]},{"id":"4893552d.3d735c","type":"ui_text","z":"a840de6f.0b062","group":"e272ee6a.44d86","order":8,"width":"1","height":"1","name":"T003","label":"","format":"{{msg.payload}}","layout":"row-right","x":1290,"y":400,"wires":[]},{"id":"cc646ea9.adfa4","type":"json","z":"a840de6f.0b062","name":"","property":"payload","action":"obj","pretty":false,"x":610,"y":340,"wires":[["37765bb8.0c5a04","61c30eec.ac28e"]]},{"id":"20b3ab49.68f154","type":"debug","z":"a840de6f.0b062","name":"AFTER SPLIT","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1140,"y":480,"wires":[]},{"id":"37765bb8.0c5a04","type":"split","z":"a840de6f.0b062","name":"","splt":"","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":850,"y":340,"wires":[["5dbd6aae.3d5124","8f74432b.8fa44","d04a58a3.782b88","20b3ab49.68f154"]]},{"id":"61c30eec.ac28e","type":"debug","z":"a840de6f.0b062","name":"AFTER JSON","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":860,"y":480,"wires":[]},{"id":"605a846e.7f9a5c","type":"inject","z":"a840de6f.0b062","name":"Sym Read Txt File","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"CH001\":106,\"CH002\":158,\"CH003\":197}","payloadType":"str","x":410,"y":340,"wires":[["cc646ea9.adfa4"]]},{"id":"e272ee6a.44d86","type":"ui_group","name":"DMX Controller","tab":"a6af63fa.37a9b","order":2,"disp":true,"width":"6","collapse":false},{"id":"a6af63fa.37a9b","type":"ui_tab","name":"DMX","icon":"dashboard","order":5,"disabled":false,"hidden":false}]

OK, I found a solution that works by using a switch node. But if there is a better way to do it please let me know.

[{"id":"5dbd6aae.3d5124","type":"ui_slider","z":"a840de6f.0b062","name":"","label":"TS 001","tooltip":"","group":"2d3f4f8e.b96e9","order":3,"width":"5","height":"1","passthru":true,"outs":"end","topic":"CH001","min":0,"max":"255","step":1,"x":1120,"y":280,"wires":[["4746a8b0.444478"]]},{"id":"4746a8b0.444478","type":"ui_text","z":"a840de6f.0b062","group":"2d3f4f8e.b96e9","order":4,"width":"1","height":"1","name":"S001","label":"","format":"{{msg.payload}}","layout":"row-right","x":1290,"y":280,"wires":[]},{"id":"8f74432b.8fa44","type":"ui_slider","z":"a840de6f.0b062","name":"","label":"TS 002","tooltip":"","group":"2d3f4f8e.b96e9","order":5,"width":"5","height":"1","passthru":true,"outs":"all","topic":"CH002","min":0,"max":"255","step":1,"x":1120,"y":340,"wires":[["e9a618e.4341fe8"]]},{"id":"e9a618e.4341fe8","type":"ui_text","z":"a840de6f.0b062","group":"2d3f4f8e.b96e9","order":6,"width":"1","height":"1","name":"S002","label":"","format":"{{msg.payload}}","layout":"row-right","x":1290,"y":340,"wires":[]},{"id":"d04a58a3.782b88","type":"ui_slider","z":"a840de6f.0b062","name":"","label":"TS 003","tooltip":"","group":"2d3f4f8e.b96e9","order":7,"width":"5","height":"1","passthru":true,"outs":"all","topic":"CH003","min":0,"max":"255","step":1,"x":1120,"y":400,"wires":[["4893552d.3d735c"]]},{"id":"4893552d.3d735c","type":"ui_text","z":"a840de6f.0b062","group":"2d3f4f8e.b96e9","order":8,"width":"1","height":"1","name":"S003","label":"","format":"{{msg.payload}}","layout":"row-right","x":1290,"y":400,"wires":[]},{"id":"cc646ea9.adfa4","type":"json","z":"a840de6f.0b062","name":"","property":"payload","action":"obj","pretty":false,"x":610,"y":340,"wires":[["37765bb8.0c5a04","61c30eec.ac28e"]]},{"id":"20b3ab49.68f154","type":"debug","z":"a840de6f.0b062","name":"AFTER SPLIT","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1140,"y":460,"wires":[]},{"id":"37765bb8.0c5a04","type":"split","z":"a840de6f.0b062","name":"","splt":"","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":790,"y":340,"wires":[["20b3ab49.68f154","aca8d2b3.1190b"]]},{"id":"61c30eec.ac28e","type":"debug","z":"a840de6f.0b062","name":"AFTER JSON","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":860,"y":460,"wires":[]},{"id":"605a846e.7f9a5c","type":"inject","z":"a840de6f.0b062","name":"Sym Read Txt File","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"CH001\":11,\"CH002\":22,\"CH003\":33}","payloadType":"str","x":410,"y":340,"wires":[["cc646ea9.adfa4"]]},{"id":"aca8d2b3.1190b","type":"switch","z":"a840de6f.0b062","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"CH001","vt":"str"},{"t":"eq","v":"CH002","vt":"str"},{"t":"eq","v":"CH003","vt":"str"}],"checkall":"true","repair":true,"outputs":3,"x":970,"y":340,"wires":[["5dbd6aae.3d5124"],["8f74432b.8fa44"],["d04a58a3.782b88"]]},{"id":"2d3f4f8e.b96e9","type":"ui_group","name":"Test Sliders","tab":"d472b9d9.eed478","order":1,"disp":true,"width":"6","collapse":false},{"id":"d472b9d9.eed478","type":"ui_tab","name":"RnD","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

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