Another way would be to have dedicated Docks. But that would mean having 2, which might not be desired.
To the other Idea:
I think it should work aswell. If you place an Activation Modul next to the Rail, it should track, whether or not something is docked. Then connecting from a button, which...