Yes I agree... pain will alter sleep patterns and quality of sleep. It's something you have to purposely work on each night. It's best to sleep at night, as they have found those who stay up during the night have more incidence of heart disease. go figure.
I use valerian, delta brain wave CD sounds, a long (hour) bedtime routine...etc it's just something I have to do as self care. My T helps me immensely on this.
I hope you can find a suitable sleeping routine for yourself.