MQTT and openHAB adventure

Some people asked me to share my MQTT setup in regard to openHAB and I agreed to do so. In this blog post I will explain and describe in more detail my current setup primarily on the heating subject.

But first some background info. A long time ago I installed openHAB 1.6 on a Raspberry Pi 2 and started with some Homematic and Enocean (devkit) devices, but learned there were more interesting alternatives and fell in love with the MySensors project. This project allows you to create your own home automation devices with Arduino and alike hardware and provides a library that will handle all communication between the devices and openHAB. Since I started with MySensors I have used MQTT to connect to openHAB, so I already had a working MQTT setup when the OpenTherm gateway entered the house.

Setting up MQTT is pretty straightforward. Below I describe the steps I took to install and configure MQTT in combination with openHAB.

  1. $ sudo apt-get install mosquitto
    This installs version 0.15 of the software from the default repository. In my recent journey to upgrade MySensors from 1.5 to 2.1 I had to upgrade the mosquitto software to a newer release to make it work again.
  2. Upgrade mosquitto (optional)
    $ cd /etc/apt/sources.list.d/
    $ sudo wget
    $ sudo apt-get update
    $ sudo apt-get install mosquitto
  3. Start the moquitto service
    $ sudo service mosquitto start
  4. Install MQTT openHAB binding (assuming openHAB is installed from the repo).
    $ sudo apt-get install openhab-addon-binding-mqtt
    otherwise place the MQTT addon binding in the right directory
  5. Configure the openHAB MQTT binding
    edit the openHAB main config file: /etc/openhab/configurations/openhab.cfg
  6. Restart openHAB
    $ sudo service openhab restart
  7. Check if the addon is loaded and reports an connection:
    $ sudo tailf /var/log/openhab/openhab.log | grep -i mqtt
    2016-11-06 16:40:29.047 [INFO ] [.io.transport.mqtt.MqttService] – MQTT Service initialization completed.
    2016-11-06 16:40:29.050 [INFO ] [o.i.t.m.i.MqttBrokerConnection] – Starting MQTT broker connection ‘mybroker’

Now that openHAB is configured to listen to the MQTT message bus it’s time to hook up the OpenTherm gateway.

I will continue in another post to explain the OpenTherm gateway configuration and openHAB items and rules. Also some useful debugging commands which I use alot. This was drafted pretty quickly, so the layout is not that nice. Hopefully I will find some time to tidy up the styling..

That’s it for now, more to follow on this subject soon!

Opentherm Gateway for the win

At the end of last year the central heating system (including hot water) at home started to fail. Luckily it was not directly broken, but it slowly gave less and less heat, which was most noticeable while taking a shower, brrr.
I was not totally unhappy then the maintenance guy told me the pump and three way valve replacement would be very expensive and besides that, the heating unit was nearing it’s expected lifetime. This way it was legit to buy a new one! One that could integrate with the already present home automation solution provided by openHAB.

It took a few hours to learn and decide which system was best for me. I won’t go into much detail about my selection and why, but I eventually came up with the Remeha Tezerra Plus 39c CW5 including Remeha iSense v28 thermostat. The heating system and thermostat are using the OpenTherm protocol to communicate. In the research process I learned there’s a device called the Opentherm Gateway which is capable of monitoring the OpenTherm messages that are passed between the heating unit and the thermostat, but most important, it’s able to set or override the setpoint temperature.

Read More

Home heating setup using openHAB

openhab-logoThree weeks ago I finished my home build thermostat and heater control using openHAB and MySensors and I am really pleased with the result so far. The set-up consists of two Arduino Pro Mini’s, one 3.3v for the battery powered MySensors temperature sensor in the living and one 5v version for the relay control placed next to the heating unit. Because I didn’t like the idea of controlling the heater over a wireless connection I used an Ethernet module for connectivity. I also added two temperature sensors for measuring the heat in and out of the heater. I eventually ended up by using only the temperature reading of the one that measures the returning heat flow in order to minimize the overshoot. I’m still fine tuning the heating rule, so I will publish the code when I’m completely satisfied.

Have a look at the screen shots below to get an impression how it looks like in openHAB.

Screenshot from 2015-01-22 22:41:39 Screenshot from 2015-01-22 22:42:05 Screenshot from 2015-01-22 22:42:51

More on this subject to follow..