Single Pole Switch, but 5 wires in wall and ceiling
Hi. I recently removed a remote switch from my ceiling fan in a bedroom because I just wanted a normal light switch to control it. In taking out the remote from the wall and the ceiling, I have 5 wires coming out of both (one group of black, white, red, and another group of gray and white). Using a tester, I found that the gray wire is my hot, so I assumed the black is my switch. I originally put the black and gray from the ceiling with the blue and black from the fan together, the 2 whites from the ceiling with the white from the fan together, and left the red by itself. At the wall I put the gray onto one screw of the switch, and black to the other screw, whites together, red alone. When I switch the light switch, it works in the bedroom fine, HOWEVER, it also controls half the other lights in the house, including the kitchen and living room. This house has been here for 35 years, so I know that the switch CAN just control the bedroom. What am i doing wrong?
Thanks for your help, and sorry so long-winded.