For what it's worth, my household has some strict rules—even for guests—about leaving phones at the entrance. My kids aren't allowed phones in their rooms, and we don't use phones in family spaces unless we have an explicit reason to do so. And even then, the phones typically don't leave the general area where we keep them.
I don't warn people as they enter, but if they start using it in the home I'll say something like "hey, I didn't mention it but we keep our phones in this space by our entrance. Do you mind keeping it over there/not using it/whatever while you're here?". Depending on who it is and the context, I'll add that it's for the kids and/or to keep a certain ambiance or ethos for what's going on (like watching a movie together).
It probably sounds extreme. It keeps people from doing what you're describing though. Most people like it, too. Younger people (teenage friends of our kids) tend to find it extremely invasive and unwelcome, which is a bit funny because they don't recognize their insistence to bring things into our home as converse to what we're doing, yet within a space where we should be able to decide. That's fine, though. It's okay not to agree with people. Especially teenagers(1), haha.
You might find some rules or guidance around device use in your home helpful, anyway. Just tell people you don't do that at your place. Keep that stuff at the door, let your home have some sacredness or inviolability (so to speak).
1. I don't mean this is a "teenagers are dumb" thing at all. Where I am they tend to live in settings where they make the decisions about their devices and their usage, and these are both very personal parts of their daily operations and personal property which they strongly dislike being parted with. There are usually both good and bad reasons behind this. But yeah, a lot of kids talk to our kids like we're militant despots trying to oppress a normal way of life, haha. There is a lot of sneaking contraband into our place. I totally get it.