Sum function of two sensor data

I've read this:

but it doesn't work.


How can I use it?

[{"id":"123c9490.2e5d7b","type":"ui_numeric","z":"80855e36.822e4","name":"","label":"User input","tooltip":"","group":"3a2a4dcc.dcbe52","order":2,"width":0,"height":0,"passthru":true,"topic":"","format":"{{value}}","min":0,"max":"65535","step":1,"x":132,"y":419,"wires":[["7bfa89f5.6cd918"]]},{"id":"52d1cae0.928e64","type":"ui_text","z":"80855e36.822e4","group":"3a2a4dcc.dcbe52","order":3,"width":0,"height":0,"name":"","label":"Result","format":"{{msg.payload}}","layout":"row-spread","x":670,"y":400,"wires":[]},{"id":"897f5f4f.ba462","type":"change","z":"80855e36.822e4","name":"","rules":[{"t":"set","p":"val1","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":360,"wires":[["8f1ffaa.e986308"]]},{"id":"8f1ffaa.e986308","type":"function","z":"80855e36.822e4","name":"add","func":"var val1 = parseInt(flow.get(\"val1\") || \"0\");\nmsg.payload = parseInt(flow.get(\"val2\") || \"0\") + val1;\nreturn msg;","outputs":1,"noerr":0,"x":530,"y":400,"wires":[["52d1cae0.928e64"]]},{"id":"7bfa89f5.6cd918","type":"change","z":"80855e36.822e4","name":"","rules":[{"t":"set","p":"val2","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":420,"wires":[["8f1ffaa.e986308"]]},{"id":"a5bad124.1f4b9","type":"ui_numeric","z":"80855e36.822e4","name":"","label":"User input","tooltip":"","group":"3a2a4dcc.dcbe52","order":2,"width":0,"height":0,"passthru":true,"topic":"","format":"{{value}}","min":0,"max":"65535","step":1,"x":130,"y":360,"wires":[["897f5f4f.ba462"]]},{"id":"3a2a4dcc.dcbe52","type":"ui_group","z":"","name":"Default","tab":"7a83039f.32968c","disp":true,"width":"6","collapse":false},{"id":"7a83039f.32968c","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]