Migration from OH 1.x to OH 2 Tutorial

I looked through my logs and do not see anything printed with the logs set at the default level nor do I see anything from zwave when set to trace.

I also see nothing in PaperUI to show there is a link. I’ve not used Habmin much yet but it does appear there is a spot hidden away in the Things section that does show the channels and what Items are mapped to them.

Configuration -> Things -> Select a Thing -> Select Channels from the bottom right -> It will now show all the Channels and what Items are linked to them.

You can also see if all your Items and Groups appear in Configuration -> Items on Habmin so if you are unsure that your file is being fully loaded you can check there to see if everything is there that you expect. If not there is likely an error in your Items file preventing it from being fully parsed.

I’m not sure what could be wrong but maybe looking at Habmin will help up narrow it down.

Thanks Rich. For whatever reason, I couldn’t get it to go with my installation. No item was linked and therefore the sitemap produced nothing useful. I still don’t know why this happened (or better: not happened). So I decided to do a clean install and go from scratch. And et voila, this time it worked. I linked the items in the .items file and after that I found active links in HABmin (as you described) and also in PaperUI I got the blue circle with the white dot in it! Even the karaf console now shows all links when I enter “smarthome:links list”.

I am getting there with my new OH2 installation. :wink:

Added a bunch more detail about manual configuration and working with the Karaf console instead of PaperUI. There are still several HELP! s above I need some expert to tell me how it works.

As far as I’m concerned, with the exception of the remaining questions, this tutorial is complete unless there are some additional suggestions offered.

I might edit it sometime later this week for grammar, spelling and consistency (and I’d love to figure out how to do those in post links @ThomDietrich put in his Influx+Grafana tutorial).

It’s the markdown language which is also used by github:

  1. create text and format as heading
  2. create the text for the link
  3. use [linktext](#target-heading):

linktext

Note: for each space in the heading text you need to write a dash.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

target heading

.
.
.
.
.
.
.
.
.
.

Thanks! It was the dashes replacing spaces that I was missing.

That would be great but no, it’s not implemented that way in Discourse. There is a proposal to add that functionality over at meta.discourse.org but it’s not implemented yet.

My solution is HTML based:


* [Starting Point](#starting-point)
* [InfluxDB Installation and Setup](#influxdb-setup)

...

## <a name="starting-point"></a>Starting Point

This guide is based on and was tested with the following components:

I am not an expert but I’ll have a look tomorrow!

Close … but not close enough :joy:

Hehe sorry :smiley:

Added a warning and recommendations for those who were using port forwarding to access their openHAB instance remotely since openHAB 2 doesn’t yet have authentication.

Hi,

How can we write rules for dynamically created items? Is it possible? What should be the approach if yes?

Regards,
Abin

You’ll need to change the link in the original post to /nginx.html instead of /jetty.html.

You should just need to write the rule the same way as you would with any other item. If you made the switch Example_Switch in paperUI, then you can write a .rules file that references it.

The Rules engine shouldn’t care whether an Item was dynamically created or not. So long as you have that Item’s name and/or a Group the Item is a member of the Rule should be able to access it and postUpdate/sendCommand.

If you are asking how to dynamically create an Item inside Rules, I have no idea.

Done

This may be a dumb question, but can I install 2.0 alongside 1.8?

I appreciate both can’t run at the same time, but I’ll feel much more comfortable starting the migration if I can switch back at any time if I run into teething problems.

thanks,

Dan

These instructions do just that. In fact, I seem to have neglected a step to uninstall OH 1.8 at all. I myself still have OH 1.8.3 installed on my machine.

But, as you note, you cannot run them both at the same time.

Hi Rich Koshak,

Thank you for your response.

If we have the name, we can use it in Rules. Maybe this is out of the scope of OpenHAB, my query was how to manipulate items where we don’t know the rule. For example, is there any way we can access the item registry and do a search, something like that. Any idea?

Regards,
Abin

brilliant - thank you. Can I ask, out of interest, which you use on a daily basis?

If you log into the Karaf console, you can get the list of Items with the command:

smarthome:items list

See http://docs.openhab.org/administration/console.html for logging in and http://docs.openhab.org/administration/runtime.html for commands you can issue.

1 Like

I’ve fully switched over to OH 2 now. I’m still tweaking things here and there but for the most part it is up and running the same as it was for OH 1.8. I still have 1.8 on my machine but it is no longer running.

Hi Rich,
Thanks for this great start.

I did not find a section on the “addons.cfg”.
To my understanding this file should be used to enable an easy upgrade and port to a different machine. It textual states which 2.0 bindings should be installed.
So no need to use paper Ui (at least for 2.0 bindings) every time you moved to a new machine or corrupted the paper Ui data base. It only seems to work for 2.0 binding and one seems not to have the ability to specify the installation of 1.x binding. If I am not wrong ?

What I also do not know how to cope with the karaf console. F.e. if have switch on the log using log:tail I have not figured out how to come back to the karaf prompt.

Additionally for windows user (i know that you are not) one has to define environment variables “JAVA_HOME” otherwise OH 2 is always asking for registry entry every time OH 2 is starting.
I am still struggling what the right folder is and did not find a good documentation.

All in all it is very early and last weekend was my 4th attempt to port and basically I was again stuck. To me it seems that the steps take from 1.x to 2.0 are pretty (too) big and a more backward compatible approach would have been desirable.

At the time I wasn’t aware of addonds.cfg. However, if it is limited to just 2.0 bindings I would put its use outside the scope of the migration tutorial This tutorial is purposefully arranged to gradually transition to OH 2 bindings. As such, a tutorial on addons.cfg would probably belong as its own tutorial.

The console seems to work a lot like a regular shell. Does <ctrl>-c not work? I usually tail the openhab.log instead.

If you have 64-bit Oracle Java installed it’s c:/Program Files/Java/jre1.8.0_101 or what ever later version you have installed. If 32-bit its c:/Program Files (x86)/jre1.8.0_101. Be aware that this folder will change as updates install.