People who show up unannounced

Don't get me wrong, I love it when people come over, and I don't have a problem with the people themselves but the timing or the suddenness of their visit lol. They always expect you to be home, always expect you to have energy and time, and they assume that us being close means basically there's no need to call or text asking "are you home/free"

To give some context I had to spend most of my time lately at home cause I didn't feel like going out, also cause I work from home so these people got used to it I guess and assumed that whenever they feel like it they could come over and spend time, and being the people-pleaser that I am I struggle to make it show I'm not always in the mood for socialization.