OpenHAB Configuration


A brief description on the OpenHAB customization tools

CM3-Home Dashboard

Links on useful documentation, configuration pages and different GUIs are available at:


How to edit customization files

The most recent and easy tool to manage OpenHAB configuration is Visual Studio Code. An explaination here about how to install and configure it to work with OpenHABian.

Install Visual Studio Code

Add OpenHAB extension

configure Visual Studio Code in this way

"": "cm3home.local",
"openhab.port": 8080,
"openhab.lspEnabled": true,
"openhab.username": "openhabian",
"openhab.password": "openhabian",
"openhab.karafCommand": "ssh [email protected]%openhabhost% -p 8101",
"files.autoSave": "off",
"openhab.username": "openhabian",

Mount the samba exported OpenHAB configuration folder. On MacOSX, for example:

  • user: openhabian
  • password: openhabian

and add the folder to Visual Studio Code workspace.

Remind the shortcut keys available, first of all

⇧⌘P, F1 Show Command Palette

The workspace is now ready to edit all the configuration files

Widgets management in OpenHab

As an example will be described here the design of an habpanel for the Weather Binding.

On the contrary to the widget described in openhab_weather, in this example we don’t use the standard frame type widget. The HTML will be coded directly inside the widget itself, created as a custom widget. Because this web page is published by the OpenHAB internal web server, it is visible also through the cloud services. Using a frame widget that publishes an external web page instead, this one can be viewed only inside the same network.

The stilesheets and the icons come from the same openhab_weather widget folder using the relative path.

≤link rel="stylesheet" type="text/css" href="../static/weather-data/layouts/example.css" /≥
≤img src="../static/weather-data/images/{{IconSet}}/{{itemValue('Condition_ID1') | lowercase }}.png"/≥

Changing the IconSet=’directory’ with the desired icon set name, we can change the icon style for the whole widget.

It’s possible to change the language of the captions by changing the weather.cfg file. Verify the language supported by the provider used.



The language chosen affects only the binding items with the data taken from the provider. OpenHAB supports only English and German language for the rest of the text. For other languages we have to use other conversion systems like, for example, this one:

Define the conversion array:

≤div ng-init="daysnames={'Sunday': 'Domenica', 'Monday': 'Lunedì', 'Tuesday': 'Martedì', 'Wednesday': 'Mercoledì', 'Thursday': 'Giovedì', 'Friday': 'Venerdì', 'Saturday': 'Sabato'}; 

Then use the English name as the array index:

{{daysnames[(itemValue('ObservationTime1') | date:'EEEE')]}}

In order to have an automatic update of the displayed text when the values change, the system uses AngularJS. The text management and formatting must be applied using this language specific syntax.

To select automatically the icon corresponding to the weather condition we can use the Condition item modifying the name with some AngularJS code:

≤img src="../static/weather-data/images/{{IconSet}}/{{itemValue('Condition0').replace(' ','-') | lowercase }}.png"/≥

This works only if the chosen language is English. It’s better to use the CommonID item, it’s unique and matches the icons names:

≤img src="../static/weather-data/images/{{IconSet}}/{{itemValue('Condition_ID0')}}.png"/≥

And use instead the Condition item for the captions, it matches the chosen language:


To show other parameters we can use a mix of AngularJS and CSS:

≤td class="col-xs-4" style="color:red"≥{{'%.0f' | sprintf:itemValue('Temp_Max0')}} °C≤/td≥

CM3-home – OpenHABian set-up

Some advices on how to have an up and running installation of OpenHABian operating system on CM3-Home

OpenHABian Installation

For a comprehensive tutorial about OpneHABian installation please follow the instructions on the official web site

Basic installation download on RPI and compatible boards

Take a look also at this article  on how to create the SD card.

ATTENTION all the installation procedures are really long lasting, please be patient.

Once installed OpenHABian following the instructions, you need to proceed with customizations and add-ons installation.

Many operations are eased using the OpenHABian environment equivalent to raspi-config.

sudo openhabian-config

The CM3-Home serial ports must be prepared to be used in OpenHAB, freeing them from standard use:

  •  30 | System Setting
  • 35 | Serial Port
    • [*] 1 (RPi) Disable serial console
    • [*] 2 (RPi3) Disable Bluetooth module
    • [*] 3 Add common serial ports to openHAB JVM

use menu items according to your needs

  • 30 | System Setting
    • to change password, host name, WiFi, etc.
  • 01 | Update
  • 02 | Upgrade System
  • 20 | Install optional add-ons
    • Mosquitto
    • Grafana
    • knxd

In order to verify the configuration you can use the karaf console. Let’s take the knx binding as an example.

[12:44:08] [email protected]:~$ ssh -p 8101 [email protected]
Password authentication

                          __  _____    ____      
  ____  ____  ___  ____  / / / /   |  / __ )     
 / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  | 
/ /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ /      
\____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/     
    /_/                        2.1.0
                               - release build -   

Hit '' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '' or type 'system:shutdown' or 'logout' to shutdown openHAB.

openhab> config:list "("
Pid:            org.openhab.knx
BundleLocation: mvn:org.openhab.binding/org.openhab.binding.knx/1.10.0
   localIp = localhost = org.openhab.knx
   type = ROUTER

In case of problems it can be useful to increase debug level to check for possible configuration errors:

openhab> log:set debug

or enable the trace

log:set TRACE org.openhab.binding.knx
log:set TRACE

It is advisable to disable them when the debug is over:

log:set DEFAULT org.openhab.binding.knx
log:set DEFAULT

All the useful information can be read in:


Or with the console command


or in the browser:

The configuration is dynamically loaded as soon as the cfg file is saved (/etc/openhab2/services/knx.cfg in the example).
It could happen that the previous configurations are cached even at service restart. In that case clean up the cache before restarting the service:

openhab> config:delete org.openhab.knx

[email protected]:~$ sudo systemctl restart openhab2

There are some little differences between CM3-Home and Raspberry PI 3 because of the greater hardware equipment.

To use all of the available hardware you have to:

  • Assign the serial debug port (UART1) to GPIO32-GPIO33 instead of GPIO14-GPIO15
  • Assign the RGB LED GPIOs
  • Change the audio PWM GPIOs
  • Assign the 1-wire line
  • Assign the IR reciver port to GPIO 20
  • If needed, assign the J3 socket to SPI display
  • Set up the I2C port
  • Avoid to wait for HDMI device attached at boot (save more than 10sec at startup)

To do that, the following instructions must be added to the /boot/config.txt file:


#Serial port to GPIO 32 and 33

#CM3-Home led definition

#Enable PWM on GPIO 40 and 41 for the audio out

# Enable the 1-wire bus

#Enable the IR Linux driver

#dtoverlay=ads7846,cs=0,penirq=34,speed=10000, swapxy=0, pmax=255, xohms=60, xmin=200, xmax=3900, ymin=200, ymax=3900

#I2C on Grove socket

#Avoid waiting for HDMI device attached at boot (save more than 10sec at startup)

To assign system functions to RGB LED you must create an overlay using the RGB led tutorial

To redirect the system console to the debug port you have to also edit the file /boot/cmdline.txt modifying ONLY the instruction related to the console, KEEPING INALTERED ALL THE REST.


console=serial0,115200 console=tty1


enable_uart=1 console=serial1,115200

A dashboard with links to configuration panels and references is availbale at cm3-home.local:8080

Paper UI is the starting point for every installation and configuration.

Mobile App

To use all the CM3-Home OpenHAB features on mobile devices even when not in the same domestic network, it can be used the open cloud service offered by OpenHAB and the corresponding app available for both iOS and Android

After installing the openHAB Cloud Connector

the following files will be available:


The files content is needed to setup the cloud service. A complete tutorial about installation and configuration is available on Youtube.

The same functions available on local UI can be used also on mobile device once connected with the cloud service.