Tl;dr - Your current Zwave binding can be updated with a new/modified Zwave device XML prior to a build being available using the “jar” command.
This updates the forum posting here (OH2 based) to OH3/OH4. Please review that posting first for background and cautions that still apply. Besides the “waiting for a build” this process could also be used to update an OH3 ZWave binding with a new/modified device that is only available in an OH4 binding due to limited OH3 “patch releases”.
As with most things “Linux”, there are multiple ways to accomplish the same task. As I am not a Linux expert, the commands I used may not be the best or most efficient.
- The first task is to get the modified XML to your local machine. After making your changes in the ZW device DB and tapping “Request Review” on the Overview tab, use the gear icon to “EXPORT OH2 XML”. Copy the contents to a local xml file. Naming the device xml can be tricky if there is a minimum version. Using this line as an example (thing-type id=“zooz_zse40_17_009” listed=“false”), name the xml “zse40_17_9.xml”. The 17_9 represents the minimum firmware version. For devices that have no minimum version the pattern is zse44_0_0.xml. Also note the [vendor] folder is the first section in the above line. As a PC user with Samba, I move the xml to the openhab-sys folder.
- Alternatively if you are updating an OH3 jar with a device already present in the OH4 binding use the “find file” from the Zwave github “code” tab to find the vendor folder and xml file name.
- SSH into RPi using PuTTY or equivalent. Backup openhab just in case something goes astray.
BACKUP
openhabian@openhab:~ $ sudo openhab-cli backup
<SNIP> PROGRESS REPORTS
Success! Backup made in /var/lib/openhab/backups/openhab-backup-23_06_07-10_58_37.zip
- Create the following directory structure in a convenient location, jarmodify/OH-INF/thing/[vendor].
MAKE FOLDER STRUCTURE
openhabian@openhab:~ $ mkdir /home/openhabian/jarmodify
openhabian@openhab:~ $ mkdir /home/openhabian/jarmodify/OH-INF
openhabian@openhab:~ $ mkdir /home/openhabian/jarmodify/OH-INF/thing
openhabian@openhab:~ $ mkdir /home/openhabian/jarmodify/OH-INF/thing/zooz
- For OH3 installations, in particular, since the OH4 Zwave bindings are not compatible, find the UI installed Zwave binding on your RPi. If there is a previously modified binding it will be in the “Addons” folder (/usr/lib/openhab/addons).
FIND UI INSTALLED BINDING
openhabian@openhab:~ $ cd / <--SWITCH TO ROOT
openhabian@openhab:/ $ sudo find -name "org.openhab.binding.zwave-*"
<SNIP> - COULD BE OTHERS, BUT THE ONES BELOW ARE THE LOCATION NEEDED (AND THE SAME)
./srv/openhab-userdata/tmp/kar/openhab-addons-4.0.0.M3/org/openhab/addons/bundles/org.openhab.binding.zwave/4.0.0.M3/org.openhab.binding.zwave-4.0.0.M3.jar
./var/lib/openhab/tmp/kar/openhab-addons-4.0.0.M3/org/openhab/addons/bundles/org.openhab.binding.zwave/4.0.0.M3/org.openhab.binding.zwave-4.0.0.M3.jar
- Copy current jar to the jarmodify folder created earlier.
COPY UI ZWAVE JAR TO JARMODIFY DIRECTORY
openhabian@openhab:~ $ cp /var/lib/openhab/tmp/kar/openhab-addons-4.0.0.M3/org/openhab/addons/bundles/org.openhab.binding.zwave/4.0.0.M3/org.openhab.binding.zwave-4.0.0.M3.jar /home/openhabian/jarmodify
openhabian@openhab:~ $ cd /home/openhabian/jarmodify (CHECK)
openhabian@openhab:~/jarmodify $ dir
OH-INF org.openhab.binding.zwave-4.0.0.M3.jar
- Copy the device xml from step 1 into the /home/openhabian/jarmodify/OH-INF/thing/[vendor] folder. (openhab-sys = /usr/lib/openhab)
COPY XML FROM SAMBA (alias OPENHAB-SYS)
openhabian@openhab:~/jarmodify $ cp /usr/share/openhab/zse44_0_0.xml /home/openhabian/jarmodify/OH-INF/thing/zooz
- Update the jar while in the jarmodify folder.
UPDATE THE JAR WITH THE XML
openhabian@openhab:~/jarmodify $ jar uf org.openhab.binding.zwave-4.0.0.M3.jar ./OH-INF/thing/zooz/zse44_0_0.xml
- Open the karaf console, find current zwave bundle number and update the binding.
LOG INTO CONSOLE & FIND ZWAVE ID
openhabian@openhab:~/jarmodify $ sudo openhab-cli console
openhab> bundle:list |grep ZWave
254 x Active x 80 x 4.0.0.202305270039 x openHAB Add-ons :: Bundles :: ZWave Binding
UPDATE BINDING
openhab> bundle:update 254 file:///home/openhabian/jarmodify/org.openhab.binding.zwave-4.0.0.M3.jar