Home automation with Python (This article has been translated to Serbo-Croatian by WHGeeks) I'm working on a Python library for some home automation tasks. The goal is to produce a toolkit to simplify the construction of distributed software systems controlling real-world systems such as lighting, security, heating and entertainment. My inital target environment is the home, since that is the hardware I have readiest access to. I've been thinking about this for a while, and when I refurbished my house I had the opportunity to rewire it with this in mind, although it would also be possible to retrofit much of this. Parts of the system could also be useful in other environments or applications. I currently have an RPC layer which allows objects to be exposed to a TCP/IP network. Objects support remote method calls as well as simple event subscription and delivery. There is a system to discover objects on the network advertising certain interfaces. There is a framework to define which objects should run on a particular host and for multiple objects to share a single Python interpreter where desired. The architecture I have used consists of several layers; a layer of interface objects talking to hardware, a layer of control objects representing devices and state in the real world, and finally a layer to interact with the user and implement their commands. Subset of supported hardware:
The software currently interfaces with and controls our lighting, TV, DVB-t PVR, HiFi, security system, fire alarm, doorbell, various fans for chimneys and bathrooms and our weather station. Another installation controls a proprietary lighting system and a tap-free bath with digital temperature and water level control. I am considering open-sourcing the code. If you're interested, please contact me and let me know what you're working on.
|