I have a switch with only two wires. Its essential that you determine which black wire is hot before proceeding.
Replacing A Ceiling Fan Light With A Regular Light Fixture
Light switch with two black wires only. You will have to get a 4 way switch for that position not a 3 way switch. However if you need to rewire a light switch or a plug socket you may occasionally come across two black wires. If the switch that was there is a standard light switch with two brass screws on it and one green screw you can connect the red wire to either of the brass screws. Hooking up a switch is the essence of simplicity. Notice the black wire is the only wire that we are controlling through the 2 way switch. My assumption is this switch is just breaking the circuit to the light so there is no way to have power here for the switch and have the light off.
You have an incoming hot wire black going to one screw it does not matter if you use the brass or silver screw on the side of the 2 way switch and a black wire from the other screw on the 2 way switch going to the load light ceiling fan etc. Switches are never connected between a black wire and a neutral wire. You connect the black wires in the electrical box to the switch terminals and the white wires to each other. Or call in an electrician and have the circuit re run with 14 3 wire so theres a black white and red and then. Black means hot white signifies neutral and green indicates ground. The easiest and safest way is to use a multimeter to test for current.
The two black wires one is power input the other is switched power output is used to control a light fixture or outlet. Connect the lead wires from the fixture to the black hot wire in the electrical box by twisting a wire connector to the ends of the lead and hot wires. The switch also has a green terminal. Red and black form the same cable will connect ot he brass screws then the red and black from the other cable will connect ot he black screws. If you have a ground wire connect the ground wire to the green screw. 4 way switches have 4 screws 2 will be black and 2 will be brass.
Repeat these connections with the two white. Connect the black wire to the other brass screw. The smart switch wants a line and load.