I'm very new to this, but I will clarify first that my brother is a qualified electrician and would do all the wiring.
What I wanted to do is control my existing lights via openhab. But keep the light functioning as usual with a physical light switch as my wife wouldn't accept any delays or changes in the way the lights currently behave.
My first thought was to change the existing switch to a 2-way (3-way) switch using the existing wall socket for a physical switch and a relay I can control via the Arduino.
My concern is that if the physical switch is turned on openhab would still be displaying the light as being off. My idea to solve this would be to also wire in a 240v current sensor, and control the state on the light in openhab based on if current exists or not in the circuit or not. (so basically if the Arduino controlled relay is off it would switch the polarity of the switch shown in the openhab interface)
I couldn't find any examples of people doing this so I thought there might be an easier way. Could someone please help?
open the wall, remove the existing wall box.
put in a double gang box.
put in your controls in the new space.
wire the switch to the new electronics.
now the switch tells your program to turn the lights on and off.
one bit of a problem is that if you have up as on and down as off, you would needed to either make it a 3-way, and then the other state is, well, the other state.
or, flick the switch up and down to change the lights.
one of the big companies will come out with a new switch. momentary, center off.
or have a second ON position, one you have to push the switch up, just a little bit more.
now there is one problem with all this and that is that the switch is no longer a bypass. you have no lights if the controls fail.
another way is to swap out the switch for a 3-way, put the other 3-way in that extra space and put in your relay.
you can monitor if there is any voltage on the output of the relay to see the state of the lights for your controls.
Your brother should be able to help you choose an off-the-shelf home-automation switch/dimmer. Together you can decide on a protocol that you can control/program with openhab.
What I wanted to do is control my existing lights via openhab. But keep the light functioning as usual with a physical light switch as my wife wouldn't accept any delays or changes in the way the lights currently behave.
That's normal... All home automation wall switches/dimmers can be controlled manually/locally or remotely. Logically, it's a spring-loaded, 2-position. center-off switch.
My concern is that if the physical switch is turned on openhab would still be displaying the light as being off. My idea to solve this would be to also wire in a 240v current sensor, and control the state on the light in openhab based on if current exists or not in the circuit or not.
There are 2-way protocols, but typically the remote controller doesn't "know" if the light is on or off... The switch simply holds the last local or remote command.
For example, I have lights that are programmed to turn-on at sunset and off at dawn. If I manually turn them off during the night, they will stay off until the next sunset or until I turn them on manually. And if they are already on when the sunset-command comes along, nothing will happen since it's already on. If I send a remote 50% dim command, it will dim to 50% no matter what the current state.
....I've had a combination X-10/Insteon system with about 10 controlled lights/outlets, a programmable timer-controller, and a few manual remote controllers. for about 20 years (maybe longer, although it occasionally gets updated). I didn't build any of it. My system doesn't connect to the Internet or cell phone network, but I could add those features by adding some hardware.
DVDdoug:
Your brother should be able to help you choose an off-the-shelf home-automation switch/dimmer. Together you can decide on a protocol that you can control/program with openhab.
I was looking at this and the off the shelf z-waze home automation modules were in excess of $80 and seemed to have questionable reliability. Then I came across people setting up a mesh network of arduino's and sensors the sent MQTT messages to openhab.
That might not makes sense, I am still new to this and trying to work it out.