Trying to connect a limit switch to aux port of pixhawk, and I am successful with reading switch states on pymavlink terminal on VS code, but I want to see it on Mission Planner. Also the pymavlink code doesnt work at all times, sometimes it would detect

Trying to connect a limit switch to aux port of pixhawk, and I am successful with reading switch states on pymavlink terminal on VS code, but I want to see it on Mission Planner. Also the pymavlink code doesnt work at all times, sometimes it would detect button state, other times when I run the code it doesnt. Please help with setting right params up, as well as how to see status on mission planner of these limit switches.
They are essentially buttons, so if you know how to do it for buttons, then it’s basically same for my situation.
Thanks