Setting Up a Rain-Sensing Return Home Feature for a Rover Using Raspberry Pi, Navio2 and ArduRover

I need to install a humidity sensor on my rover so that it can return home in case of rain. I have a Raspberry Pi 4 with a Navio2 board.
The software is ArduRover 4.0, and I am using Mission Planner on a PC.
I connected the control board to pin 14 on the servo rail and through SSH, I set the pin as GPIO 513. I have tested it and the Raspberry correctly reads the sensor state (cat /sys/class/gpio/gpio513/value ).
However, what I cannot figure out is how to set ArduPilot to use the read value to initiate the return to home.
Using Mission Planner, I changed BTN_ENABLE from 0 to 1, set BRD_PWM_COUNT from 8 to 12, and changed BTN_PIN1 from -1 to 55. The problem is that the options BTN_OPTIONS1 and BTN_FUNC1 do not appear in the full parameter list on mission planner.
I tried restarting several times and refreshing the parameters. I also tried the values 54 and 513 for BTN_PIN1. I even tried setting SERVO14_FUNCTION and SERVO13_FUNCTION to GPIO (-1).
How do I set up button1 so that if the sensor measures rain (LOW value), the rover will initiate return to home?

Are the Pi GPIOs directly available to ArduPilot, or should you be using the Pi as a companion computer, monitor the sensor as needed, and use something like MavProxy to send the Return-to-Home command?

Take ArduPilot out of the decision making loop for “is it raining, do we need to RTH?” and just send the Return to Home command.