Best practices for z-wave?

Upon just starting with this (maybe I am confused by my previous OH 1.x experience, long time ago) but how do you actually get a not yet official release of a binding into the system?

I downloaded the M5 release (just released) as a tar file, repackaged it into a jar (which I suspected that I needed to do), uninstalled the 2.3 version of the binding and placed the 2.4 M5 version as a file org.openhab.binding.zwave.jar in /usr/share/openhab2/addons/ of my openhabian installation. And then I restarted openHAB.

No z-wave. What do I need to do? Is there something magical I need to do with the jar file?

You should just need to go to the addons section in PaperUI and install the binding.

Sorry for the simple question, but I am really not getting the binding to be seen by openhab.

I placed it in /usr/share/openhab2/addons/ :

$ ls -al 
totalt 4564
drwxrwxr-x+ 2 openhab    openhabian    4096 okt 30 19:03 .
drwxr-xr-x  4 openhab    openhab       4096 jun 30 22:13 ..
-rw-rw-r--  1 openhabian openhabian 4659614 okt 30 07:39 org.openhab.binding.zwave-2.4.0.jar
-rw-rw-r--  1 openhab    openhabian      70 maj 28 10:33 README

but all I am seeing is the option to install the 2.3.0 version.

Sorry for asking the silly questions, but please enlighten me on how to name the jar file and where to place it in an openhabian installation. According to the README file, I really think it is placed in the correct location. But something is still not working correctly.

It looks like you are running OH 2.3. You can upgrade to the OH M5 milestone build through the openHABian config menu. I am not familiar with openHABian, but I know this has been discussed in the forum, and may also be in the documentation. Once your OH is upgraded, the latest zwave binding will be available to install through Paper UI.

It is possible to install bindings by putting the jar into /addons/, but when you do, you will not see it listed in Paper UI. I have built a script to help in manually installing the binding, but you’ll also find steps for performing the manual install yourself, including the location to download the latest snapshot build of the binding.

Once installed, you will need to add the controller Thing, which will then add into the Inbox all of the nodes that it is aware. Hope this helps!

If you placed the jar in the addons folder it should have become active already, but as @5iver correctly states that won’t be shown in PaperUI. Use ‘bundle:list|grep -i zwave’ in Karaf console to see if it’s running.
But I’d suggest moving to the M5 milestone as well, then you should be able to use PaperUI to deploy it.

Ok , I get that I need to move to M5, but this step scares me to be honest.

Will I have to recreate all my things in order to change binding version? No offense, I realize that this must be a good reason behind this requirement, but I would lie if told you that I was looking forward to a process of adding all things again.

There is a script - does it work?
(What will fail?)

The nodes don’t need to be excluded/included again. Just delete the Things and rediscover them. Not painless, but also not too bad.

The need to do this was driven by a major redesign/restructure of the zwave binding in order to implement security. But, in addition to security, there’s also plenty of good stuff in the new version – faster, more reliable, nightly healing, UoM, etc.

I didn’t use @5iver’s script, but those who did use it found it very helpful.

We’ve all be through the transition, so there’s plenty of people who can help out if you run into trouble.

Things are new to OH2, and are not the actual zwave devices. As Mark pointed out, this does not mean excluding and reincluding every device. Chances are good that you haven’t even configured any of them, though there is some configuration that could be done… like polling interval. To clarify a little further, these configurations are specific to OH and are not the actual device configuration parameters which are stored in the devices. Those stay where they’re at.

If you haven’t changed any of the Thing configs, then there should be no issue to just delete them and then kick off a Z-Wave discovery to add them to the Inbox, and then approve them to get everything back the way it was. For ~20 devices, just do it manually. It’s a few clicks each. More than that, then you will probably appreciate the script. Worst thing that can happen with the script is that it doesn’t work, and you need to do it manually. Always good to have a good backup though!

Just give a shout if you have questions or run into trouble!

Yes, trouble. I don’t know what to say, because I realize of course that sometimes you need to break things in order to make it better. But, if 2.4.0 is to become a stable release, and people that then upgrade from 2.3 thinking it will be safe to upgrade, they will be disappointed I think. If you are a serious user of z-wave for your home.

After switching to M5 and running the script I now have this list of Things:

zwave:serial_zstick:edde6877 (Type=Bridge, Status=ONLINE, Label=Razberry 2, Bridge=null)
zwave:device:edde6877:node52 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 052, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node51 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 051, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node50 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 050, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node13 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 013, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node57 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 057, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node12 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 012, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node56 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 056, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node11 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 011, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node55 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 055, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node10 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 010, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node54 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 054, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node9 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 009, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node49 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 049, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node48 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 048, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node47 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 047, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node6 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 006, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node5 (Type=Thing, Status=UNINITIALIZED (HANDLER_CONFIGURATION_PENDING), Label=Z-Wave Node 5: FGD212 Dimmer 2, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node8 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 008, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node7 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 007, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node2 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 002, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node4 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 004, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node3 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 003, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node20 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 020, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node24 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 024, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node23 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 023, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node67 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 067, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node21 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 021, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node17 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 017, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node16 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 016, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node15 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 015, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node59 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 059, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node14 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 014, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node58 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 058, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node19 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 019, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node18 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 018, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node71 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 071, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node31 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 031, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node30 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 030, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node73 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 073, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node72 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 072, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node35 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 035, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node33 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 033, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node77 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 077, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node76 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 076, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node28 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 028, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node27 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 027, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node26 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 026, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node25 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 025, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node29 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 029, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node42 (Type=Thing, Status=ONLINE: Node initialising: GET_CONFIGURATION, Label=Z-Wave Node 042: 004001 Smoke Detector and Siren, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node41 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 041, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node40 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 040, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node44 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 044, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node39 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 039, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node38 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 038, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node37 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 037, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node36 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 036, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node70 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 070: 004001 Smoke Detector and Siren, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node46 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 046: 004001 Smoke Detector and Siren, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node68 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 068: 004001 Smoke Detector and Siren, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node45 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 045: 004001 Smoke Detector and Siren, Bridge=zwave:serial_zstick:edde6877)
zwave:device:edde6877:node69 (Type=Thing, Status=ONLINE, Label=Z-Wave Node 069: 004001 Smoke Detector and Siren, Bridge=zwave:serial_zstick:edde6877)

So, which one is which? The number of clicks to set up the things again and links is an issue, but knowing which switch is which is a bigger one.

Is there no way to migrate also Thing descriptions (and groups)?

Can you expand on why this is? From what I’ve read above, you’ve only just managed to get your system upgraded, and I’m not sure what the problems are that you are having with the binding?

I’m not sure what trouble you’re having. If your Things were removed and rediscovered, then everything should be good. Or are you still having trouble with the migration? Devices> Things> Channels> Links> Items. Coming from OH 1.x, you will have Items files, and your Z-Wave items will need to be modified to link to the Channel. You could also create Items in Paper UI, but they would also need to be linked to a Channel. Managed (Paper UI created) and unmanaged (Item files) Items can coexist too, so you can have a mix of each. Here is an example unmanaged Z-Wave Item:

Dimmer    US_DiningRoom_Dimmer    "Dining Room [%d%%]"    <slider>    (gUS_DiningRoom,gUS_DiningRoom_Action,gLight)    ["Lighting"]    {channel="zwave:device:07cb40a2:node36:switch_dimmer"}

In Paper UI> Configuration> Things> select your Thing, you can view the Channels, and there is a control to copy the Channel to your clipboard to paste it back into the Items file. You can also run smarthome:things show zwave:device:07cb40a2:node36, and scroll to the bottom to see the Channels. It’s the IDs that are the tricky part to find when migrating:

Channels:
        ID: switch_dimmer
        Label: Dimmer
        Type: zwave:switch_dimmer
        Description: The brightness channel allows to control the brightness of a light. It is also possible to switch the light on and off.

        ID: scene_number
        Label: Scene Number
        Type: zwave:scene_number
        Description: Triggers when a scene button is pressed

There is a tutorial on migrating too…

Sorry I mentioned OH 1.x at the onset. I was referring to the way you just added jar files to a directory back then to install bindings. I switched from OH back then and came back to now due to new developments. So I am not migrating a OH1 system.

Sure. Yes, it seems that I have almost all nodes set up and migrated to the new binding. So far so good. What I was referring to was that yes, I have a Thing for node 69 now in my system, but which device in my house is actually controlled by node 69?

I am sure I can go back to the backups I made before upgrading and figure it out and set all names again, make links with the proper names and all that, but effectively I am now starting over with the system.

I hope this does not mean that I will have to do this all again for every new release? Please tell me if I have misunderstood something, or missed a crucial step somewhere.

I’m not sure, but I don’t really see how that’s a binding problem as such. Your earlier message talked about people being disappointed about stability, but it doesn’t look like you have such stability problems?

No, I don’t know what the stability of the binding is. I am sure it is fine. What I said was that

that is, I would be very surprised to say the least if I hit the (virtual) upgrade button within openhabian stable and found that all my z-wave things were now named Node 32 and so on, with no information stored about the device or links to channels remaining. So I was referring to users using stable releases of openHAB and perhaps expecting a smooth transition between openhab versions. Not stability of the z-wave binding as such.

So, there is no way to get the previous names of Things back then?

It sounds like you do not have Items files, or your Links would still be there. If no other Things have been added/removed, you can restore your Thing names and Links by shutting down OH, and restoring the following files in /userdata/jsondb/ from backup:

org.eclipse.smarthome.core.thing.Thing.json
org.eclipse.smarthome.core.thing.link.ItemChannelLink.json

You will run into issues though if the update changed any Channels in the Thing definitions, so you may want to diff the files to verify this first, and then update the backup files if there were any Channel changes,

This will not happen.

Node numbers will not change unless you exclude and re-include devices which is not required. The binding will interrogate all devices and retrieve all data, and items should remain the same. The only exception to this is that if channels have changed, then there may be some changes here, but this is a general issue with database updates and not related to the update of this version at all.

I understand. But it would be nice to have also the names of devices retained when you switch from 2.3 to 2.4. Just a bunch of Things named “Node 69” and something similar, that used to be named “bedroom lights” and so on before the upgrade is almost a reason not to upgrade.

Correct. 99% of Things are set up in the Paper UI gui.

I will try this. And if it does not work then I just have to set up the ~60 things and 180 links again manually. Not a terrible thing if it is a one off event. If everything breaks in 2.4 M6 I will stay on M5 indefinitely :-).

I don’t disagree - it would be nice, but not possible without a lot of work, sorry.

No worries. If it is a one off thing then its just down to sittning down and doing it.

Relaterad to the original topic topic though - it seems that I am still advised to use item files for z-wave devices. Sounds appealing now that I will be doing lots of copy and pasting for identical devices once I have identified which ones they are.

But, how does this work then if you don’t use Paper UI for setting them up? Do you then configure them solely using Habmin? Or, do you make the things in Paper UI and then links to channels in items files?

What is the best procedure for handlings z-wave devices? Mind you, I do use quite a lot of the features of z-wave and the devices themselves. Like associations and settings, autoturnoff and similar (not so much alarm frames though) so I would prefer to have good access to the built in stuff.

So, how should I do it?

I define the items for all my zwave devices in a zwave.items file (creative, huh?).

I use HABmin exclusively to manage the zwave things.