@johnr great idea! i have spent a few days considering this myself. Have you put any thought in to how it will be integrated to the socket? My concern is that I'd like to re-use the existing mechanical buttons in the house, connecting the arduino as a multi-way connection (swedish: trapp-koppling) to be able to use both mechanical buttons and non-mechanical. For existing multi-way connections I was thinking of adding the arduino as a "cross" (Swedish: korskoppling) in between to facilitate that but that would require two relays
I'm working on a Distributed Arduino Node (DAN) that is designed as a "per-room" style controller using the MySensors network talking back to my Vera via serial gateway.
Lighting and temp/humidity is currently working.
I also plan to add Lux and infrared send/receive.
Local control of the lighting is possible using a normal wall switch which is also wired to a relay in a "two-way" switch configuration. Like this:
This circuit switches power to a 12V power supply feeding into an LED dimmer/driver like this:
This dimmer has a 0-10V DC input which controls the brightness of the LED lighting.
A rotary encoder is then mounted with the normal wall switch as a dimmer control.
The encoder controls the Arduino's digital-to-analog converter outputting 0-5V. This output is then fed through an operational amplifier with a gain of 2, scaling the output from 0-10V. This feeds the LED dimmer/driver above and is working well with no flicker!
Feedback is required from the 12v power supply so Vera knows if the load is either on or off as there is no way of knowing this with the two-way switching.
This is designed for bidirectional control, from the local wall switch / rotary encoder or from the Vera for example, scene control.
Both on/off and brightness are fed back to the Vera so the DAN and Vera status is kept in sync.
If people are interested I am happy to post more details, sketch, Eagle schematic etc. This is still a "work in progress" though for our new home which we hope to start building this year.