new _CommunicationObject()

Communication object (CO). May not be directly instanced. An instance of the class is created by the method HomeServerConnector._Connection#getCommunicationObject.

Example

var co = conn.getCommunicationObject("CO@1_1_1", function(err, value, isInit) {});

Methods

addValue(value, callback)

Adds the value.

Examples

Addition of '5' to the current value of the communication object.

co.addValue(5, function(err) {});

Subtraction of '5' ( = addition of '-5') from the current value of the communication object.

co.addValue(-5, function(err) {});

Parameters

Name Type Optional Description

value

Number

 

the value to be added

callback

function()

 

HomeServerConnector._CommunicationObject~addValueCallback

destroy()

Enables the object and cancels any existing subscription.

Example

co.destroy();

getKey() → String

Returns the key of the object.

Example

var object_key = co.getKey();
Returns

String 

getMeta(callback)

Retrieves the metadata.

Example

Retrieval of metadata.

co.getMeta(function(err, data) {});

Parameter

Name Type Optional Description

callback

function()

 

HomeServerConnector._CommunicationObject~getMetaCallback

getValue(callback)

Retrieves the current value.

Example

Querying the current value of the communication object.

co.getValue(function(err, value) {});

Parameter

Name Type Optional Description

callback

function()

 

HomeServerConnector._CommunicationObject~getValueCallback

listNext(callback)

Jumps to the next value in the list.

Example

Setting the communication object to the next highest values specified in Expert in the field 'List'.

co.listNext(function(err) {});

Parameter

Name Type Optional Description

callback

function()

 

HomeServerConnector._CommunicationObject~listNextCallback

listPrevious(callback)

Jumps to the previous value in the list.

Example

Setting the communication object to the next lowest values specified in Expert in the field 'List'.

co.listPrevious(function(err) {});

Parameter

Name Type Optional Description

callback

function()

 

HomeServerConnector._CommunicationObject~listPreviousCallback

offsetMinus(callback)

Reduces the value by the step size.

Example

The value of the communication object is reduced by the value specified in Expert in the field 'Step size'.

co.offsetMinus(function(err) {});

Parameter

Name Type Optional Description

callback

function()

 

HomeServerConnector._CommunicationObject~offsetMinusCallback

offsetPlus(callback)

Increases the value by the step size.

Example

The value of the communication object is increased by the value specified in Expert in the field 'Step size'.

co.offsetPlus(function(err) {});

Parameter

Name Type Optional Description

callback

function()

 

HomeServerConnector._CommunicationObject~offsetPlusCallback

setValue(value, callback)

Sets the value.

Examples

Setting a numerical value.

co.setValue(1.0, function(err) {});

Setting a string.

co.setValue("Text Text Text", function(err) {});

Parameters

Name Type Optional Description

value

(String or Number)

 

Value to which the communication object is to be set.

callback

function()

 

HomeServerConnector._CommunicationObject~setValueCallback

toggle(value, callback)

Switches between '0' and the value.

Example

Toggle between (fixed) '0' and '1'.

co.toggle(1, function(err) {});

Parameters

Name Type Optional Description

value

Number

 

Value. Switching is between this value and '0'.

callback

function()

 

HomeServerConnector._CommunicationObject~toggleCallback

Abstract types

inner

addValueCallback(err)

Examples

Addition of '5' to the current value of the communication object

co.addValue(5, function(err) {});

Subtraction of '5' ( = addition of '-5') from the current value of the communication object.

co.addValue(-5, function(err) {});

Parameter

Name Type Optional Description

err

(Object or undefined)

 

Error object

inner

getMetaCallback(err, data)

Example

Retrieval of metadata.

co.getMeta(function(err, data) {}); 

Parameters

Name Type Optional Description

err

(Object or undefined)

 

Error object

data

Object

 

Meta information

Structure

{
  "keys":        Array of String,
  "caption":     String,
  "description": String,
  "tags":        Array of String,
  "format":      Number,
  "minValue":    Number,
  "maxValue":    Number,
  "list":        Array  of Number,
  "offset":      Number,
  "grpadr":      String
}

Explanation

  • keys - List with keys (e.g.: ["CO:1", "CO@1_1_1"]). Contains at least one number.
  • caption - Designation of the object.
  • description - Description of the object.
  • tags - List of tags (e.g.: ["Basement", "FirstFloor"]).
  • format - Data format of the communication object defined in the HS/FS Expert:
    • 1 => 1 bit
    • 2 => 8 bit (0..100)
    • 3 => 8 bit (RTR)
    • 4 => 16 bit (floating point)
    • 5 => 2 bit
    • 9 => 4 bytes
    • 10 => 8 bit (unsigned) or Dali
    • 11 => 8 bit (signed)
    • 12 => 16 bit (unsigned)
    • 13 => 16 bit (signed)
    • 14 => 32 bit (unsigned) or group feedback object
    • 15 => 32 bit (signed)
    • 16 => 4 bit
    • 17 => 3 bytes
    • 20 => 3 bytes (time)
    • 21 => 3 bytes (date
    • 22 => 14 bytes (string)
  • minValue - Minimum permitted value. Has the value 0 if the format is 14 bytes.
  • maxValue - Maximum permitted value. Has the value 0 if the format is 14 bytes.
  • list - List of values. The communication object can be set to the individual values with the methods list_prev and list_next. Not set if format is 14 bytes.
  • offset - Value for the stepwise change of the value with the help of the methods offset_plus and offset_minus. Has the value 0 if the format is 14 bytes.
  • grpadr - Group address as a string (e.g.: "6/0/7")
inner

getValueCallback(err, value)

Example

Querying the current value of the communication object.

co.getValue(function(err, value) {}); 

Parameters

Name Type Optional Description

err

(Object or undefined)

 

Error object

value

(String or Number)

 

returned value of the communication object

inner

listNextCallback(err)

Example

Setting the communication object to the next highest values specified in Expert in the field 'List'.

co.listNext(function(err) {}); 

Parameter

Name Type Optional Description

err

(Object or undefined)

 

Error object

inner

listPreviousCallback(err)

Example

Setting the communication object to the next lowest values specified in Expert in the field 'List'.

co.listPrevious(function(err) {}); 

Parameter

Name Type Optional Description

err

(Object or undefined)

 

Error object

inner

offsetMinusCallback(err)

Example

The value of the communication object is reduced by the value specified in Expert in the field 'Step size'.

co.offsetMinus(function(err) {}); 

Parameter

Name Type Optional Description

err

(Object or undefined)

 

Error object

inner

offsetPlusCallback(err)

Example

The value of the communication object is increased by the value specified in Expert in the field 'Step size'.

co.offsetPlus(function(err) {}); 

Parameter

Name Type Optional Description

err

(Object or undefined)

 

Error object

inner

setValueCallback(err)

Examples

Setting a numerical value

co.setValue(1.0, function(err) {});

Setting a string.

co.setValue("Text Text Text", function(err) {});

Parameter

Name Type Optional Description

err

(Object or undefined)

 

Error object

inner

toggleCallback(err)

Example

Toggle between (fixed) '0' and '1'

co.toggle(1, function(err) {});

Parameter

Name Type Optional Description

err

(Object or undefined)

 

Error object