GPS and MOSFET control

Hello!
I have got Heltec V3 and GPS GY-NEO6MV2, works fine under Mestastic. Wants to enable/disable GPS and build circuit with MOSFET described https://meshtastic.org/docs/hardware/devices/heltec-automation/lora32/peripherals/ Also works fine, I can enable/disable GPS by pressing the user button on the Heltec board three times.

But I want to “remote” enable and disable GPS. “Remote” means control MOSFET via mobile app or “enabling the device to turn off the GPS module based on specific conditions or after a set period”. How to prepare “specific condition”?

Regards!

Hardware, relatively easy.

Software, you’ll have to dig in to the Meshtastic source code - I’d be inclined to look at the sensor code as they are sort of plugins - but I’ve yet to fully grok the code myself so it may just require lots of experimentation - or asking the MT crew the best way.