If a person is in a hotel over Shabbat, in which the doors open with a digital magnetic card, clearly the card is Mukse and may not be moved on Shabbat. It is obvious that under no circumstances may one take the magnetic card and open his door on Shabbat. The lock works through an electric mechanism, which is clearly prohibited on Shabbat. If the hotel offers a Shabbat key, then getting one before Shabbat would solve all the problems. If it is not a hotel that has that option, then the question is, what does he do on Shabbat? Assuming that he does not want to leave the door unlocked, because he is worried about thieves and the like, how does he get back in his room?
The question is can he tell a non-Jew to open the door for him, even though he knows he will take the digital key and open it. According to most Poskim, the prohibition involved is M'drabanan (Rabbinical). It is only a digital light, and there is no cord that is getting hot and burning. This is the consensus of most Poskim, aside from the Hazon Ish, who might say it is D'Oraita.
Instructing the non-Jew would also be D'Rabanan. Thus, this situation constitutes a "Shvut D’shvut (a Double Rabbinic Prohibition). The Halacha is that "Shvut D’shvut" is permitted if there is a pressing need. Getting back into a hotel room to go to sleep is a very big need. The Poskim clearly take this route. The Minhat Yishak (Rabbi Yishak Weiss, Jerusalem ,1901-1989).) in Volume 10, Siman 19 and the Shevet Halevy (R. Shmuel Vosner, Bne Berak, 1913-2015), as well as Rav Elyashiv (Jerusalem 1910-2012) all rule that one may ask a non-Jew to open the door.
It is important to note that even if the issue of Amira L'Akum-instructing a non-Jew is overcome, there is still an issue of benefiting from the Melacha done by a non-Jew expressly for a Jew. In this case, it is not a problem, since the benefit is having the door opened, which in itself is not a Melacha. The fact that the digital light on the door turned on when it opened is not important, because there is certainly no benefit from that. Therefore, the Poskim are lenient.
Hacham David brings down in Halacha Berura that it would be better to do this through hinting, if possible, in order to satisfy any of the Poskim that are stringent. One can thus, tell the non-Jew "I can’t get in my room, I’m locked out," and on his own he will understand to let him in. If the non-Jew does not understand the hint, then he can be told directly, because, this is permitted in a time of great need.
In one is staying in a hotel with electric locks, one should try to obtain a Shabbat key. If the hotel does not have Shabbat keys, one should try to hint to a non-Jew to open his room. If this is not possible one may openly ask the non-Jew to open his room.