use the ACTIVE_DEVICES property for that, best if most of the code would be in a active device extention, that handles the remote clients.

ALSO accept the device name AUTO (=DEFAULT?) to connect to the first passing device of that type.