Missing openhab.cfg - New OH2 installation on rpi2

I’ve been running openHAB on a Raspberry Pie 2 for a while now. But, I am unable to upgrade from 1.6 when packages are ignored in apt. So, I installed a new openHAB2 instead. Problem is, I am unable to locate the configuration directory and the openhab.cfg file. I installed from repos using the offline variant.

I have located theese directorys:

  • /usr/share/openhab2
  • /var/log/openhab2
  • /etc/default/openhab2
  • /etc/openhab2
  • /var/lib/openhab2

The /etc/openhab2 directory have some typical subdirectories, but no .cfg files:

  • html
  • icons
  • items
  • persistence
  • rules
  • scripts
  • services
  • sitemaps
  • things
  • transform

Any ideas on where to go from here? A hint on how to change trace levels or debug would also be useful:-)

Hi @garvord,

In OH2, there is no openhab.cfg file anymore.

You configure your system via the Paper UI (install bindings, add things, etc) and you can also modify the text based config files in /etc/openhab2/ (e.g. /etc/openhab2/services/mqtt.cfg or /etc/openhab2/items/default.items)

To manage logging, take a look here: http://docs.openhab.org/administration/logging.html & Taming openHAB 2 Logging

Example: to set log level to TRACE to the MQTT binding:

  1. Enter into the Karaf console (ssh openhab@localhost -p 8101 with password habopen)
  2. log:list
  3. log:set TRACE org.openhab.mqtt
  4. log:set TRACE org.openhab.io.transport.mqtt

In general, take a look at http://docs.openhab.org to see how OH2 works
For migration info: Migration from OH 1.x to OH 2 Tutorial

Good Luck,
Dim

2 Likes

I’ll also add that you can create an openhab.cfg file if you are using older openHAB 1.x bindings in legacy mode. These still require their config to be in the OH1.x style.

The 1.x compatibility layer ensures everything works together, but you need to enable it in the Configuration->System menu via paperUI.

1 Like

Thanks, Dim.
That answers most of my initial questions. I’ll look into those resources.

Thanks, Paul.

Might be usefull/necessary to utilise legacy mode, but I hope to avoid that:-)

For clarification.

The reason why I started to look for the openhab.cfg file in the first place, is that the Paper UI did not load after installation. And, based upon the documentation I had read, I was not expecting a functional UI like the default Paper UI. There certainly was references to the Paper and the Classic UI, but it was my understanding that this was a decision that would be made in configuration (meaning after a basic setup of the openHAB2service/daemon).

After a couple of reboots (for debug purposes) there suddenly were a functional (Paper) UI. I have not made any relevant changes, that I am aware of, so this is probably some kind of fluke. But, the documentation suddenly made a lot more sense:-)

Hope this will be of help to anyone that might come across a similar situation.

/G