I have a Raspberry Pi driving a home automation system. I have connected a bunch of lights to the network. The GPIOs of the Pi connect to a relay board that switch the lights on and off. What I need is failsafe + alternative switches. These switches need to work even if the Pi fails, and they need to be usable when the system is operational (in 3 way switch, Pi switch XOR manual switch = bulb state fashion).
What is the best/standard solution for this? Three way switches would work, but then the Pi loses the state of the devices. I could get the state of the lamps by setting up a DC adapter in parallel to the bulb input, effectively measuring voltage which could feed back to the Pi telling me the true state of the bulb.