I have 1 black, 1 white, and a ground coming from my box... The switch has 1 white, 2 black, and 1 green. I tried attaching white to white, 2 black to 1 black, green to ground wire.
Turned on power and the light was very dimly flickering, but would not come on fully. The wiring in my house is very old. Is there something I did wrong or will it not work without some rewiring.