ZWave4J

ZWave4J is a Java wrapper for Open-ZWave library

License

License

GroupId

GroupId

com.github.zgmnkv
ArtifactId

ArtifactId

zwave4j
Last Version

Last Version

0.3
Release Date

Release Date

Type

Type

jar
Description

Description

ZWave4J
ZWave4J is a Java wrapper for Open-ZWave library
Project URL

Project URL

https://github.com/zgmnkv/zwave4j
Source Code Management

Source Code Management

https://github.com/zgmnkv/zwave4j

Download zwave4j

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.zgmnkv/zwave4j/ -->
<dependency>
    <groupId>com.github.zgmnkv</groupId>
    <artifactId>zwave4j</artifactId>
    <version>0.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.zgmnkv/zwave4j/
implementation 'com.github.zgmnkv:zwave4j:0.3'
// https://jarcasting.com/artifacts/com.github.zgmnkv/zwave4j/
implementation ("com.github.zgmnkv:zwave4j:0.3")
'com.github.zgmnkv:zwave4j:jar:0.3'
<dependency org="com.github.zgmnkv" name="zwave4j" rev="0.3">
  <artifact name="zwave4j" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.zgmnkv', module='zwave4j', version='0.3')
)
libraryDependencies += "com.github.zgmnkv" % "zwave4j" % "0.3"
[com.github.zgmnkv/zwave4j "0.3"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

ZWave4J

ZWave4J - java wrapper for OpenZWave library.

The goal is to provide to java the same API as OpenZWave has. Besides the wrapper ZWave4J has a simple executable Main class which demonstrates how to work with ZWave4J.

Supported platforms:

  • Windows: x86, amd64
  • Linux: x86, amd64, arm
  • OS X: x86, amd64

Usage

You can download the latest ZWave4J release from GitHub or from Maven Central, or unstable snapshot from sonatype.

To execute sample Main class, run:

java -cp zwave4j-X.jar org.zwave4j.Main "open-zwave/config" "/dev/ttyUSB0"

  • First argument is path to OpenZWave configuration directory.
  • Second argument is path to serial device, which Z-Wave controller is connected to, e.g. /dev/ttyUSB0 for Linux or //./COM1 for Windows.

Build

Requirements

  1. JDK 1.7+
  2. GCC (MinGW for Windows)
  3. OpenZWave sources

Build configuration

  1. Copy example.gradle.properties into gradle.properties.
  2. Edit properties in gradle.properties:
  • openZWaveDir - path to OpenZWave library source directory, needed compile.
  • openZWaveConfigDir - path to OpenZWave configuration directory, needed for OpenZWave library in runtime.
  • zWaveControllerPort - path to serial device, which Z-Wave controller is connected to.

Build

Run ./gradlew build (gradlew build for Windows) in console. It will compile native JNI binaries and java classes, assemble jar archive and put it into build/libs directory. Native binaries for platforms supported by your host will be built. To include native binaries for other platforms into compiled jar, put native_libs directory from other ZWave4J jars in the project root directory.

After build

If you have built a library from sources, you can use several options:

  • Run ./gradlew install to install library into local maven repository for using ZWave4J as a library in your other projects.
  • Run ./gradlew run in console. It will execute sample Main class.
  • Run ./gradlew installApp to install application with start scripts into build/install/zwave4j, then you can start it manually from build/install/zwave4j/bin: zwave4j.bat "open-zwave/config" "/dev/ttyUSB0"
  • Execute ZWave4J Main class manually from build/libs directory: java -cp zwave4j-X.jar org.zwave4j.Main "open-zwave/config" "/dev/ttyUSB0"

Development

You can generate IntelliJ IDEA project files running ./gradlew idea task. You can use C/C++ plugin to work with native sources.

Versions

Version
0.3
0.2