Yesterday I attended the RheinJUG in Düsseldorf for the first time and after I managed to find the right building / entrance / room, everything was really nice. RheinJUG had some snacks, soft drinks and beer prepared – Time for the talk.
### „Why?“ and „Where does it come from?“
So the topic of the evening was „Home automation – How to automate and connect everything in your home“. Before I came here, I asked myself what I might want to automate. I came up with a small list of scenarios I could think of:
* Activate some lights in the living room in the evening if its dark outside
* Activate lights in the workroom when its dark and I enter the room
* Dim the lights during the night so that I don´t get flashed when I switch them on
* Preheat the bathroom in the morningOne thing I didn´t know yet was that home automation was not invented for the private sector. The main reasons why one wanted to automate everything were energy saving and cost reduction, not comfort.
Big companies with lots of employees had a big problem each day: „How do we turn on/off all the lights and heatings in the morning/evening to save valuable energy and money?“. They used to employ groundskeeper for this job who had to run through all the buildings and turn everything on/off – pretty unsmart! As a result they started to think of better solutions….
### How does it work?
As our tutor Thomas Eichstädt-Engelen told us, home automation does not mean that you just simply install some time switches. It means that you have a controlling unit which uses several sensors and/or rules to integrate and connect all the different actors.Sensors can for example measure light intensity, humidity, temperature, pressure, wind, etc..He started by telling us about the different hardware systems available used to connect everything. The most common system used is KNX. Its the heavy-weight champion of the home automation world. But there are other systems like HomeMatic, FreeControl, RWE SmartHome (DONT buy! Proprietary Silverlight software, encryption, crappy UI), etc.. Some are Open-Source, some not (bad!).One really cool project is called „DigitalStrom“ (DigitalEnergy) built by the ETH Zürich. They build digital luster terminals, which you can easily integrate into you home system. You can then install a small command center and start controlling your actors. This system works, in opposite to e.g. KNX, with the already installed power cables in your apartment / house. It works somehow similar to powerline adapters. Here you can see one of these terminals:Most of the systems use their own hard- and software systems so integrating different types of hardware is very difficult. This is where openHAB comes in.
### How to integrate?
openHAB works as an integration platform to a lot of different hardware systems. Some of them require their own BUS cables, some work via ethernet, powerline, bluetooth, wireless, etc…If you want to use them all with one rule-engine and one front-end, then openHAB is the way to go.It comes as a executable Java bundle and all you need is a JRE installed. It runs on a full fledged server hardware or on Raspberry Pi. In general the hardware for the command center shouldn´t be that expensive.The basis for openHAB is the Equinox OSGi runtime which easily allows to develop new plugins.If you want to develop your own code, you need a JDK and the openHAB designer, which is an Eclipse RCP application with Xtext-based editors. You can also develop with smaller editors like nano or vim, but I think that this is for the hardcore users.openHAB provides several bindings, each for a different connection system. During development it doesn´t matter which system you use. You define it and you talk to it through a standard interface.Here is a list of currently available bindings:Asterisk VoIP-SystemBluetoothCUPSCommandline supportAVM Fritz!BoxHTTPKNXMPD (Music Player Deamon)Network availability checkNovelan (Siemens) HeatpumpNTP (Network Time Protocol)1-wireRS-232SNMP (Simple Network Management Protocol)VDR (Video Disc Recorder)Wake-on-LANRules are defined in openHAB´s own rule engine or, as a separate download available, in JBoss Drools.
### How does it look like?
openHAB provides several UIs. A Web-UI, Android, iPhone and a GreenT Web-UI.Here are some impressions:
* [Office screen](http://wiki.openhab.googlecode.com/hg/images/screenshots/openhab-room.jpg)
* [Widgets screen](http://wiki.openhab.googlecode.com/hg/images/screenshots/openhab-widgets.jpg)
### So what can I do now?
openHAB has for example a [Google Calendar](https://www.google.com/calendar) integration which allows you to poll the calendar in specific periods and download all events. An event can contain scripts to execute so you are absolutely flexible in adding new rules 🙂
Other features include:
* Send notifications (SMTP, Prowl, XMPP)
* Play audio: Files, TTS(Text-To-Speech)
* Send HTTP-Request, execute script, create a timer
* Store item states in a database
* REST API for other clients to subscribe for updates, change states, etc
* Dropbox support to store and exchange configuration files for the openHAB
* Multicast DNS/Bonjour service to discover new devices
Here are some more examples what you could do with it:
* Pre-Wake up scene:
* At 6 AM turn on heating in the bathroom
* At 6:35 AM turn on underfloor heating
* Turn on bedroom lights at 6:55 AM to 40% of their brightness
* Turn everything of at 7:45 AM
* Exceptions: Its already warm enough or you are on holiday* Watch TV/DVD Scene
* Turn on all your AV equipment and switch to the right inputs
* Lower the lights or close drapes
* Exceptions: Its dark outside (no need to close drapes)* Guests at the Door Scene
* Pause movie when someone rings the door bell
* Switch to security camera channel to see who is there
* Exceptions: nobody at home or no movie running* Leaving the home Scene
* Send a notification to yourself that window xy is still open
* Shut off all lights if nobody is at home
* Exceptions: If dog is there, turn on radio and keep some of the lights on* Attendance Simulation Scene
There are still a lot more scenarios of which one could think. Do you have some? Did you find this article interesting? Do you plan to ingrate one of the systems?
****Drop it in the comments!**