upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
UPM API for Aeotec Door/Window Sensor 2nd Edition. More...
This module allows for monitoring certain elements of an Aeotec Door/Window Sensor 2nd Edition Z-Wave device.
NOTE: This is a battery powered device that spends most of it's time sleeping (sort of like a cat). This means that on initial startup, there is not enough information known about the device to reliably query anything. Use isDeviceAvailable() to test whether the device has responded to OZW's probe request before requesting information for it.
The device information should become known once the device has awakened, either via it's configuration, or manually via the include button on the device. By default the device will never wake on it's own, so you should use the openzwave control panel or similar software to configure a periodic wakeup time.
Public Types | |
enum | INDEX_VALUES_T : int { INDEX_Alarm = 0, INDEX_AlarmLevel = 2, INDEX_BatteryLevel = 3 } |
Public Member Functions | |
AeotecDW2E (int nodeID) | |
~AeotecDW2E () | |
bool | isDeviceAvailable () |
bool | isAlarmTripped () |
bool | isTamperTripped () |
int | getBatteryLevel () |
Public Member Functions inherited from ozwInterface | |
ozwInterface (int nodeID) | |
virtual | ~ozwInterface () |
virtual void | setDebug (bool enable) |
virtual void | optionsCreate (std::string configPath="/etc/openzwave", std::string userConfigDir="", std::string cmdLine="") |
virtual void | optionAddInt (std::string name, int val) |
virtual void | optionAddBool (std::string name, bool val) |
virtual void | optionAddString (std::string name, std::string val, bool append) |
virtual void | optionsLock () |
virtual void | init (std::string devicePath, bool isHID=false) |
virtual void | dumpNodes (bool all=false) |
virtual std::string | getValueUnits (int index) |
virtual std::string | getValueLabel (int index) |
Additional Inherited Members | |
Protected Attributes inherited from ozwInterface | |
bool | m_debugging |
uint32_t | m_nodeID |
OZW * | m_instance |
bool | m_initialized |
enum INDEX_VALUES_T : int |
These values correspond to the index values of the given node
AeotecDW2E | ( | int | nodeID | ) |
AeotecDW2E constructor
nodeID | The ZWave node number of the device we are interested in. Use the ozwdump example to see what nodes you have available. |
~AeotecDW2E | ( | ) |
AeotecDW2E Destructor
bool isDeviceAvailable | ( | ) |
Returns true if the node (device) information has been received yet, false otherwise. A sleeping node (like this device) will not be available for monitoring until all node info has been received. This will occur once the device has been awakened and has responded to OZW's probe request.
bool isAlarmTripped | ( | ) |
Return the alarm value. If the device is not available yet (see isDeviceAvailable()), false will always be returned.
bool isTamperTripped | ( | ) |
Return the alarm's tamper switch valu. If the device is not available yet (see isDeviceAvailable()), false will always be returned.
int getBatteryLevel | ( | ) |
Return the current bettery level of the sensor as a percentage. The number returned will be between 0-100. If the device is not available yet (see isDeviceAvailable()), 0 will always be returned.