If you don't need a UI, it would probably be easiest to look into how to send SSH commands from android/iOS/whatever you're using on your phone.
Pseudocode would be something like:
// [Some Imports Here, Probably]
function alarm_app() {
// Your current code
return $some_time_stamp;
}
function main() {
$timestamp = alarm_app();
$user = "john";
$password = "mypassword";
$host = "192.168.100.23";
$port = 22;
// Concatenate your timestamp into the command that you're running via SSH
$command = "sudo python start_motor.py " . $timestamp+(5*60);
$ssh_session = start_session($user, $password, $host, $port);
$ssh_session.send_command($command);
}