Yes, you are absolutely right. Chronic opiate use
does lower your
testosterone level and thus your sexual drive. You may be over the acute stages of withdrawals, but the residual listlessness, depression and insomnia can last for several months. Some of it is cause by diminished hormones, but it will resolve eventually with time, good nutrition, moderated exercise, being in fresh air, etc...
Do not despair, it will get better and better every day. Good luck.