Getting Started with OH3: rewriting the tutorial - 3. Adding a Thing (simple)


This Wiki topic’s goal is to serve as a working document, in order to provide an up-to-date tutorial for OH3 aimed at new users and novices. Everyone is welcome and encouraged to edit it, when we’re satisfied it will make its way to the official docs. You may reply for the specific purpose of improving the article are allowed, but please, this is NOT a support thread: if you’re stuck while reading this and are simply seeking support please open another thread. Thanks!
This tutorial has transitioned to the official docs. Please see Adding Things - Simple | openHAB


As covered in the concepts section [TODO add link] of the openHAB Docs, a binding is an add-on to openHAB that understands how to communicate with a home automation technology or API. A Thing represents a single device in openHAB. Each sensor (information provided by the device) or actuator (control on the device to cause it to do something) is represented by a Channel on the device. Things are the connection between openHAB and your external device or API using the binding.

Some technologies require a special type of Thing called a “bridge”. A bridge is a device or connection through which openHAB connects to other devices. For example, in this tutorial light bulbs are accessed through a hub device. That hub device is represented by a bridge Thing.

This tutorial covers an example of the easiest and most common method for adding Things, using automatic discovery.

Scenario: You have some Philips Hue light bulbs connected to an official Hue bridge. In this case, the Hue binding supports auto discovery of both the bridge, the bulbs and other devices.

Install the Binding

After logging in as an administrator click on Settings from the sidebar, then click on Things.

Click on the blue “+” button located at the bottom-right corner.

Since you have no bindings, this screen will appear:

Click on Install Bindings.

Look for the Hue binding (The search bar at the top can help find bindings quicker by filtering the long list), click on it then on Install:

It might take from a few seconds to a minute for the binding to install…

Wait for it to disappear from the list, then click < Back (or use the browser controls).
The Hue binding will now appear on the previous screen. You will notice that the auto discovery has already detected something (note the red “1” badge).

Accept the Discovered Bridge Thing

Click on the binding.

The bridge has indeed been detected and appears under Discovered Things. If not, you can try again by clicking the Scan Again button.

Click on the discovered Hue Bridge.

openHAB will ask you to confirm or change the label/name. Click OK after naming the new Thing.

You will be taken back to the Things page, where now the Hue Bridge should now appear:

However, we can see that it’s marked offline. To find out why we can click on the Hue Bridge.

The error description below the status gives some more information: You have to press the physical button on the device to let openHAB authenticate to it. Once you’ve done this, the Thing will become online:

Accept the Light Bulb Things

Go back to Things.
You will notice a new red button on that screen:

image

It means that there are newly discovered devices that you can add; since the Hue bridge is now working, the binding has detected all the Hue devices (bulbs, switches and so on) attached to it.

The Inbox is a consolidated view of all the discovery results, alternatively you can also click on the “+” button to get a per-binding view, and the ability to perform a new scan.

Click Inbox.

You can either click on an individual thing to see actions related to it, or you can click on Select in the top-right corner to add check boxes beside items, which will allow you to perform actions on several inbox entries at once.

image

These actions are:

  • Approve: promote the candidate from the Inbox to a Thing
  • Ignore: hide the candidate from the list (you will be able to see it again and un-ignore it by clicking on “Show ignored” above the list
  • Remove: remove the candidate from the Inbox (it might be detected again later).

Go back to Things: the newly approved Hue Things should appear on the list.

You now have the Bridge Thing and the two light bulbs added to openHAB. Thankfully most of the bindings you will work with in openHAB will work in this simple way. However, there are some technologies that require a bit more manual configuration.

Next -> Intermediate Thing Creation
Previous -> First Steps

Next -> Add Things - Intermediate
Previous <- First Steps

2 Likes

As I mentioned I wonder if the Network binding or Astro binding would make a better example here as it will allow the user to follow along in their own system without possessing Hue devices. But that binding won’t show everything demonstrated here (the offline until clicking the button for example). Maybe we keep this one and add Network?

I do think it’s important to present the users at least in part with something they can do themselves regardless of what hardware they have.

7 Likes

3 posts were split to a new topic: Prominence of add & save button on OH3’s UI

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.

Next article:

EDIT: Added a few sentences to describe some of the concepts presented and broke the tutorial into sections.