Thanks for your reply. Here is the flow that I modified, but still can not solve the problem, maybe its because I linked them in the wrong way. Could you please give me some more details. Thanks!
[{"id":"dc9576df.df7678","type":"mqtt in","z":"bf6ed410.bc2df8","name":"up","topic":"molly-pycom-device/devices/orangefipy/up","qos":"2","datatype":"auto","broker":"fb1bb5ab.f1c4c8","x":210,"y":800,"wires":[["980184f9.cab908"]]},{"id":"be59d29e.3e5a5","type":"function","z":"bf6ed410.bc2df8","name":"light downlink","func":"var payload = msg.payload.payload_fields.light;\n\nreturn {\n topic: 'molly-pycom-device/devices/orangefipy/down',\n payload: {\n port: 2,\n confirmed: true,\n payload_raw: Buffer.from(\"\"+payload).toString('base64'),\n schedule: 'last'\n }\n};","outputs":1,"noerr":0,"x":560,"y":800,"wires":[["49d1f256.f0fcbc"]]},{"id":"49d1f256.f0fcbc","type":"mqtt out","z":"bf6ed410.bc2df8","name":"","topic":"molly-pycom-device/devices/orangefipy/down","qos":"0","retain":"false","broker":"fb1bb5ab.f1c4c8","x":970,"y":800,"wires":[]},{"id":"d0f7d187.5e49e","type":"mqtt out","z":"bf6ed410.bc2df8","name":"down","topic":"molly-pycom-device/devices/orangefipy/down","qos":"1","retain":"false","broker":"fb1bb5ab.f1c4c8","x":710,"y":960,"wires":[]},{"id":"38789e18.c58752","type":"function","z":"bf6ed410.bc2df8","name":"manual downlink","func":"var payload = msg.payload;\nreturn {\n topic: 'molly-pycom-device/devices/orangefipy/down',\n payload: {\n port: 2,\n confirmed: true,\n payload_raw: Buffer.from(\"\"+payload).toString('base64'),\n schedule: 'replace'\n }\n};","outputs":1,"noerr":0,"x":510,"y":960,"wires":[["d0f7d187.5e49e"]]},{"id":"980184f9.cab908","type":"json","z":"bf6ed410.bc2df8","name":"","property":"payload","action":"","pretty":false,"x":350,"y":800,"wires":[["be59d29e.3e5a5"]]},{"id":"ab91476e.a80c68","type":"ui_switch","z":"bf6ed410.bc2df8","name":"","label":"switch","tooltip":"","group":"73325e5b.3dcd4","order":2,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"molly-pycom-device/devices/orangefipy/down","style":"","onvalue":"[48]","onvalueType":"bin","onicon":"","oncolor":"","offvalue":"[50,48,48]","offvalueType":"bin","officon":"","offcolor":"","x":310,"y":960,"wires":[["38789e18.c58752"]]},{"id":"c27f44a8.7cef08","type":"change","z":"bf6ed410.bc2df8","name":"change","rules":[{"t":"set","p":"auto","pt":"flow","to":"payload?true:false","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":880,"wires":[["d51d19c4.a200a8"]]},{"id":"d51d19c4.a200a8","type":"switch","z":"bf6ed410.bc2df8","name":"","property":"auto","propertyType":"flow","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":880,"wires":[["49d1f256.f0fcbc"]]},{"id":"b96424e3.d4e328","type":"ui_switch","z":"bf6ed410.bc2df8","name":"","label":"auto switch","tooltip":"","group":"73325e5b.3dcd4","order":3,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":250,"y":880,"wires":[["c27f44a8.7cef08"]]},{"id":"fb1bb5ab.f1c4c8","type":"mqtt-broker","z":"","name":"","broker":"eu.thethings.network","port":"1883","tls":"","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"2","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"73325e5b.3dcd4","type":"ui_group","z":"","name":"Light","tab":"ce75d44a.fb5a18","disp":true,"width":"6","collapse":false},{"id":"ce75d44a.fb5a18","type":"ui_tab","z":"","name":"Lora","icon":"dashboard","order":2}]