Modify a zwave binding jar to add/change a zwave device while waiting for a build

Cloudbees kicked us off their service awhile back so we set up our own build server. The ci.openhab.org site would be the place you would look normally. However, the builds are currently broken so it seems possible that the OH2 addons are not being successfully built right now.

I’ll update the OP. You can always go to bintray for jars too. Here’s zwave…

https://openhab.jfrog.io/openhab/online-repo-snapshot/2.5/org/openhab/binding/org.openhab.binding.zwave/2.5.0-SNAPSHOT/org.openhab.binding.zwave-2.5.0-SNAPSHOT.jar

Would this then be the correct link?

https://ci.openhab.org/job/openHAB2-Bundles/ws/bindings/org.openhab.binding.zwave/target/org.openhab.binding.zwave-2.5.0-SNAPSHOT.jar

Looks like it.

https://ci.openhab.org/job/openHAB2-Bundles/lastSuccessfulBuild/artifact/bindings/org.openhab.binding.zwave/target/org.openhab.binding.zwave-2.5.0-SNAPSHOT.jar

I uninstalled the Z-Wave binding (from the 2.5.0 snapshot), then downloaded the latest successfully built Z-Wave binding JAR file to /usr/share/openhab2/addons.

Upon restarting OpenHAB2 I saw the following error message:

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.zwave [201]
Unresolved requirement: Import-Package: gnu.io

It’s apparently due to the absence of a now required feature: openhab-transport-serial.

openhab> bundle:list | grep -i zwave
250 │ Installed │  80 │ 2.5.0.201904070025     │ ZWave Binding
openhab> bundle:list | grep serial
openhab> feature:install openhab-transport-serial
openhab> bundle:list | grep serial                                                                                                                             
251 │ Active   │  80 │ 3.14.0                 │ nrjavaserial
252 │ Active   │  80 │ 3.15.0.OH2             │ nrjavaserial
openhab> logout

Works like a charm!

Nope, already since two years :rofl:

When using a manual binding installation, you need to manually install any dependencies too. And you will need to reinstall them after clearing the cache. This script may be helpful…

2 Likes

Hi @5iver ,
I tried this but got following questions/problems on running an OH 2.4 on a PI3:

  1. Where can I download a org.openhab.binding.zwave-2.4.0.jar (from stable release) ?
    I found one on my local disk and used this
    ./var/lib/openhab2/tmp/mvn/org/openhab/binding/org.openhab.binding.zwave/2.4.0/org.openhab.binding.zwave-2.4.0.jar
  2. I deinstalled my zwave binding and restarted OH2. After copying the modified jar file to /usr/share/openhab2/addons nothing happened, no zwave binding started… what am I doing wrong?

Thanks for any support in advance.
Markus

sorry, point 2 is solved. I think it just took some time and maybe the restart did it, but the jar file is loaded.
is it ok to use this 2.4.0 jar file from my locla disk as mentioned above in point 1?

Yes… it is the same as what you would download.

I get an error in the OH log, saying it cannot parse my added xml file:
I downloaded this file from the zwave-binding github on a windows machine and copied it to my RI3 via WinSCP. Do you think this could cause the problem due to CR/LF differences?

(upload://wL5IjH79YPJB9OCzXBXtr51ADBo.xml) (202.0 KB)

2019-09-08 15:28:03.908 [WARN ] [ig.xml.osgi.XmlDocumentBundleTracker] - The XML document ‘/ESH-INF/thing/devolo/mt2759_0_0.xml’ in module ‘org.openhab.binding.zwave’ could not be parsed: html
com.thoughtworks.xstream.mapper.CannotResolveClassException: html
at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:79) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:47) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.core.util.HierarchicalStreams.readClassType(HierarchicalStreams.java:29) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:133) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1185) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1169) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1115) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1062) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at org.eclipse.smarthome.config.xml.util.XmlDocumentReader.readFromXML(XmlDocumentReader.java:85) ~[101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.parseDocuments(XmlDocumentBundleTracker.java:407) [101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.processBundle(XmlDocumentBundleTracker.java:394) [101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.access$6(XmlDocumentBundleTracker.java:389) [101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker$2.run(XmlDocumentBundleTracker.java:359) [101:org.eclipse.smarthome.config.xml:0.10.0.oh240]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?][mt2759_0_0.xml|attachment]

mt2759_0_0.xml (202.0 KB)

Try downloading it from jfrog and put the jar file in your addons folder. Uninstall the 2.4 snapshot zwave binding first:

https://openhab.jfrog.io/openhab/webapp/#/builds/openHAB2-Bundles/752/1567925728852/published%20/org.openhab.addons.bundles:org.openhab.binding.zwave:2.5.0-SNAPSHOT

I’ve absolutely no idea what this file is - it’s not what the binding wants anyway. It looks like it’s got a load of github formatting included as well as the database file. You should download it from the database website to be sure.

https://www.cd-jackson.com/index.php/zwave/zwave-device-database/zwave-device-list/devicesummary/1107?layout=openhab2new

1 Like

According to the first non-blank line, it is some sort of HTML file.

When downloading from GH, make sure to select the raw file or you will end up downloading the html…

https://raw.githubusercontent.com/openhab/org.openhab.binding.zwave/master/src/main/resources/ESH-INF/thing/devolo/mt2759_0_0.xml

1 Like

I suspect it was downloaded with all the github page formatting included.

1 Like

Yes! Thanks, I got now the right one and it WORKS!!!
Thank you all

1 Like

It would have been easier to just download the latest zwave snapshot, though :sunglasses:
https://github.com/openhab/org.openhab.binding.zwave/tree/master/src/main/resources/ESH-INF/thing/devolo
The database edits are already merged.

1 Like