Adding to what @simyou wrote, Éliphas Lévi likely read the story in Giulio Bartolucci's bio-bibliographical work "Bibliotheca Magna Rabbinica", vol. 3, pp. 833-835, where he brings a Latin translation of the story from Shalshelet Hakabbalah:
"Rabbeinu Yechiel of Paris was one of the students of Rabbeinu Yehudah Ha'chassid [...] and I (R' Gedalyah Ibn Yechiya, author of Shalshelet Hakabbalah) saw in a kuntress that this holy man was also wise in Kabbalah Ma'asit and in his beit midrash there was an oil lamp which he lighted every Shabbat eve and it would remain lit all week, without oil, and this was known by all of the city's denizens, until it was heard by the king of France [...] and the king decided to see it for himself and discussed with his ministers the idea of going to see him at night, however, there was a custom in the city for amoral people to knock at night on the doors of the Jews so that they would give them something, and this pious man, so that they would not interrupt his studying, would take a nail and knock it into the ground, and when the amoral people knocked on the door, he would hit the nail and the person would fall underground. And now when the king came and knocked on the gate, the rabbi hammered [the nail] and the king sunk to his hips and when they knocked again, the rabbi hammered again, the nail came back and the rabbi became fearful, saying: This must be the king, and he went and opened the door and bowed before him, and begged his forgiveness [...] [said the king] I came to you for I heard that you are knowledgeable in witchcraft and as proof, you have a lamp that is lit without oil. Answered the rabbi: I am not a sorcerer, God forbid, but I am a scholar of the natural sciences and know attributes (סגולות) and he showed him the lamp that was lit without oil but it had a fuel source like oil [...]"