Zigbee and Z-Wave manual install script

zigbee
installation
zwave
Tags: #<Tag:0x00007fe0548af890> #<Tag:0x00007fe0548af750> #<Tag:0x00007fe0548af610>

(Scott Rushworth) #1

A number of people have run into trouble performing manual installs of the Zigbee and Z-Wave bindings. A manual install (dropping the jar into addons) is rarely needed, but some people prefer a manual install over apt-get, or want to use a stable OH release with a recent Zigbee or Z-Wave binding. Here is a script that will hopefully make it easier to install, upgrade, and uninstall these bindings, and prevent some of the common issues. Note: the development Z-Wave binding has been merged into the master branch, so a manual install is no longer required (just use a recent snapshot or milestone build >=M4).

Who would benefit from this script:

  • Anyone wanting to test development versions of the Zigbee or Z-Wave bindings before they are available in a snapshot or milestone build. If this is the case, then you are likely working closely with Chris to resolve and issue or implement a feature.
  • Anyone wanting to remove a manually installed Zigbee or Z-Wave binding. It’s easy to delete the jar, but OH may have cached the bundle, which then needs to be uninstalled through the Karaf console.
  • Anyone wanting to install the openhab-transport-serial feature. This needs to be reinstalled after an OH update or after clearing the OH cache, if you’ve manually installed one of these bindings. I’ll typically just run this script to update the bindings after updating OH, which will also installs this feature.
  • Anyone who wants to use a manual install of one of these bindings, but doesn’t know where to download them.
  • Anyone wanting to automate the upgrade of a manually installed version of these bindings.

More details in the readme.md…

I have tested the script quite a bit, but feedback from others would be much appreciated!

Reminder… if you install/upgrade/uninstall the refactored Z-Wave binding, don’t forget to delete and rediscover your Things!

Note: the development Z-Wave binding has been merged into the master branch, so if using this script, only choose the development version for Z-Wave if Chris instructs you to do so (he may throw a test jar out there).


Can I use the latest zwave-2.4.0-SNAPSHOT with OH2.3.0 Release Build?
How to install Zigbee 2.4.0?
Zigbee binding
Zibee Yale YRD216 PBDB
ZWave Controller Offline After Reboot
Battery Drain - Danfoss - Pulling every few seconds
[JSR223-Jython] Simplified rule definition (similar to Rules DSL) and universal decorator
Best practices for z-wave?
Zigbee - XBee - Coordinator stuck on UNKNOWN
QUBINO ZMNHXD1 not included despite in Z-Wave Database
ZWave binding migration to development version
Null pointer exceptions and 500 - Internal server error when configuring z-wave smoke detector
Funky looking z-wave network (which still works fine)?
Z-Wave: No xml for The OCTAN Remote (NodOn)
OH2 Z-Wave refactoring and testing... and SECURITY
Zigbee - XBee - Coordinator stuck on UNKNOWN
Zigbee binding
Zigbee binding
XBee S2B
[SOLVED] Z-Wave devices remain unknown after update
Smartthings Zigbee outlet item in OH flips off as soon as I turn the outlet on
(Kim Andersen) #2

A small suggestion.
Explain in details what this script does (or suppose to do). Help people, thats always nice. But what if something goes wrong… Then it´s nice to know, what was suppose to happen.


(Scott Rushworth) #3

I’m guessing you haven’t looked through the readme or script, because there is a lot more information in both. I didn’t think it was necessary to duplicate that information in this post. I plan to include steps to perform the manual installs in the first post, but I’ve been sitting on this script a while and wanted to get it out for people to be able to use. And hopefully save @chris some headaches! As I noted in the readme, there is currently very little error checking. If people are using the script and running into errors, I’ll likely add some. If the script fails, the worst thing that will happen is that you’ll need to log into Karaf to uninstall any old binding(s) and install the serial transport, remove any old jars, download the new jars, and copy them into addons. Exactly as you would need to do if installing them manually. This is still a WIP!


(Kim Andersen) #4

You´re right, I didnt look through the readme or the script, sorry!.
I just thought a small note regarding what it actually does would come in hand… But I see now all info is in the readme.


(Scott Rushworth) #5

@chris, what would you like done with the development branch options? The zwave one is dead, at least for now, and the bintray never seems to have anything newer than Cloudbees for zigbee. I could make a note to note use them, pull them out completely, or make them into a custom option that points to your server so you can get some test bindings pushed out.

Removing the option is easy… :wink:


(Chris Jackson) #6

For ZWave, it can be removed. For ZigBee, it would be normal to have newer libraries in bintray than in the TP. The libraries are updated every couple of weeks, but Kai doesn’t want the TP updated too often, so this is likely to be every 2 to 3 months. I would therefore expect that this would still be useful where we flow some change into the core libraries, but the TP isn’t updated yet.

Having test bindings on my server is something I might do occasionally in special circumstances (eg maybe I want to temporarily add some heavy debugging, but don’t want to actually put this into github), but I prefer to avoid it if possible. Having an option for this though might be useful as I know it can confuse people.

Thanks for providing this.


(Burzin Sumariwalla) #7

Hi @5iver,

I noticed this on GitHub

This script is interactive and will prompt for input. It requires to be executed from the addons directory on the openHAB server, using the same account that runs openHAB . A

Is this account typically openhab?

Regards,
Burzin


(Scott Rushworth) #8

Yes. The script will let you know if you are using a different account to make sure you know what you are doing.


(Burzin Sumariwalla) #9

I seem to be doing something wrong.

I’m trying to run:

sudo -u openhab bash /usr/share/openhab2/zzManualInstall.sh --ACTION zwave --ZWAVE_BRANCH development
Querying configuration parameters...
mkdir: cannot create directory ‘/home/archive’: Permission denied
mkdir: cannot create directory ‘/opt/openhab2-backup’: Permission denied
mkdir: cannot create directory ‘/home/archive’: Permission denied

Downloading latest jar...
mv: cannot stat '/opt/openhab2/userdata/logs/zwave/zwave.log': No such file or directory
cp: cannot stat '/opt/openhab2': No such file or directory
diff: /opt/openhab2: No such file or directory
diff: /home/archive/20181008_230008_openhab2_full/openhab2: No such file or directory

Full backup successful...

Next step is to remove unneeded files. Do you wish to continue?
1) Yes
2) No
#?

What am I doing wrong?


(Kim Andersen) #10

Is this the path where you have your addons ??
I believe the script should be place in the same folder where your addons are located.


(Scott Rushworth) #11
  1. You are running the backup_and_update.sh script.

  2. You should not select the Development Z-Wave branch, since it has been merged into Master. The discussion above with Chris was in regards to removing the option from the script.

  3. You are not following the instructions in the README.

It requires to be executed from the addons directory on the openHAB server, using the same account that runs openHAB.


(Scott Rushworth) #12

@stephanSH, I’m replying here, to keep the Zigbee thread cleaner. I’ve gotten very little feedback on the script, so this is helpful. I’ve been using it successfully for a while, but recently I’ve noticed a couple of issues, likely from OH changes, and plan to clean them up. To address your concerns…

I’ll mention the requirement of curl in the readme, and maybe add a check in the script and message that curl is not installed. Although, I could also use wget. Is that installed by default?

I’m not sure what you meant by this, but assume the context was in the other thread. Are you using the script with arguments? I’ve only been using the menus.

This should not have happened, and does not occur for me. I’m specifically removing any old versions, as having more than one installed will cause a lot of issues. Were there any errors when the script ran?

This definitely should not have happened. I’m thinking the script may have had an error and did not complete. Did you get a message saying it completed successfully?

How are you adding it to the addons.cfg? TMK, this is not possible, but you could be adding the serial binding, which will also install the serial transport. This is what I’ve done, since I was tired of installing it after every OH upgrade (I use snapshots).


(stephan) #13

Hi scott, thanks for your detailed replies.
I am relatively new to OH so the script was a great help for me and I only wanted to help others with my notes:

  • curl is fine - great idea to add it to the readme. wget is installed by default in ubuntu server 18.04.1
  • following the readme section I thougt I had to insert this value (1.1.7) in the script so chris helped me with the actual version and I thought others might be interested. I used the script with menus but changed that value before
  • the necessity for removal might be explained by the installation of the zigbee binding through PaperUI. I had one error (unfortunately I don’t remember exactly) but the script continued and afterwards it gave me a “completely successful” so I was just happy:-)
  • I added binding = serial1 in the addons.cfg - so after your explanation this is probably the binding. For me it had the same effect as the karaf command

I also use snapshots - but my actual problem is that the mqtt binding is updated which means a lot of work to change many item, but that is another topic…


(Scott Rushworth) #14

Glad it helped! And thank you for the feedback. I haven’t heard much, so assumed nobody was using it, or it was working well. It’s worked fine for me until recently (the zwave binding gets upgraded but jasn’t been starting).

The current version should be read in from the repos. If you choose Development, this is displayed as the default, but can be changed…

Occasionally, the build servers are not accessible, or you could have an Internet issue. But I think when this happens, the script will error. The script wold benefit from more error checking, to at least message the user when there is a problem like this.

The script will remove manually installed jars, and bindings installed through Paper UI or Karaf. It sounds to me like the script was not able to get into Karaf when you ran it. This would have prevented the uninstall and installation of the serial transport. Is there anything peculiar to your setup? Are you sure you ran it with the account that runs OH, and entered the correct password?

The older mqtt binding is still available. If you have modified the binding line in addons.cfg, you’ll need to change it to mqtt1.


(stephan) #15

I believe many had used the scripts as chris had recommended them several times to solve problems. I don’t use zwave - so I had no problems.

great hint for future uses

That might have been the problem… I used it with sudo bash -u openhab …

Yes, I found it, but I don’t believe there is further development in the future so I will have to change it in the future…


(Kim Andersen) #16

Hi @5iver
I´m trying to run your script on a new setup (new Rpi with only one binding running). I discovered I could use it to install the transport-serial-feature.
But I get this error (Karaf). And i can not see if the transport-serial feature got installed.

This script is capable of downloading and manually installing the latest developme                                                     nt or master branch builds of the Z-Wave and Zigbee bindings, and/or the openhab-t                                                     ransport-serial
feature. The script must reside inside the addons folder and be executed on the ma                                                     chine running OH. Before a binding is installed, any previous versions will be
uninstalled. Any manually installed versions will also be backed up by moving them                                                      to addons/archive. The installation of any binding will also include the installa                                                     tion
of the opemnhab-transport-serial feature. After using this script, you can uninsta                                                     ll the bindings by deleting their jars from addons or you can use this script.\033                                                     [0m

!!!!! If you have manually added the Zigbee or Z-Wave binding to your addons.cfg f                                                     ile, they must be removed from the file or the old version will reinstall !!!!!

What would you like to do?
1) Install or upgrade Zigbee binding
2) Install or upgrade Z-Wave binding
3) Install or upgrade both bindings
4) Install the openhab-transport-serial feature
5) Uninstall Zigbee binding
6) Uninstall Z-Wave binding
7) Uninstall both bindings
8) Exit
#? 4

     *****     SUMMARY     *****

Addons path: /usr/share/openhab2/addons
OH account: openhab
Requested action: Install the openhab-transport-serial feature

Is this correct?
1) Yes, start now                      3) Exit
2) No, take me back to the first menu
#? 1

Installing openhab-serial-transport...
mkdir: cannot create directory ‘/usr/share/openhab2/userdata/tmp’: No such file or                                                      directory
KARAF_BASE is not valid: /usr/share/openhab2/userdata

Complete!

[12:11:25] openhabian@openHABianPi:/usr/share/openhab2/addons$


(Scott Rushworth) #17

Sounds like your permissions may be an issue. How are you launching the script? Can you please try getting into Karaf using /usr/share/openhab2/runtime/bin/client?


(Kim Andersen) #18

I really hate these permission issues in Linux :face_with_symbols_over_mouth:

I´m not sure how to do that or what you mean :frowning:
I normally enter Karaf by first entering a terminal using openhabian client. And the from the terminal using ssh -p 8101 openhab@localhost. From there I´m promted to write the pw for openhab, which works fine. And then I´m in Karaf.


(Scott Rushworth) #19

Just enter the command from an openhabian terminal, instead of using ssh.


(Kim Andersen) #20

Ahh… I thought it was a path… Anyway… It´s working just fine:

[13:26:34] openhabian@openHABianPi:~$ /usr/share/openhab2/runtime/bin/client
Logging in as openhab

                          __  _____    ____
  ____  ____  ___  ____  / / / /   |  / __ )
 / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  |
/ /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ /
\____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/
    /_/                        2.4.0
                               Release Build

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown openHAB.

openhab>