i am trying to make a calculation in a function node with 2 input msg.topic value's.
can sombody tell me wath i am doing wrong.
[{"id":"6cbfa85e.a749a8","type":"debug","z":"d5546796.194978","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":570,"y":140,"wires":[]},{"id":"a3818b6a.0226e8","type":"function","z":"d5546796.194978","name":"gekozen dim percentage","func":"msg.payload = 100 - (msg.payload);\nmsg.topic = \"procent2\";\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":320,"wires":[["e32ad161.289ea","55d05e31.bcfa7"]]},{"id":"e32ad161.289ea","type":"debug","z":"d5546796.194978","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":890,"y":320,"wires":[]},{"id":"55d05e31.bcfa7","type":"function","z":"d5546796.194978","name":"r waarde","func":"val1 = msg.r1\nval2 = msg.procent2\n\nmsg.payload = val2 / 100 * val1;\nmsg.topic = \"r\";\nreturn msg;","outputs":1,"noerr":0,"x":640,"y":220,"wires":[["701e536.6d647ac"]]},{"id":"701e536.6d647ac","type":"debug","z":"d5546796.194978","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":890,"y":140,"wires":[]},{"id":"4f36d145.d98a4","type":"ui_slider","z":"d5546796.194978","name":"","label":"Dimmer","group":"fca18ac4.088f68","order":4,"width":"6","height":"1","passthru":true,"topic":"procent","min":"0","max":"100","step":"2","x":380,"y":320,"wires":[["928022ac.2d3ec","a3818b6a.0226e8"]]},{"id":"928022ac.2d3ec","type":"debug","z":"d5546796.194978","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":390,"y":260,"wires":[]},{"id":"958278b7.d96368","type":"ui_numeric","z":"d5546796.194978","name":"","label":"","group":"fca18ac4.088f68","order":6,"width":"2","height":"1","passthru":true,"topic":"r1","format":"{{value}}","min":"0","max":"255","step":"5","x":400,"y":220,"wires":[["55d05e31.bcfa7","6cbfa85e.a749a8"]]},{"id":"aecd66cc.eb29c8","type":"inject","z":"d5546796.194978","name":"","topic":"","payload":"255","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":220,"wires":[["958278b7.d96368"]]},{"id":"afbd0522.4334c8","type":"inject","z":"d5546796.194978","name":"","topic":"","payload":"20","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":320,"wires":[["4f36d145.d98a4"]]},{"id":"fca18ac4.088f68","type":"ui_group","z":"","name":"H801","tab":"92b25a8d.c33e18","order":1,"disp":true,"width":"6"},{"id":"92b25a8d.c33e18","type":"ui_tab","z":"","name":"Test","icon":"dashboard","order":4}]