This app waits for a trigger, which I do via tasker, and starts Android Auto instructing it to connect back to AAGateway.
It also allows for starting and stopping the service via an intent, so can do that from tasker too.
You can build it or get it from the Releases section and you have to install it on the master phone.
for more details see my AAGateway