I use a virtual switch and Alexa. When I tell Alexa “goodnight“, the switch is turned on in ST (this, in turn, controls everything else by changing my location mode.) When I tell Alexa “good morning”, the switch is turned off (which changes my location mode back to Home and triggers other actions.)
I also have the sleep mats @nathancu mentioned and used them for a while. They work great too, as long as you cover all your different scenarios in your automations… like if you have a partner, one of you goes out of town and doesn’t sleep on his/her mat… or if you both happen to sit on your sides of the bed at the same time in the morning to maybe put your socks on… or if you decide to take a nap with the baby in the middle of the afternoon and he/she tends to squirm around a lot (turning lights and tvs off on anyone not napping Lol.) These can all be worked around in your automations, I just found triggering with Alexa simpler for our specific needs.