Solved! Go to Solution.
If you are on android you check out this app. It fades out the music after the given time, and it can also turn off Bluetooth, Wifi and Screen. (If you watch movies).
You can read more about it here: http://sleeptimerforandroid.com/
And it is available on the Google Play Store here: https://play.google.com/store/apps/details?id=com.smholsen.sleeptimerallmedia
Also it is free.