I was recently sent by an Amuta of sick patients of a rare disease to attend a conference in America. Unfortunately,the main part of the conference took place over Shabbat. Before I left, I clarified how I was to deal with various Halachic issues which I predicted I would have to deal with over Shabat in the hotel.I was however caught totally off guard,when I found myself in a toilet on Shabbat morning which to my horror I realised would electrically activate an automatic flushing reaction if I moved out of the toilet booth. I was faced with the dilemma of spending the whole Shabbat in the toilet booth ,and thereby wasting all the public funds that had been spent to send me to the conference, or leaving the toilet booth and activating the flushing reaction.What would have been the correct Halachic solution to this problem?
There are different approaches on this issue you raised. A similar question will be to pass through a light sensor on the way home. If you have no intention for the automatic switch to go off and your pure intention is to get back to your room and not to flush the toilet – you can defiantly rely on the lenient opinions to carry on with normal Shabbat life. [see Tchumin 23]