Most methods for ctb tht are not violent will send you unconscious before killing you, so in that sense you would "die in your sleep". But, if I understand you correctly, you are talking about something else: setting up some kind of arrangement, then going to sleep in the normal way, and having your arrangement subsequently kill you. I would say thiat it is possible to do that, but difficult. But it seems un-necessarily complicated to me, and if your equipment doesn't function quite as expected you won't be able to adjust it because you will be asleep. I would prefer a simpler method.