Don't forget to use your verbal skills to their fullest...
Simply warning you are about to shoot is a last chance statement. It also could mentally weaken an innocent person. If you live alone and no one will ever be inside but you, then you have a little less to worry about. But for me, YMMV, I prefer a couple identifier remarks. I have to leave my room since I am also charged with protecting 2 kids so I am already in the muck so I quickly can/do say in a firm voice... "MAY I HELP YOU" if the figure is fairly distant. If I am real close to the yet unidentified figure I will just do a faked throat clearing while I watch the darkened figure respond to that to try to match motion to known individuals that may be inside with permission. The clincher tho is the statement we see on movies... "IDENTIFY YOURSELF, FRIEND OR FOE!!!" My kids know to say "It's me daddy, put the gun away and go back to sleep." A little girl visiting my daughter will not sound the same as a boogie man and junior's buddies are gonna no my name but a bad guy is going to have already made a move or vocalized and they dang well better move/vocalize "I GIVE, I AM GOING TO MY KNEES"