Z-Wave system OH2 to OH3

Thanks Rich,

Yeah, that was pretty obvious to me too.
But, just one more question please:
As I see it I need to do a fresh install but can’t use Backup and Transfer since that just installs the same bad system. I need to copy the Rules and Items (files) manually, but where can I find them?
Thanks again,

What do you mean by “(files)”. If you are defining your rules and items in files surely you know where those files are since you’ve been editing them. If you’ve defined everything in the UI and you want to know where that stuff gets saved, $OH_USERDATA/jsondb. Not that Items, ItemChannelLinks, and Item Metadata are all stored in separate files. Rules are in the automation files.

Sorry to bother you again, but I finally understand my problem. You were right, and I need your expert advice.
In OH2 the Stick Identifier was “zwave:device:xxxxxxxx:node…”
In OH3 the stick identifier is “zwave:serial_zstick:xxxxxxxx:node…”
I just typed in the number (x) and did not notice the name change to “zwave:serial_zstick”.
How can I fix this without editing all 138 Items? Exclude and Include or what?

You’ve a number of options.

  1. If you plan on using the semantic model, it will probably be less work in the long run to use “Create equipment from Thing” to recreate your Items anyway. You can create hundreds of Items this way in just a few minutes. When you do it this way all the Items get created in place in the semantic model and all the links are established out-of-the-box. After migrating half my Items over by hand and the other half by recreating them, I cannot recommend doing it by hand.

  2. Stop OH and manually change the name of the stick ID and all the zwave Thing IDs to match the old IDs in $OH_USERDATA/jsondb/org.openhab.core.thing.Thing.json.

  3. Stop OH and manually change the name of the stick ID and all the zwave Thing IDs to match the new IDs in $OH_USERDATA/jsondb/org.openhab.core.thing.link.ItemChannelLink.json.

  4. In MainUI individually remove the old link and add the new link.

Thanks for the options.
I found 2 Thing.json files containing old OH2 UIDs located in ./var/lib/openhab/jsondb and .srv/openhab-userdata/jsondb.

Would it be OK to keep the new Stick UID and just update UIDs in the two Thing.json files, since it was emphasized during Stick inclusion that the UID can’t be changed.

Could that be all, and do I have permission?

This is how you bypass that restriction. Through the UI or through the REST API indeed, you cannot change the UID of a Thing. However, while OH isn’t running, you can change anything you want in the jsondb files as long as you are exceptionally careful and consistent. It is in fact easy to mess up so if you are worried you would do well to recreate the Links rather than do brain surgery on OH.

The files are owned by user openhab. You’ll probably have to use sudo.

I’ve no idea what /srv/openhab-userdata is or where is comes from. Maybe it’s a symbolic link to the /var/lib/openhab folder for the samba share?

Finally got OH3.4.2 running on files only for a start.
A few things:

  1. The Stick UID was changed by OH after installation. Stick install UID was zwave:serial_stick.xxxxx, while the actual UID was zwave:device:xxxxx.
    A learning point, and my GUI mode show stopper.

  2. But now I get a gazillion number of ERROR messages like this:

“Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/SF_Bath_Setpoint.rrd’: Invalid file header. File [/var/lib/openhab/persistence/rrd4j/SF_Bath_Setpoint.rrd] is not a RRD4J RRD file”

However, folder and files are present. Can it be fixed?

  1. Is there a way to change Z-Wave device parameters in files only mode? If not, I may have to try GUI again, knowing about the stick UID issue.


What happens if you stop OH, delete the files in $OH_USERDATA/persistence/rrd4j and then start OH again?


Thanks Rich,
I’m finally running OH 3.4.2 GUI, but I have struggled for dayyys to get it going. In the end I had to use the following two different UIDs for the Stick and my File based Items:

2023-03-15 13:43:42.056 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘zwave:serial_zstick:d5fd2f9335’ changed from OFFLINE (BRIDGE_OFFLINE): Controller is offline to ONLINE

2023-03-15 13:43:42.059 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘zwave:device:d5fd2f9335:node13’ changed from OFFLINE (BRIDGE_OFFLINE): Controller is offline to ONLINE

Is this as expected?
Thank a million for your time and extreme patience!!

Well, yes. You can have only one Thing with a given UID. The Thing defined in files and the Thing defined in the UI are two different Things so they must have different UIDs. You can’t mix and match.

Thanks Rich,
OH3 GUI Mode is now running fine, but I have a quick final question if a may:
I want to use Astro:sun:local sunrise and -fall times to switch outdoor lights. Here is the trigger I’ve set up, which I believe is OK?


But I can’t find (or have overlooked) in the docs and GUI, how to apply time offset (+/- n min) to these triggers.
Would you have a quick GUI tip?
Thanks again for your time. Much appreciated!!

Got to the Astro Thing under Settings-> Things and click on the Channels tab. Find the Channel you want to supply an offset for, click on it and choose edit the channel config (or whatever it’s called). You can set the offset there. But be aware that there’s only the one offset per Channel. If you need multiple offsets on the same Channel, you’ll need to create multiple Astro Things.

Geee, that was quick.
Thanks a million.
I overlooked the channels tab. Thought it was page info only since it wasn’t red. Got it.