A novel multifunctional mechanically interlocked switchable rotaxane R4 containing two molecular stations and rotaxane arms terminated with boron-dipyrromethene (BODIPY) fluorophores and its derivatives were synthesized for the first time by CuAAC click reaction. The shuttling motion of macrocycle between the dibenzylammonium and triazolium recognition sites and the distance dependent photoinduced electron transfer process of R4 is demonstrated by utilizing external chemical stimuli (acid/base). Interestingly, the reversible self-assembly process of R4 was recognized by the acid-base molecular switch strategy. Notably, two symmetrical triazolium groups acted as molecular stations, H2PO4 - receptors, and H-bonded donors. Both rotaxane R4 and thread R2 demonstrated excellent optical responses and high selectivity toward H2PO4 - ion. The specific motion and guest-host interactions of mechanically interlocked machines (MIMs) were also further explored by quantum mechanical calculations. The thread R2 also demonstrated to enable the detection of H2PO4 - in RAW 264.7 cells successfully.