Skip to content

OpenHAB

András Jankó edited this page Aug 24, 2017 · 1 revision

OpenHAB

Open Home Automation Bus

Install

Install OpenHAB for your platform. For linux, installation is recommended from package repository. Additional steps are not required from the installation page. Installation

Setup

After installation, start yourt OpenHAB instance, as described in the installation article.

The link to your OpenHAB (Maybe needs some time to load)

If the installation was successful, you should see the package selection screen: alt text

Choose expert mode, then wait for it to setup. After the setup was successful, the UI-s should be available.

Paper UI usage information:

Fetures:

  1. Installing new bindings, UIs, services etc.
  2. Adding/Deleting/Editing Things, and Items.
  3. Adding/Deleting/Editing Rules.

If the Rules menu item not available in your current installation, you should install it

  1. **Add-ons --> Misc --> Rule Engine (Experimental) --> install (Maybe the installation circle won't stop, but its already installed, just reload)
  2. You should see the Rules menu Item now, if not, then reload page. (There was a problem for me, in the 2.0 version, for not showing, but in 2.1 it works fine)
  3. Sometimes when starting/restarting OpenHAB leaves the rules in UNINITALIZED state, you have to click on them and aplly again. alt text

There are two item linking modes, can be changed via Configuration --> System --> ItemLinking.

  1. If Simple Mode is switched ON, when adding a new Thing, corresponding items will be automaticly created, however manual item adding is disabled.
  2. If Simple Mode is swtiched OFF, when adding a new Thing, you have to setup manually, the corresponding things. If they don't exist, you even have to create them.

Creating a new Item (only available if Simple Mode is off)

  1. Configuration --> Items --> Blue plus
  2. Name must be unique, no spaces allowed (The filed has input validation)
  3. Label is the text, which will be displayed to the user. (Not required, but recommended)
  4. Type can only be thefrom the given types, usually Switch. (For more information about types visit ESH Itmes documentation)

Linking an existing Item, or creating a new Item to a channel of a Thing

  1. Configuration --> Things --> Thing Name you have previously created --> Name of the Cannel --> Blue plus --> Choose an Item or create a new Item.

HABPanel usage information.

This is the most commonly used UI to interact with items in OpenHAB. alt text

  1. The UI is organized into different dashboards (for eg. ground floor, upper floor)
  2. Dashboards contains widgets, which can control Items, display data from them or navigate to another dashboard.
  3. By default, the dashboards are persisted into the local web storage, which means, its browser and device specific. Persistance can be changed, in the advanced settings, to save to the OpenHAB configuration file (Recommended). It stores them in userdata/config/org/openhab/habpanel.config. If you change the config file to a new one, you should choose in the advanced settings, to load that panel configuration from the config file.

Logs

Logfiles are located in userdata/logs

events.log

Contains the logs from the ESH events, example: 2017-07-20 17:26:51.405 [ItemCommandEvent ] - Item 'mqttSwitch' received command ON 2017-07-21 13:34:08.426 [ItemStateChangedEvent ] - WeatherInformation_Temperature changed from 27 to 28 2017-07-21 13:34:08.430 [ItemStateChangedEvent ] - WeatherInformation_Humidity changed from 60 to 57 2017-07-21 13:34:08.431 [ItemStateChangedEvent ] - WeatherInformation_Pressure changed from 996.00 to 995.00

openhab.log

Logs from the OpenHAB logger. Logs form your binding should be also be here. 2017-07-20 15:50:06.982 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-misc-hueemulation': Error restarting bundles 2017-07-20 17:21:33.358 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed. 2017-07-21 11:42:07.039 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel

MQTT

  1. Install and configure MQTT broker, I used Mosquitto for this. Configure port to be 1183 instead of the default 1883.
  2. To enable MQTT in OpenHAB, you need to install MQTT binding, and configure it.
  3. Configuration files are located in conf/services mqtt.cfg contains the broker connection information, mqtt-eventbus.cfg contains the eventbus configuration informations.
  4. After setting up the configuration files, restart/start OpenHAB (Make sure MQTT broker is running)

OpenHAB developer environment

To be able to contribute to OpenHAB, or develop a binding, you have to setup the developer environment. Ide setup Choose all Github repositories (OH 2 addons, OH 1 addons, ESH addons, etc.) Some projects contains errors, you can simply close them, you will only need a few of them.

Install your own binding to a release version

If you have tested your binding and want to release it, generate a jar file from it and copy it to openhab/addons