khubla.com HomeSeer Client

A Java Client for HomeSeer

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

com.khubla.hsclient
ArtifactId

ArtifactId

hsclient
Last Version

Last Version

1.18
Release Date

Release Date

Type

Type

jar
Description

Description

khubla.com HomeSeer Client
A Java Client for HomeSeer
Project URL

Project URL

https://github.com/teverett/hsclient
Project Organization

Project Organization

khubla.com
Source Code Management

Source Code Management

https://github.com/teverett/hsclient

Download hsclient

How to add to project

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

Dependencies

compile (4)

Group / Artifact Type Version
org.apache.httpcomponents : httpclient jar 4.5.13
commons-io : commons-io jar 2.8.0
com.fasterxml.jackson.core : jackson-databind jar [2.9.10.1,)
ch.qos.logback : logback-classic jar 1.2.3

test (1)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-engine jar 5.4.0

Project Modules

There are no modules declared in this project.

CI

HomeSeer Java Client

A Java client for the HomeSeer JSON API.

The java interface API for hsClient is here HSClient.java

Versions 1.12+ of hsClient also have client support for the Z-Wave plugin API here

The client was built based on this pdf and this documentation

HomeSeer versions hsClient was tested against include:

  • HS4 version 4.1.2.0+
  • HS3 Pro (SEL) Edition 3.0.0.548
  • HS3 Pro (SEL) Edition 3.0.0.550

hsClient is one of numerous HomeSeer support applications created by khubla.com, including

License

hsclient is distributed under the BSD 3-Clause License.

Maven coordinates

<dependency>
   <groupId>com.khubla.hsclient</groupId>
   <artifactId>hsclient</artifactId>
   <version>1.17</version>
</dependency>

Usage

Simply instantiate an HSClient and call the API methods

To get all Devices:

final HSClient hsClient = new HSClientImpl();
hsclient.connect(URL, USERNAME, PASSWORD);
try {
   final Map<Integer, Device> allDevices = hsClient.getDevicesByRef();
} finally {
   hsClient.close();
}

To get all Events:

HSConfiguration hsConfiguration = new HSConfiguration(URL, USERNAME, PASSWORD);
final HSClient hsClient = new HSClientImpl();
hsclient.connect(hsConfiguration);
try {
   final Map<Integer, Event> allEvents = hsClient.getEventsById();
} finally {
   hsClient.close();
}

To get a single Device:

HSConfiguration hsConfiguration = new HSConfiguration(URL, USERNAME, PASSWORD);
final HSClient hsClient = new HSClientImpl();
hsclient.connect(hsConfiguration);
try {
   final Device device = hsClient.getDevice(DEVICEREF);
} finally {
   hsClient.close();
}

Using the poller

hsClient includes a multithreaded poller which calls a callback interface. To use the poller, provide an implementation of DataPointCallback to the class Poller.

In hsClient V1.13+, the poller uses the "getdeviceschanged" API for more efficient polling. The poller can be configured to only send data when device values change, or can be configured to send data for all devices on every polling cycle.

Example polling:

HSConfiguration hsConfiguration = new HSConfiguration(URL, USERNAME, PASSWORD);
Poller poller = new Poller(hsConfiguration, POLLINTERVAL_MS, MY_DATAPOINTCALLBACK, THREADCOUNT, true);
poller.run();

Versions

Version
1.18
1.17
1.16
1.15
1.14
1.13
1.12
1.11
1.10
1.9
1.8
1.7
1.6
1.5
1.4
1.3
1.1.0
1.0.0