Smart home series – Part 6 – OpenHAB

Posted by Gjermund Bjaanes on April 10, 2016

I have set up a couple Raspberry Pi’s with GrovePi+ and a few sensors. They send out data with MQTT.

That is not so useful without something to pick up those MQTT messages and doing something about them. Like showing them to me…

 

I mentioned last time that I created a MQTT-message-cataloger that would save all these values to a database. The plan was to pick to values up from something else and show them in some sort of dashboard.

I have changed my mind. There is a great existing tool that seems to fit all my needs: OpenHAB.

 

OpenHAB

OpenHab Logo

 

OpenHAB, in their own words is ”a vendor and technology agnostic open source automation software for your home”

It’s basically a very powerful home automation hub that works with a bunch of different types of technologies.

 

I have been using part of my Easter vacation playing with OpenHAB, and it seems to work very well.

It’s not the easiest to set up, because you have to fiddle with a bunch of configuration files. But it works, and it seems to be able to do everything I need it to (right now at least).

It can show real time data from MQTT (and a ton of other protocols), and it supports a bunch of different options for persistence.

 

You can read more about OpenHAB on their website:

http://www.openhab.org/

 

The Setup

I have currently 3 Raspberry Pi’s working for me. I have one with OpenHAB and the MQTT message broker and two others placed in my apartment with some sensors attached to them.

Raspberry Pi with Grove

 

It’s not pretty yet, but I have bought some super generic electronic project boxes from ebay to put them in.

It will look nice at some point, I promise!

 

The OpenHAB setup exists of two rooms with some real time data from the sensors there. All using MQTT messages.

In the OpenHAB app, it looks like this:

 

OpenHAB Screenshot Home

OpenHAB Screenshot Office

OpenHAB Screenshot Living Room

 

It’s not much yet - but it’s a start!

 

Configuration

It’s not the easiest thing to do, since all the setup is done in configuration files. Luckily there exists a bunch of great documentation on the web.

My strategy for learning the configuration was to download the demo site and just changing the configuration to fit my data.

The demo site can be found at their downloads page: 

http://www.openhab.org/getting-started/downloads.html

 

To be able to use MQTT, you have to install an addon for it, and set up the broker. There’s a lot of fiddling around basically.

I won’t go into detail about exactly how to do all of this here, but an upcoming post I am working on will do just that.

 

Next

I feel like I have a solid starting point for adding more stuff to my smart home.

Except for the fact that it’s not really a smart home just yet. It’s just a home with some data I can look at. In real time.

 

I need  bunch of more stuff for this to make any sense. I need to be able to automatically act upon the data I have.

I need to be able to look at statistics over time. I need to be able to control things like heating and lighting automatically and manually.

That is the next step. One simple use case I want to realize is the possibility to turn off ALL the light in apartment from my phone.

 

Like I mentioned earlier in the post, there will come a blog post soon with details on how I actually set all this up. A guide of sorts.

If you are interested in that, keep an eye on this blog 🙂


Follow me on Twitter: @gjermundbjaanes