Arduino get data from Wall light switch

dave-in-nj:
Draw out your wring.
google ladder logic. power on the left, neutral on the right.
you have a switch connected to the left, and a light connected to the right.
there would be a wire from the switch to the light.
you have a relay COMM connection connected separately to the left.
and the relay N/O or Normally Open connection connected to the light.
the light is connected to the neutral with no change.
all wire connected to the left is black, all wires connected to the right is white all wires in the middle could be red, or black, not white.
the light will have power if either of the devices is closed. the power would not be present if all of the devices are open.
problem : the Arduino cannot turn the light off if the manual switch is provding power.
senerio #2 :
you instlal a new switch, low voltage, connected only to the Arduino
you tell the Arduino to turn on the lights and the Arduino is the only device that can turn it on.
problem is that with a device failure, you have no lights.
senerio #3 :
the light switch is a 3-way switch and a second 3-way switch is replaced by the relay. the first switch will be in either an up or a down postion, depending on the state of the relay.
the light can be turned on or off manaully at any time.
the light can be turned on or off by the Arduino at any time.
problem : electrician is required to re-wire the lighting circuit.
one great thing is that now the manufacturers are making a wall box that has both mains voltage and also low power in the same box. this way, you have everything where your electrician can see it and there are no surprises.

I have tried to do the third and failed because when I turn off the switch the relay won't turn the light on. But the opposite works.
I have also tried to do the second and make the switch to send signal to the arduino so it can control the relay but when the switch is off it sends random 1s and 0. When the switch is on is correct and send only 0. If I fix this the project will be solved.