OpenTherm

Disclaimer: Build and use this at your own risk!

OpenTherm is a protocol that major central heating manufacturers use to control and monitor their products with.

There are several open-source hardware projects related to build an gateway interface so you can send and receive commands on this bus.

DomotiGa supports OpenTherm using the Home-built Gateway, or "OpenTherm GateWay" (OTGW).

Gateway configuration

You can access the gateway configuration using Interfaces -> OpenTherm
  • Connection to the gateway can be done using a serial interface or through the network.
    • For serial select the serial InterfaceType and set the Serial Port
    • For network select the tcp InterfaceType and set the TCP Host and Port
  • Poll Interval
  • Type
  • Temp. override
  • Sync clock
  • If Relay Enabled is selected, the values read by Domotiga can be accessed by other devices on the port configured under Relay Port
     

Checking OTGW functionality.

Once succesfully configured the auto-create functionality will create some devices for you.
One of them is the Opentherm Thermostat.

 

The next thing that should be done is modifying the settings of this device as shown in the screenshots below.



 

Look at the checkbox 'device can be dimmed' if you don't mark this checkbox chances will be you won't be able to Set a temperature yourself!
After completing these steps you will be able to use an event to set.device value1 of the thermostat.

Notice the Override now became active.

 

Aditionally your room thermostat will show a little logo indicating Opentherm Communication.

 

DomotiGa device info

The following devices are used together with the gateway:
The OpenTherm interface now supports 5 devices:

Thermostat

value1 = Room Temperature set point (°C) = OpenTherm MsgID=16
value2 = Room Temperature sensor (°C) = OpenTherm MsgID=24
value3 = Status setpoint override
value4 = Status Opentherm master

"Idle" = OpenTherm MsgID=0, Lowerbyte: 0000 0000
"Heating up room" = OpenTherm MsgID=0, Lowerbyte: 0000 0010
"Heating up boiler" = OpenTherm MsgID=0, Lowerbyte: 0000 0100
"Cooling down room" = OpenTherm MsgID=0, Lowerbyte: 0001 0000
"Error" = OpenTherm MsgID=0, Lowerbyte: 0000 0001

The setpoint of the thermostat can be changed (overwritten) by seting value1

Central Heating

value1 = CH set point (°C) = OpenTherm MsgID=57
value2 = CH temperature (°C) = OpenTherm MsgID=1
value3 = Modulation level (%) = OpenTherm MsgID=17
value4 = Water pressure (Bar) = OpenTherm MsgID=18

Boiler

value1 = Boiler set point (°C) = OpenTherm MsgID=56
value2 = Boiler water temperature (°C) = OpenTherm MsgID=25

Burner

value1 = Flame status (On/Off) = OpenTherm MsgID=0, Lowerbyte: 0000 1000
value2 = Burner starts (counter) = OpenTherm MsgID=116
value3 = CH Burner operation (hours) = OpenTherm MsgID=120
value4 = DHW Burner operation (hours) = OpenTherm MsgID=123

Outside

value1 = Outside Temperature Sensor (°C) = OpenTherm MsgID=27

If no outside sensor is connected (received temperature = 0.00) the outside temperature can be send to the thermostat by setting the first value of the device. This can be done by setting up a regularly triggered event with as action to set the temperature as returned by WeatherUnderground:

Alternative, use a scripted action in this event like:

@Devices.SetDevice("X",Dev_Y_Value )@

replace the X with the name of the OpenTherm outside temperature device, and replace the Y with the deviceid of the temperature sensor.

Programming PIC

NOTE: although verifying all the checksums show my PIC is programmed ok, it doesn't seem to run yet...
I get only garbage in startup... still investigating...

Some info about programming the PIC with a cheap PIC programmer under Linux.

I have a Olimex PIC-PG2 programmer, like this one. PIC-PG2
You must have a computer with build-in serial port so it can supply the programming voltage.
Laptop serial ports or USB to serial converters don't work.

I used Ubuntu 12.10 64 Bits installation, follow this steps to program it.

Install picpgm:

$ cd ~/install
$ wget http://picpgm.picprojects.net/download/picpgm_v2780.tar.gz
$ tar xzvf picpgm_v2780.tar.gz
$ sudo ./install.sh

If you are running a 64 Linux distro install ia32 libs:

$ sudo apt-get install ia32-libs

Download gateway.hex from here gateway.hex
Insert PIC in 18pins section of programmer.

Program PIC when on first serial port:

$ sudo picpgm -port /dev/ttyS0 -pic 16F88 -p ./gateway.hex 

PIC Development Programmer Version 2.7.8.0
http://picpgm.picprojects.net
Copyright 2002-2012 Christian Stadler (picpgm@gmx.at)
(built on Dec  9 2012 at 10:45:35)
==================================================================

Autodetecting Programmer ...
Programmer: JDM Programmer
            at /dev/ttyS0

PIC name:    PIC16F88
Device ID:   0x0768
Flash:       8 kByte
EEPROM:      256 Byte

Erasing whole device ... done!
Programming Code Memory 0x00002000
Verifing Code Memory 0x00002000   => Code memory OK!
Programming Data Memory 0x00000100
Verifing Data Memory 0x00000100   => Data memory OK!
Programming Config Memory 0x00000012
Verifing Config Memory 0x00000012 => Config memory OK!

time 7.0 seconds!

Done.

Related Resources

  • Added by sj3fk3 almost 5 years ago

    This is sooo cool!! Now I only need to get my (two left) hands on a gateway :P

Updated by: sincze, Updated over 2 years ago
Access count: 78818 since 2012-05-18

Attached Files

opentherm.jpg (2.82 KB) rdnzl, 05/18/2012 03:35 PM

OT-Protocol-Specification-v2-2.pdf - OpenTherm Specification (278 KB) rdnzl, 08/05/2013 09:48 AM

Set_OpenTherm_Outside_sensor.png (29.1 KB) danfos, 08/09/2014 03:02 PM

PIC-PG2.png (162 KB) danfos, 08/09/2014 03:07 PM

OpenTherm_gateway_Settings.png (35.4 KB) danfos, 09/29/2014 07:40 PM

override-inactive.PNG (3.04 KB) sincze, 11/05/2014 07:34 PM

override-active.PNG (4.07 KB) sincze, 11/05/2014 07:34 PM

thermostat.jpg (39.2 KB) sincze, 11/05/2014 07:34 PM

thermostat-options.PNG (29.6 KB) sincze, 11/05/2014 07:34 PM

thermostat-main.PNG (39.7 KB) sincze, 11/05/2014 07:34 PM

Also available in: PDF HTML TXT