The flow (the other one) is looking good.
This one:
The data does come from the sliders set.
(Well.... Kind of.)
The sliders set the flow context. Then the message goes down to a join
node.
That gets the 3 messages (RGB) and joins them together to make the message to send to the LED.
I just don't understand the terms to describe the types of messages to create from the join.
I'm making slow progress though. but am open to help with what type of message I want to create coming out of the join
node.
It really needs to be text.
Update:
Ok. I NEARLY have it working now.
No. Sorry, I am missing something.
Here's what I have.
Excuse the mess. It is very much Work In Progress.
[{"id":"35372c65.4d2b44","type":"inject","z":"aad05e94.e66068","name":"R","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":850,"y":40,"wires":[["b6e196cfdabe0b9f"]]},{"id":"0e626f214207980d","type":"inject","z":"aad05e94.e66068","name":"G","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2","payloadType":"num","x":850,"y":80,"wires":[["f897fd3f34685f74"]]},{"id":"a6471d5af6829c96","type":"inject","z":"aad05e94.e66068","name":"B","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"3","payloadType":"num","x":850,"y":120,"wires":[["b2092751f72b5254"]]},{"id":"b6e196cfdabe0b9f","type":"function","z":"aad05e94.e66068","name":"function 21","func":"const colour = \"red\";\n\n\nlet value = msg.payload;\nlet colourarray = flow.get(colour) || []; // to be sure...\n//node.warn(colour + \" \" + colourarray);\nlet led = flow.get(\"led\") || 0;\n//node.warn(\"LED \" + led);\ncolourarray[led] = value;\n//node.warn(\"Value \" + value);\nflow.set(colour, colourarray); // <--- it's just 'red' here...\n\nmsg[colour] = value;\nmsg.led = led;\nmsg.payload = \"\";\nmsg.count = 1;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":160,"wires":[["7d60d18efd5768f4"]]},{"id":"f897fd3f34685f74","type":"function","z":"aad05e94.e66068","name":"function 22","func":"const colour = \"green\";\n\n\nlet value = msg.payload;\nlet colourarray = flow.get(colour) || []; // to be sure...\n//node.warn(colour + \" \" + colourarray);\nlet led = flow.get(\"led\") || 0;\n//node.warn(\"LED \" + led);\ncolourarray[led] = value;\n//node.warn(\"Value \" + value);\nflow.set(colour, colourarray); // <--- it's just 'red' here...\n\nmsg[colour] = value;\nmsg.led = led;\nmsg.payload = \"\";\nmsg.count = 2;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":250,"wires":[["7d60d18efd5768f4"]]},{"id":"b2092751f72b5254","type":"function","z":"aad05e94.e66068","name":"function 23","func":"const colour = \"blue\";\n\n\nlet value = msg.payload;\nlet colourarray = flow.get(colour) || []; // to be sure...\n//node.warn(colour + \" \" + colourarray);\nlet led = flow.get(\"led\") || 0;\n//node.warn(\"LED \" + led);\ncolourarray[led] = value;\n//node.warn(\"Value \" + value);\nflow.set(colour, colourarray); // <--- it's just 'red' here...\n\nmsg[colour] = value;\nmsg.led = led;\nmsg.payload = \"\";\nmsg.count = 3;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":340,"wires":[["7d60d18efd5768f4"]]},{"id":"80710d1c90418e74","type":"function","z":"aad05e94.e66068","name":"check led is set.","func":"let led = flow.get(\"led\");\nif (led == undefined)\n{\n led = 0;\n}\nmsg.payload = led;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":815,"y":250,"wires":[["5bcad49e022276f6","70ad4dc8f6934651","b1261f7c8bbfd9ec","ed98e13865cb8bd3"]],"l":false},{"id":"7d60d18efd5768f4","type":"junction","z":"aad05e94.e66068","x":740,"y":250,"wires":[["80710d1c90418e74"]]},{"id":"5bcad49e022276f6","type":"join","z":"aad05e94.e66068","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":960,"y":250,"wires":[["b8fa5a143c8d46e0"]]},{"id":"b8fa5a143c8d46e0","type":"function","z":"aad05e94.e66068","name":"Get LED","func":"msg.led = flow.get(\"led\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1045,"y":250,"wires":[["10cea6927ad0f342"]],"l":false},{"id":"10cea6927ad0f342","type":"template","z":"aad05e94.e66068","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"rgb,{{led}},{{payload}}","output":"str","x":1180,"y":250,"wires":[["b3889d2734bf3fd4","5519e5f0.fe798c"]]},{"id":"5519e5f0.fe798c","type":"debug","z":"aad05e94.e66068","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1160,"y":200,"wires":[]},{"id":"70ad4dc8f6934651","type":"switch","z":"aad05e94.e66068","name":"","property":"red","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":1055,"y":70,"wires":[["51c7bfa856021aca"]],"l":false},{"id":"51c7bfa856021aca","type":"debug","z":"aad05e94.e66068","name":"RED sent","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1150,"y":70,"wires":[]},{"id":"b1261f7c8bbfd9ec","type":"switch","z":"aad05e94.e66068","name":"","property":"green","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":1055,"y":110,"wires":[["02072a97ee82277e"]],"l":false},{"id":"02072a97ee82277e","type":"debug","z":"aad05e94.e66068","name":"GREEN sent","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1160,"y":110,"wires":[]},{"id":"ed98e13865cb8bd3","type":"switch","z":"aad05e94.e66068","name":"","property":"blue","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":1055,"y":150,"wires":[["604d314712cea41f"]],"l":false},{"id":"604d314712cea41f","type":"debug","z":"aad05e94.e66068","name":"BLUE sent","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1160,"y":150,"wires":[]}]
The unnamed debug
is the important one.
But it is not getting the stored values.
It is getting the LED value for the RGB values.
Stuck how I fix this.
Oh, you may need to set flow context.
Piccie may help