UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

ozwInterface Class

Module: ozw
  • Name: UPM Interface API for OpenZWave ( OZW )
  • Connection: uart

This class implements some common access functions that are useful to any driver making use of the ozw driver.
It is intended to be inherited by device-specific ozw drivers, and provides some basic public methods all ozw drivers need to have, as well as protected access to other OZW facilities that are needed by a driver, but should not be exposed to the end-user.

Methods

ozwInterface

(
  • nodeID
)
Number

ozwInterface constructor

Parameters:

  • nodeID Number

    The ZWave node number of the device we are interested in.

Returns:

Number:

setDebug

(
  • enable
)

Enable some debugging output in this module as well as the OZW module. Debugging is disabled by default.

Parameters:

  • enable Boolean

    true to enable, false to disable.

optionsCreate

(
  • configPath
  • userConfigDir
  • cmdLine
)

Start configuration with basic options. This must be called prior to init() , after the OZW() constructor is called.

Parameters:

  • configPath String

    Set the location of the OpenZWave config directory, default is /etc/openzwave

  • userConfigDir String

    Set the path to the user configuration directory. This is the location of the zwcfg*.xml and option.xml files for the user (probably created by the OpenZWave Control Panel example application). The default is the current directory ("").

  • cmdLine String

    Specify command line formatted options to OpenZWave. The default is "".

optionAddInt

(
  • name
  • val
)

Add an integer Option. See the OpenZWave documentation for valid values.

Parameters:

  • name String

    The name of the configuration option

  • val Number

    The value to set it to

optionAddBool

(
  • name
  • val
)

Add a boolean Option. See the OpenZWave documentation for valid values.

Parameters:

  • name String

    The name of the configuration option

  • val Boolean

    The value to set it to

optionAddString

(
  • name
  • val
  • append
)

Add a string Option. See the OpenZWave documentation for valid values.

Parameters:

  • name String

    The name of the configuration option

  • val String

    The value to set it to true to append to the option, false to override

  • append Boolean

    undefined

optionsLock

()

Lock the Options. This must be called after all options have been set, and before init() is called. If init() is called without locking the Options, init() will lock them itself. After the options have been locked, no further options can be specified.

init

(
  • devicePath
  • isHID
)

This function initializes the underlying OZW Master singleton and the openzwave library in the event it has not already been initialized. If the OZW Master singleton has already been initialized, then this call will be ignored.

Parameters:

  • devicePath String

    The path to the device, typically something like /dev/ttyACM0.

  • isHID Boolean

    true if this is an HID device, false if it's a serial device. The default is false.

dumpNodes

(
  • all
)

Dump information about all configured nodes and their valueids to stderr. This is useful to determine what nodes are available, and the index (used for querying and seting values for them). In addition, it includes information about each value (type, current value, etc).

Parameters:

  • all Boolean

    set to true to dump information about all values available for each node. If false, only information about 'user' values (ignoring 'system' and 'configuration') are output. The default is false ('user' values only).

getValueUnits

(
  • index
)
String

Return a string (which may be empty) indicating the Units of measure for a given value. For example, querying a temperature value may return "F" to indicate Fahrenheit.

Parameters:

  • index Number

    The value index (see dumpNodes() ) of the value to query.

Returns:

String:

A string containing the Unit of measure for the value

getValueLabel

(
  • index
)
String

Return a string (which may be empty) indicating the Label set for a given value. For example, querying a temperature value may return "Temperature" to indicate what it is.

Parameters:

  • index Number

    The value index (see dumpNodes() ) of the value to query.

Returns:

String:

A string containing the Label for the value