Payload concatenate from slider input

i have 3 sliders on the node red dashboard. one for brightness, one for saturation, and one for speed, of a rgb strip animation(done outside node red). i want to get these 3 values, and concatenate them into one payload with this format :"/speed,brightness,saturation", with the press of a button to send it.
How could i do it? I've tried the join node, but wasn't able to make it send only when the button is pressed, and couldn't figure out how to set the topics as the order matters.

You could save each slider output in a context variable eg flow.saturation.
When the button is pressed use a function node to retrieve the values and format your string.
You will have to make sure each variable has a value before sending the payload to the other application.

Use a flow variable as object and change the properties with slider. Then use a change node and send the updated flow varible.

[{"id":"d8c7542fd1ba1637","type":"ui_slider","z":"3ab40be9bd525d05","name":"speed","label":"Speed","tooltip":"","group":"113ae86234f6470e","order":0,"width":0,"height":0,"passthru":true,"outs":"all","topic":"topic","topicType":"msg","min":0,"max":"100","step":1,"className":"","x":520,"y":200,"wires":[["1a518560eae779e7"]]},{"id":"9e7721d7ca7046e0","type":"ui_slider","z":"3ab40be9bd525d05","name":"brightness","label":"Brightness","tooltip":"","group":"113ae86234f6470e","order":0,"width":0,"height":0,"passthru":true,"outs":"all","topic":"topic","topicType":"msg","min":0,"max":"100","step":1,"className":"","x":510,"y":260,"wires":[["acd0c8c15e532c29"]]},{"id":"8355edf466bb525d","type":"ui_slider","z":"3ab40be9bd525d05","name":"saturation","label":"Saturation","tooltip":"","group":"113ae86234f6470e","order":0,"width":0,"height":0,"passthru":true,"outs":"all","topic":"topic","topicType":"msg","min":0,"max":"100","step":1,"className":"","x":520,"y":320,"wires":[["16758cc073c2affc"]]},{"id":"1a518560eae779e7","type":"change","z":"3ab40be9bd525d05","name":"","rules":[{"t":"set","p":"rgb.speed","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":200,"wires":[["f122103796bad4f7"]]},{"id":"acd0c8c15e532c29","type":"change","z":"3ab40be9bd525d05","name":"","rules":[{"t":"set","p":"rgb.brightness","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":260,"wires":[["f122103796bad4f7"]]},{"id":"16758cc073c2affc","type":"change","z":"3ab40be9bd525d05","name":"","rules":[{"t":"set","p":"rgb.saturation","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":320,"wires":[["f122103796bad4f7"]]},{"id":"f122103796bad4f7","type":"change","z":"3ab40be9bd525d05","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"rgb","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":260,"wires":[["44425e3e6162e389"]]},{"id":"44425e3e6162e389","type":"debug","z":"3ab40be9bd525d05","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1210,"y":260,"wires":[]},{"id":"113ae86234f6470e","type":"ui_group","name":"Standard","tab":"dc25fe35.866f","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"dc25fe35.866f","type":"ui_tab","name":"Test","icon":"dashboard","order":17,"disabled":false,"hidden":false}]

didn't know about this context variables. thank you so much!

To initialize the flow variable - just use an inject node to set the object.

It seems however that the slider node doesn't pass through the payload - so you have to set the flow variable in addition.

[{"id":"a0f0f1786925ec5c","type":"ui_slider","z":"4d10480e58e652d4","name":"speed","label":"Speed","tooltip":"","group":"113ae86234f6470e","order":0,"width":0,"height":0,"passthru":true,"outs":"all","topic":"topic","topicType":"msg","min":0,"max":"100","step":1,"className":"","x":490,"y":200,"wires":[["a8937c5d4ba2beaa"]]},{"id":"26467b7c4dd57b7a","type":"ui_slider","z":"4d10480e58e652d4","name":"brightness","label":"Brightness","tooltip":"","group":"113ae86234f6470e","order":0,"width":0,"height":0,"passthru":true,"outs":"all","topic":"topic","topicType":"msg","min":0,"max":"100","step":1,"className":"","x":480,"y":260,"wires":[["1748622aa205d519"]]},{"id":"7a2064a0d55a5e4d","type":"ui_slider","z":"4d10480e58e652d4","name":"saturation","label":"Saturation","tooltip":"","group":"113ae86234f6470e","order":0,"width":0,"height":0,"passthru":true,"outs":"all","topic":"topic","topicType":"msg","min":0,"max":"100","step":1,"className":"","x":490,"y":320,"wires":[["6ab334a1fe02b0d3"]]},{"id":"a8937c5d4ba2beaa","type":"change","z":"4d10480e58e652d4","name":"","rules":[{"t":"set","p":"rgb.speed","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":200,"wires":[["cb370b9794771705"]]},{"id":"1748622aa205d519","type":"change","z":"4d10480e58e652d4","name":"","rules":[{"t":"set","p":"rgb.brightness","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":260,"wires":[["cb370b9794771705"]]},{"id":"6ab334a1fe02b0d3","type":"change","z":"4d10480e58e652d4","name":"","rules":[{"t":"set","p":"rgb.saturation","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":320,"wires":[["cb370b9794771705"]]},{"id":"cb370b9794771705","type":"change","z":"4d10480e58e652d4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"rgb","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":260,"wires":[["9d67797187b8bdef"]]},{"id":"9d67797187b8bdef","type":"debug","z":"4d10480e58e652d4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1180,"y":260,"wires":[]},{"id":"5d819752697b08ec","type":"inject","z":"4d10480e58e652d4","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"{\"speed\":70,\"brightness\":70,\"saturation\":70}","payloadType":"json","x":110,"y":120,"wires":[["e66d80bdb76e3603","2903e170e86b181a","27f8ab4303c7d41b","aed978975523a71e"]]},{"id":"e66d80bdb76e3603","type":"change","z":"4d10480e58e652d4","name":"","rules":[{"t":"set","p":"rgb","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":120,"wires":[[]]},{"id":"2903e170e86b181a","type":"change","z":"4d10480e58e652d4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.speed","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":200,"wires":[["a0f0f1786925ec5c"]]},{"id":"27f8ab4303c7d41b","type":"change","z":"4d10480e58e652d4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.brightness","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":260,"wires":[["26467b7c4dd57b7a"]]},{"id":"aed978975523a71e","type":"change","z":"4d10480e58e652d4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.saturation","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":320,"wires":[["7a2064a0d55a5e4d"]]},{"id":"113ae86234f6470e","type":"ui_group","name":"Standard","tab":"dc25fe35.866f","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"dc25fe35.866f","type":"ui_tab","name":"Test","icon":"dashboard","order":17,"disabled":false,"hidden":false}]

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