Mordenkainen's Lost Notebook
1-level Divination (ritual)
As you prepare for sleep you feel that part of your mind remains awake and alert while you rest, for in casting vigilant slumber you set a specific condition under which you automatically wake up. This condition can be any single effect, such as “If any Tiny or larger creature comes within 10 feet of me” or “When the moon is at its zenith”. The condition must be something that you would normally be able to observe if you were awake. Thus, you can’t set the spell to wake you when something happens elsewhere, or when an invisible foe sneaks into your campsite. When you wake, the spell ends.