Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel2

...

As a sub-class of ZigbeeDevice, it inherits everything from that class and its parent Device class, as well as providing convenience methods for interacting with Thermostats.

API

...

changeSystemMode(SystemMode systemMode)

Usage

Sends a command over the network to change the System Mode of a Thermostat.

...

NameTypeDescription
systemModeSystemModeA enumeration with the following values: off, auto, cool, heat, emergency _ heating, pre _ cooling, fan _ only, dry, sleep

Returns

Return TypeDescription
PropertyCommandData

Contains a CompletableFuture<Property> of the property being modified by the command.

Contains the last known (cached) value of the property being modified by the command.

...

Code Block
languagejava
GatewayClient gateway = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"),
...
Collection<Device> thermostats = gateway.getDevices( d -> d.getDeviceType().equals(ThermostatDevice.DEVICE_TYPE) );
for (Device device : thermostats) {
    ThermostatDevice thermostat = (ThermostatDevice) device;
    thermostat.changeModechangeSystemMode(SystemMode.OFF);
}

...

readSystemMode()

Usage

Sends a command over the network to read the Mode of a ThermostatDevice (i.e. SystemMode)

...

Return TypeDescription
CompletableFuture<Property>A CompletableFuture of the 'systemMode' Property.

Examples

Code Block
languagejava
GatewayClient gateway = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"),
...
Collection<Device> thermostats = gateway.getDevices( d -> d.getDeviceType().equals(ThermostatDevice.DEVICE_TYPE) );
for (Device device : thermostats) {
    ThermostatDevice thermostat = (ThermostatDevice) device;
    CompletableFuture<Property> futureMode = thermostat.readMode();
    
    // you can block on the future, or handle it asynchronously
    // blocking example
    Property systemMode = futureMode.get();
 
    // async example
    futureMode.thenAccept( systemModeProperty -> System.out.println("systemMode: " + systemModeProperty) );
}

...

Returns

Return TypeDescription
PropertyCommandData

Contains a CompletableFuture<Property> of the property being modified by the command.

Contains the last known (cached) value of the property being modified by the command.

...

Return TypeDescription
CompletableFuture<Property>A CompletableFuture of the 'fanMode' Property.

Examples

Code Block
languagejava
GatewayClient gateway = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"),
...
Collection<Device> thermostats = gateway.getDevices( d -> d.getDeviceType().equals(ThermostatDevice.DEVICE_TYPE) );
for (Device device : thermostats) {
    ThermostatDevice thermostat = (ThermostatDevice) device;
    CompletableFuture<Property> futureMode = thermostat.readFanMode();
    
    // you can block on the future, or handle it asynchronously
    // blocking example
    Property fanMode = futureMode.get();
 
    // async example
    futureMode.thenAccept( fanProperty -> System.out.println("fanMode: " + fanProperty) );
}

...

adjustOccupiedSetpoint(Setpoint setpoint, int amount)

Usage

Sends a command over the network to adjust the cooling or heating Setpoint up or down by a specified amount.

...

Code Block
languagejava
GatewayClient gateway = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"),
...
Optional<CommandData> command;
Collection<Device> thermostats = gateway.getDevices( d -> d.getDeviceType().equals(ThermostatDevice.DEVICE_TYPE) );
for (Device device : thermostats) {
    ThermostatDevice thermostat = (ThermostatDevice) device;
    
    command = thermostat.adjustSetpointadjustOccupiedSetpoint(Setpoint.COOL, 10); // adjust cooling setpoint up by 1 degree
    command.get().getCommandResult().thenAccept( result -> System.out.println("adjust cooling setpoint result: " + result) );

    command = thermostat.adjustSetpointadjustOccupiedSetpoint(Setpoint.HEAT, -10); // adjust heating setpoint down by 1 degree
    command.get().getCommandResult().thenAccept( result -> System.out.println("adjust heating setpoint result: " + result) );
}

...

readOccupiedCoolingSetpoint() / readOccupiedHeatingSetpoint()

Usage

Sends a command over the network to read the Occupied Cooling or Heating Setpoint of a ThermostatDevice.

Returns a CompletableFuture of the 'setpoint' Property.

This is a non-blocking call.

Parameters

...

None.

Returns

Return TypeDescription
CompletableFuture<Property>A CompletableFuture of the 'setpoint' Property.

Examples

Code Block
languagejava
GatewayClient gateway = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"),
...
Collection<Device> thermostats = gateway.getDevices( d -> d.getDeviceType().equals(ThermostatDevice.DEVICE_TYPE) );
for (Device device : thermostats) {
    ThermostatDevice thermostat = (ThermostatDevice) device;
    CompletableFuture<Property> future = thermostat.readSetpointLimitreadOccupiedCoolingSetpoint(Setpoint.HEAT);
    
    // you can block on the future, or handle it asynchronously
    // blocking example
    Property setpoint = future.get();
 
    // async example
    future.thenAccept( setpoint -> System.out.println("setpoint: " + setpoint) );
}

...

setOccupiedCoolingSetpoint(double temperature) / setOccupiedHeatingSetpoint(double temperature)

Usage

Sends a command over the network to set the cooling or heating Setpoint to a specified amount.

...

Parameters

setpoint
NameTypeDescription
temperatureSetpointAn enumeration with the following values: heat, coolsetpointLimitintdoubleThe amount to set to setpoint to, in tenths of a degree (i.e. 2350 = 23. For example 24.5 degrees), etc.

Returns

Return TypeDescription
PropertyCommandData

Contains a CompletableFuture<Property> of the property being modified by the command.

Contains the last known (cached) value of the property being modified by the command.

...

Code Block
languagejava
GatewayClient gateway = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"),
...
Collection<Device> thermostats = gateway.getDevices( d -> d.getDeviceType().equals(ThermostatDevice.DEVICE_TYPE) );
for (Device device : thermostats) {
    ThermostatDevice thermostat = (ThermostatDevice) device;
    thermostat.setSetpointLimitsetOccupiedHeatingSetpoint(Setpoint.HEAT, 235023.5); // set the heating setpoint to 23.5 degrees
}

...

Return TypeDescription
CompletableFuture<Property>A CompletableFuture of the 'runningMode' Property.

Examples

Code Block
languagejava
GatewayClient gateway = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"),
...
Collection<Device> thermostats = gateway.getDevices( d -> d.getDeviceType().equals(ThermostatDevice.DEVICE_TYPE) );
for (Device device : thermostats) {
    ThermostatDevice thermostat = (ThermostatDevice) device;
    CompletableFuture<Property> futureMode = thermostat.readRunningMode();
    
    // you can block on the future, or handle it asynchronously
    // blocking example
    Property runningMode = futureMode.get();
 
    // async example
    futureMode.thenAccept( runningModeProperty -> System.out.println("runningMode: " + runningModeProperty) );
}

...

Returns

Return TypeDescription
DeviceTypeThe DeviceType object categorizing and identifying the ThermostatDevice.

Examples

Code Block
languagejava
...
Collection<Device> thermostats = gw.getDevices( d -> d.getDeviceType().equals(ThermostatDevice.DEVICE_TYPE));
...
System.out.println("ThermostatDevice type: " + gw.getDevice(idStr).getDeviceType().getType() );
...

...