For future use:
My setup: a laptop for coding & compiling, rpi running openHUB.
- git clone GitHub - openhab/openhab-addons: Add-ons for openHAB
- find the binding to work on, in my case it’s in openhab-addons/bundles/org.openhab.binding.denonmarantz
- compile the binding without any code changes to make sure the compilation works OK
mvn clean install -pl :org.openhab.binding.denonmarantz
- On compiling errors first check java --version and mvn --version and make sure it’s all OK with the versions
- Make changes or apply patches
- Compile again
- Successful compilation producer jar file in the target directory. In my case in openhab-addons/bundles/org.openhab.binding.denonmarantz/target and the file is called org.openhab.binding.denonmarantz-4.1.0-SNAPSHOT.jar
- Transfer the file to the hardware running openhab to /usr/share/openhab/addons/ (on raspbian)
9 Change the ownership of the file with
sudo chown openhab:openhab org.openhab.binding.denonmarantz-4.1.0-SNAPSHOT.jar
- log in openHAB console with
ssh -p 8101 openhab@localhost
- search for the binding:
openhab> la -s|grep -i denonmarantz
237 │ Active │ 80 │ 4.0.1 │ org.openhab.binding.denonmarantz
245 │ Active │ 80 │ 4.1.0.202308011911 │ org.openhab.binding.denonmarantz
- check the files (one is the original one, one is modified):
openhab> la -l|grep -i denonmarantz
237 │ Active │ 80 │ 4.0.1 │ mvn:org.openhab.addons.bundles/org.openhab.binding.denonmarantz/4.0.1
245 │ Active │ 80 │ 4.1.0.202308011911 │ file:/usr/share/openhab/addons/org.openhab.binding.denonmarantz-4.1.0-SNAPSHOT.jar
13 Uninstall the original binding and check it’s removed:
openhab> uninstall 237
openhab> la -s|grep -i denonmarantz
245 │ Active │ 80 │ 4.1.0.202308011911 │ org.openhab.binding.denonmarantz
openhab> la -l|grep -i denonmarantz
245 │ Active │ 80 │ 4.1.0.202308011911 │ file:/usr/share/openhab/addons/org.openhab.binding.denonmarantz-4.1.0-SNAPSHOT.jar
- I run update (looks like OH3 might behave in a different way than OH4:
update 245 file:/usr/share/openhab/addons/org.openhab.binding.denonmarantz-4.1.0-SNAPSHOT.jar
- Enjoy!