Migration from OH 1.x to OH 2 Tutorial

Minor updates, mostly notes on testing.

additionally /etc/default/openhab should be backed up if it exists in your installation

1 Like

Lots of little updates including adding /etc/defaults/openhab to the list of things to backup per @arnold’s suggestion, adding instructions for Designer, adding instructions for My.openHAB, and adding some notes of gotchas I’ve encountered along the way.

Added instructions for migrating to a 2.0 binding.

RE: missing sitemaps
Rich you may have already solved this but fwiw it was the default sitemap being set to _default in both the classicui and basicuic cfg files on my instance.

OK, it’s late; I’ve just completed a first run through of this…many questions…

I’ve installed the following bindings:

Installed via paper UI, Config auto created
=================
org.openhab.binding.astro-1.9.0.jar
org.openhab.binding.http-1.9.0.jar
org.openhab.binding.mios-1.9.0.jar
org.openhab.binding.modbus-1.9.0.jar
org.openhab.binding.mqtt-1.9.0.jar
org.openhab.binding.networkhealth-1.9.0.jar
org.openhab.binding.weather-1.9.0.jar - Fails?
org.openhab.persistence.influxdb-1.9.0.jar
org.openhab.persistence.mapdb-1.9.0.jar

Installed via paper UI, manual config file
==============================
org.openhab.binding.milight-1.8.3.jar - Installed, manual config file
org.openhab.binding.ntp-1.8.3.jar - Installed, manual config file

Manual - copied over
====================
org.openhab.action.astro-1.8.3.jar
org.openhab.binding.rfxcom-1.8.3.jar
org.openhab.io.squeezeserver-1.8.3.jar
org.openhab.action.squeezebox-1.8.3.jar
org.openhab.binding.squeezebox-1.8.3.jar
org.openhab.io.transport.serial-1.8.3.jar
  1. Do these questions need a thread of their own?
    2a) Only the NTP binding has anything which appears as a Thing?
    2b) When I select the ‘+’ for a thing, I only get the option to add an NTP thing?
  2. The weather binding fails, however when I comment out the config lines, and restart, it still remembers the config?

Cheers
James

Thanks! I did figure out how to bring up the sitemap using ?sitemap=default. I’ll try renaming my file to _default.sitemap and see if I no longer need to specify the sitemap.

I’m still trying stuff and need to rework the above pretty heavily to emphasize the text file only approach (Kai has indicated this would be the preferred approach for OH 1 migrators).

If they are problems with the migration itself, I think here is pretty appropriate. If they are specific to a single binding then a new thread might be more appropriate.

That is correct. For the most part 1.x bindings will not create Things. Only 2.0 native bindings support things, and even then not all of them will automatically discover and create Things for you.

I too only had NTP put something into my inbox until I installed the zwave 2.0 binding.

For most of the bindings listed, you will need to create traditional OH 1.x Items with a regular Binding config, not Things. Only the 2.0 bindings are guaranteed to support Things and honestly the the NTP 1.9 binding is the only 1.9 binding that I’ve used that has anything to do with Things and only it and the Nest binding added a configuration widget to PaperUI.

In short, what you see is expected. Even once you add new 2.0 bindings, you may have to populate a .things file manually. And as I responded to kamajo, text files is the preferred approach (and the tutorial above will be edited to reflect that).

I’m not using the Weather binding so I’ve no direct experience to bring to bear. However, if there is a configuration widget in PaperUI for the Weather Binding AND you configured it through that widget, those settings end up in a MapDB database. I don’t think it is really known what takes precedence in this case. You will also find some versions of the file in userdata/cache/org.eclipse.osgi/7/data/config/org/openhab/ and /userdata/cache/org.eclipse.osgi/7/data/config/binding/ but I don’t know if those are just temps or what they are.

(After answering I’d say the answer to 1) is they most definitely belong in this thread, not new threads).

I’m going to rework the above to downplay the importance and use of PaperUI. Now that I know a bit more about it, where it came from, and what it is/is not capable of, and Kai’s recomendations I think it is important to deemphasize its use in OH 2, at least for now.

I have a question regarding linking of channels/items. As suggested (I am a recent OH1 user), I have kept my items file and now wanted to link all items (mainly zwave) to the appropriate channels using the items file {channel="…"}.

My question: Can I see anywhere if the creation of a link using the items file was successfully? Is there a log entry? Anywhere in HABmin or PaperUI? I see that the items file was loaded again but I can’t see the link in PaperUI or HABmin. Also I don’t get any values when I load my sitemap. But I see values in the channels of the things in HABmin. So I assume the channels are correctly set up.

When I link a channel to an item with PaperUI (so that it’s stored in the DB), I’ll get a log entry and after that I can see the link in PaperUI and HABmin. But I want to go the old fashioned way…

Further notice: I have defined several groups in my items file. And in the log file I get error messages like this when launching the sitemap:

Cannot retrieve item 'gSicherheit' for widget org.eclipse.smarthome.model.sitemap.Frame

So it seems that the items file is loaded, but not parsed at all?

Any suggestions? Am I doing something wrong?

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.