First time setup questions OH2


(Tom Still) #1

Hey guys

I have just taken the plunge into OH2 and Linux for the very first time. I have almost 0 experience with command line work but have done quite well setting up Ubuntu VM on my QNAP and now have a working instance of OH2 installed.

I have made a lot of drawings and plans on how i want my house to look in the end, but at this point i havent purchased any smart devices to work with OH2…apart from my Samsung TV and Onkyo Amp.

So, after setting up OH2 as per the guide from Openhab i was able to install the bindings for Samsung and Onkyo via the new UI. I understand that i will need to create the following to get started

*Items File
*openhab.cfg
*Sitemap

I have mapped two shares to my PC: “openhab2-userdata” and “openhab2-conf”

Im not sure where i can find the file openhab.cfg as the tutorials im following mention editing those files for bindings etc. Is this now different in OH2?

Last thing to ask was the OH2 install guide didnt mention anywhere about MQTT - Do i need to install that on Ubuntu seperately now? If so should i stop the openhab2 service first?


(Stefan) #2

Regarding openhab.cfg: Yes, you are right. In OH2 there is no openhab.cfg anymore. This was only used in OH1. Now with OH2, every binding has it’s own cfg file, which can be found in openhab2-conf/services.

As I’m not using MQTT, I cannot answer this question. Sorry.


(Alexander Strnad) #3

Hi @Tom_Still,

the binding configurations in OH2 are now all under openhab2-conf/services - every binding gets its own configuration file (knx.cfg, jdbc.cfg, etc).

You can install an MQTT broker on ubuntu via apt-get install through the following packages:

mosquitto - MQTT version 3.1/3.1.1 compatible message broker
mosquitto-clients - Mosquitto command line MQTT clients

I don’t think you need to stop openhab2 first, it’s a seperate softwarepackage.


(lipp_markus) #4

Maybe just to add here as I still fall prey to the confusion sometimes, please keep in mind that OH is transitioning from version 1.8 to version 2.0 with a substantial overhaul in file structure and other items. There is no OH1.9 but bindings are available in ver1.9 and will work in both OH1.8 and OH2. Yet they are not fully at the level of 2.0 bindings (for example, the discovery mechanism works only in 2.0 bindings)
Here a few tips:

  • you do not have to stop OH when changing the configuration (items, bindings, conf files, things, etc); OH2 picks it up automatically and integrates the changes after a few seconds. Having said that, I saw this mechanism fail occasionally
  • watch the OH2 log file a lot of feedback is available there, for example OH2 will tell you if it is reloading files and if it runs into any problems there (open a separate shell window, and type in tail -f /var/log/openhab2/openhab.log it will print out on the screen any new messages in your logfile, just keep it running
  • as already stated MQTT is a separate program, you can install without any interference
  • but you will need a binding to have OH2 interact with MQTT
  • MQTT is a ver1.9 binding and needs a conf file; newer bindings ver2.0 will not require this and can be configured in the PaperUI
  • OH2 has also introduced ‘things’, the PaperUI is very helpful, but you may want to read up on it
  • when checking the forum and the internet, always try to understand whether you receive info for version1.9 or version2.0; not always easy to spot, but critical.
    Finally, as you will come across sooner or later, there is a nifty tool out there “Eclipse Smart Home Designer” that makes editing all the items, rules, sitemap, etc files easier; but nothing is perfect, please note that ver0.9 is broken and will give a lot of syntax errors that are in fact no errors, ver0.8 is better, but does not recognize some of the newer developments so it still give you errors that are none…

(Tom Still) #5

Thanks! Found it now :slight_smile: Although i noticed i installed the Samsung binding via the UI and it doesnt appear in that folder, only the Onkyo and Kodi bindings appeared. I guess that means i have to handle it like the 1.x version even though its listed in OH2 Bindings?


(Tom Still) #6

Thanks a lot! MQTT installed and working :wink:


(Tom Still) #7

Some really helpful stuff there thanks Lipp. So i take it that not every binding shown in the paper UI under Add-ons / Bindings is actually OH2 supported?

I have the Smart Home Designer installed now and just want to see if i can for a start turn on and off my Onkyo amp :slight_smile:


(Andreas Luft) #8

Hi,
I am in a similar situation. Have started on a PI3. In a few weeks I want to switch on a Synology NAS (which should replace my old one with no Java support).
I could install the samsung binding via PaperUI and I can see it. Maybe you need a restart of your openhab system. this helped me with my Homematic binding :wink:
Good luck!


(lipp_markus) #9

If they show up in the PaperUI they are supported, BUT… as far as I understand there are different levels of support. All bindings will work, but in different ways. Those labeled 1.9.0.0-SNAPSHOT will work in a more restricted way and for example do not support the discovery of things in the PaperUI and you will have to work more through text files and not in the PaperUI.
In some occasions you will see two versions of the same binding (1.9 and the 2.0) in this case, the 1.9 version will have a trailing “1” in the name to indicate the difference. The forum is your friend which one will work best for your needs (for example, the 2.0 version of the exec binding seems to be harder to use). I trust that you found the documentation (docs.openhab.org), which is also extremely helpful and some more info you can find on github. At times it can be rather a puzzle to pull it all together…but it is still in beta they say…:grin:


(Branden Smale) #10

One problem you will probably run into with the Sammy is not being able to turn it on. Ways around this is IR, or HDMI CEC. CEC is the way I’m going to be trying via my Kodi.


(Tom Still) #11

Good to know, i was planning to add a IR blasting device in the living room at a later stage.

I wonder if my Onkyo amp could turn on the TV via CEC…


(Stefan) #12

The Samsung binding is listed as an native 2.x binding:

http://docs.openhab.org/addons/bindings.html

So you don’t have to handle it like an 1.x binding.

Which folder do you refer to? The services folder? Maybe the binding doesn’t need any configuration parameters and therefore doesn’t create a cfg file? See here:

http://docs.openhab.org/addons/bindings/samsungtv/readme.html


(lipp_markus) #13

You are entering rewarding and challenging territory here… these types of effects are the core of home automation of course and can quickly become surprisingly complex. OH2 has a very powerful rules engine that as far as I understand runs essentially Xtend (which itself is based on JAVA).
you may want to read all subsections here: http://docs.openhab.org/configuration/index.html
rules are described to some extent in there, you are likely to need the other sections (e.g., persistence and transformation) too or will at least need to be familiar with the concepts.


(Branden Smale) #14

This i dont know, but as i said, i personally have kodi, which I know will by cec.


(Tom Still) #15

Just if anyone is interested i will be making a tutorial on setting up OH2 and Ubuntu (probably also RPi later) and then configuring OH2 with some smart devices, making the sitemap etc. once i have my setup working nicely

Is there somewhere i should post that once ive completed it? I was going to put something on Instructables maybe as (and correct me if im wrong) but i didnt see any complete end to end tutorials for Oh2?


(Stefan) #16

There is a tutorials section here in the forum:

https://community.openhab.org/c/setup-configuration-and-use/tutorials-examples

(Branden Smale) #17

May i ask why when there is openhabian? Not to defrade what you are trying to accomplish, but @ThomDietrich has done a phenomenal job making setup so easy!


( ) #18

Hey Tom, @Branden_Smale is right, for one there is openHABian, on the other hand there is however already the document here: http://docs.openhab.org/installation/linux.html
What else do you need?

Please post all your tutorials in the Tutorials & Examples category here in the forum. Check out:

Additionally it would be amazing if you could help add content to the official documentation: http://docs.openhab.org
If you are willing to help, please let me know and I can tell you a bit more about the open topics.