Lucy, you wrote that post. Your name is at the bottom of it and your avatar is beside it, with "Thread Starter" written on it. That means you are the one who started this thread, which is your recovery thread.
You can also recognize your posts in your thread, because their background colour is a pale grey/blue, while the background of posts by other people is white.
Five weeks is still very early in this year-long recovery. Your knee is still upset from the surgery and it will take a while longer before it starts to feel more comfortable.
Two possible reasons for pain at night are under-medication and over-exertion.
Are you still taking regular pain relief?
And how much exercise are you doing?
Compare your activity against what we recommend in this article:
Activity progression for TKRs
I'm going to ask
@Josephine , our Nurse Director, to advise you. She has many years of experience in orthopaedics.
She'll probably ask you a lot of questions. Do try to answer them as fully as possible, so she has all the information she needs, to advise you appropriately.