schedule to wake up and power-on I set the computer to wake up at 4:45 AM,
I have a script scheduled to run at 4:50 AM to play wake up music.



However, this morning, it didn't work as I intended.

It seems that the machine wake it up at 4:45 AM, but get himself asleep again after the power-on password is requried.

How could I ensure the machine to wake up and input password to power-on itself.

I need the password when I leave home and stay at office.
I would make a second user that just has the music for your playlist and is not an administrator.  You can then save that password so when you power on, that user auto logs in.

Unless you can relinquish the password requirement, this is going to be harder than you want. You need to be sure you power off or always have this second user active when it sleep.

You will have a lot better luck with iOS for this sort of alarm situation and even a several year old iPod / iPad / iPhone would do very well for this if you don’t want to compromise on macOS as an alarm clock / timed music player.