I’m not sure about the sleep tracking part. You could use the shortcuts app to do a lot of what you’re after I think. Specifically the QR code, you could replace it with an NFC tag (you can buy them cheap from Amazon or aliexpress). Set your shortcut to stop the alarm when you scan the tab. Might be able to set up the same thing for going to bed. Scan the tag, lights turn off, alarm gets set, music starts. Something like that.
I’m not sure about the sleep tracking part. You could use the shortcuts app to do a lot of what you’re after I think. Specifically the QR code, you could replace it with an NFC tag (you can buy them cheap from Amazon or aliexpress). Set your shortcut to stop the alarm when you scan the tab. Might be able to set up the same thing for going to bed. Scan the tag, lights turn off, alarm gets set, music starts. Something like that.
Best of luck!