Try this, I have split the topic and used the last value to create the payload, then in your function i have referenced these payload propeties
eg.
[{"id":"729cda57.87488c","type":"change","z":"5a245aa1.510164","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"$split(topic, \"/\")[-1]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":3940,"wires":[["350850d1.a621"]]},{"id":"882513f.6bf8af","type":"mqtt in","z":"5a245aa1.510164","name":"","topic":"name/sensor/soil1/value","qos":"2","datatype":"auto","broker":"","x":130,"y":3940,"wires":[["729cda57.87488c"]]},{"id":"1f28993a.435c87","type":"mqtt in","z":"5a245aa1.510164","name":"","topic":"name/sensor/soil1/min","qos":"2","datatype":"auto","broker":"","x":120,"y":4060,"wires":[["729cda57.87488c"]]},{"id":"60f23533.0a8bcc","type":"mqtt in","z":"5a245aa1.510164","name":"","topic":"name/power/relay1/stage","qos":"2","datatype":"auto","broker":"","x":130,"y":3820,"wires":[["729cda57.87488c"]]},{"id":"3d97dff0.d1077","type":"mqtt in","z":"5a245aa1.510164","name":"","topic":"name/sensor/soil1/max","qos":"2","datatype":"auto","broker":"","x":120,"y":4000,"wires":[["729cda57.87488c"]]},{"id":"52075a8c.092b54","type":"mqtt in","z":"5a245aa1.510164","name":"","topic":"name/power/relay1/auto","qos":"2","datatype":"auto","broker":"","x":130,"y":3880,"wires":[["729cda57.87488c"]]},{"id":"350850d1.a621","type":"join","z":"5a245aa1.510164","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"1","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":610,"y":3940,"wires":[["15cf54a0.38e2e3","7e7f42ee.4313cc"]]},{"id":"15cf54a0.38e2e3","type":"function","z":"5a245aa1.510164","name":"","func":"var relay_stage = String(msg.payload.stage);\nvar auto_mode = String(msg.payload.auto);\nvar soil_val = Number(msg.payload.value);\nvar soil_max = Number(msg.payload.max);\nvar soil_min = Number(msg.payload.min);\n\nif (auto_mode == \"on\"){\n if (soil_val >= soil_max && relay_stage == \"on\"){\n msg.payload = \"off\";\n return msg;\n }\n else if (soil_val <= soil_min && relay_stage == \"off\"){\n msg.payload = \"on\";\n return msg;\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":770,"y":3940,"wires":[["7e7f42ee.4313cc"]]},{"id":"7e7f42ee.4313cc","type":"debug","z":"5a245aa1.510164","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":770,"y":4100,"wires":[]}]