I'm glad to hear you've found a solution that will probably work for both of you.
You say your partner's friend has gotten to know you well - (If it's the honest truth -->) maybe you are comfortable and well enough to also greet her warmly yourself for a short moment and express your regret at not being able to hang out, but that you're happy to have seen her for that moment? It's not to "defend/explain" yourself, but I agree with
@JemPD that you might feel better, and less awkward if you have some control this way, no matter how well intentioned your partner is. "Hey X, lovely to see you! I wish I could stay but I have to go to bed: my shitty illness is immuno-metabolic which means my body gets sick if I stay up. I hope to catch you later for a short mug of tea/whatever you might manage, have fun together" makes you part of the visit without having to actually be part of the visit. I have done this type of say-hi-and-then-retire regularly in the past, but then it was always day visits not overnight stays.
If you're doing too poorly for this then nevermind of course.
When I was bedbound sometimes visitors for my partner dropped in for a short hello: I gave them a hand squeeze and that was it. If you do something like that, then you could ask your partner to guide your visitor out of the room after a couple of minutes.
Also maybe a helpful idea (although you probably already thought of it): do you have pyjamas you feel less garbagey in? If so, wear them in the visit period, and if not, get some if you have the budget. It means you can stay in your pj's while feeling less self-conscious about it. So less pressure to be "dressed" and also less pressure if you wanted to be dressed but couldn't manage it.
(I had this collection of worn out pyjama bottoms, old big shirts and huge nighties. A couple of years ago I decided to buy some cool pyjama pants that I wear with a hoodie or knitwear, and it's making a big difference in how I feel on PJ days, especially with other people. I can still look like garbage, but at least it's coolly dressed garbage.)
Best of luck!