It lasts a long time coming off of long-acting opioids like methadone and buprenorphine. There was about a month where I couldn't sleep coming off the bupes, and as I've said before I used ambien exactly as prescribed for the first two weeks, and then an OTC antihistamine (unisom, aka doxylamine succinate, same stuff that's in nyquil) the next two weeks. And I ended up occasionally needed 1/2 a unisom during the following month.
Some folks are 'anti-drug-based sleep aids' during w/d's, and I suppose that's justifiable, but to me, getting the sleep was just more important. I was more worried about how the lack of sleep would affect me mentally than I worried about suddenly, for the first time in my life, becoming addicted to OTC sleeping pills.
Obviously, it worked out okay for me, this attitude. I probably wouldn't recommend this approach to someone who'd previously had a sleeping pill addiction, though.
Anyways, as I say, what you're going through is normal, the result of your brain having over-produced adrenaline to keep you alert despite the (cns-depressant) narcotics all those years. It takes a while for that process to come back into balance. Probably haven't been quite as hungry as you'd expect also. And you've probably had jittery legs, and a tendency to blather on when talking to people lately, too, right? All part of the same phenomenon.
It will end, though