I'd like to know if anyone sees big issues with this system I want to implement in my home. The software is in beta, I will start doing the hardware side of things in a few weeks.
Current Home Status
- almost all lights are temporary push-buttons connected to a 220V relay
- two locations in the house where all the wires are connected
Since an image is worth a thousand words... (the items there are example, not the real ones I will use (different 220V relay, Arduino-connected relay but the main idea is well represented)
- adding a 220V relay in series with the normal light switches, connecting it to an Arduino
- a 30 amp current sensor is used for detecting the state of the light switch
- each Arduino (or at least one in a pack of many Arduinos - where one won't be enough) Ethernet shield is used to send/receive data over a closed network (not accessible from LAN/internet)
- a mini-itx atom board running Linux and some node.js software listens for UDP packets on the network (the controller)
- each Arduino sends every x minutes the on/off state as a UDP packet
- each Arduino send a UDP packet when the state changes
- each Arduino listens for UDP packets addressed to it and can turn on/off a relay
- the controller receives and stores all data on a network card, using a second for providing web interfaces with authentification for lan
- other Arduino devices will be embedded in switches, sensor arrays, and can send UDP commands to turn on/off lights
- the controller has event-driven and schedule-driven actions, state changes, and can send commands to the Arduino
Advantages
- preserving the normal light switches in the house
- if the system goes down the normal switches still work
- modular - I can add more nodes as I need them
- the controller is needed only for advanced operation
- relative
- future-proof - I can't imagine UDP protocol becoming obsolete anytime soon
- secure web access from outside the home
Disadvantages
- a lot of Arduinos and Ethernet shields might be needed
Optional items
- Raspberry Pi's with thermal webcams to detect presence, using a modified zoneminder install to send UDP packets based occupancy
- a couple of Android phones with broken GSM and weak batteries used as touch-screen interfaces inside the home
- a Nokia phone used with Gammu to provide the ability to command the home via SMS
Clarification
The 220v relay that are set up right now were put into place to allow lights to be opened or closed from multiple places from a room. Think of the relay as a 3-sided control circuit
- one side has the 220v mains coming in
- one side has the push buttons that work on 220v
- one side has the output to the light bulb
The 220v is an on/off relay. Each time any button is pushed, it toggles it's state, as long as you press a button more than 0.1 seconds (so it said in the relay manual).
My electrician installed the 220v relay, it is not 'normally open' or 'normally closed'. If powers goes down and then comes back the lights return to their previous states.
To trigger the 220v mains relay all i have to do is use a normally-open arduino-relay and trigger the closed state for more than 0.1 seconds. I just need to send a 220v "pulse" to the 220v relay. This is the main reason that the lights will still work as long as power is kepy. All the arduino can fail and the normal lights will work as usual, I will only lose the remote-controll posibility and advanced scheduling/scripting.
As for pricing I am sourcing arduino+ethernet or mega+ethernet (and a few other arduino replicas) at around 15-25$ per pair, so the cost is relatively low. In the main controller software I estimate 40 hours of work, and then a few hundreds of hours over a few years refining the user interface and adding events and so on.
All the items will be placed in 2 boxes inside the house, one for each floor, and a third box will be controlling the garden,patio and watering.
--- Later edit --- Built the schematic, you can see it in action on youtube http://www.youtube.com/watch?v=BmsdXMbd2vo