upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Types | Public Member Functions

UPM API for Aeotec Home Energy Meter Gen 1. More...

Detailed Description

This module allows for monitoring certain elements of an Aeotec Home Energy Meter Gen 1.

string defaultDev = "/dev/ttyACM0";
// if an argument was specified, use it as the device instead
if (argc > 1)
defaultDev = string(argv[1]);
// Instantiate an Aeotec DSB09104 instance, on device node 12. You
// will almost certainly need to change this to reflect your own
// network. Use the ozwdump example to see what nodes are
// available.
upm::AeotecDSB09104 sensor(12);
// The first thing to do is create options, then lock them when done.
sensor.optionsCreate();
sensor.optionsLock();
// Next, initialize it.
cout << "Initializing, this may take awhile depending on your ZWave network" << endl;
sensor.init(defaultDev);
cout << "Initialization complete" << endl;
cout << "Querying data..." << endl;
while (shouldRun) {
sensor.update();
cout << "Watts, Channel 1: " << sensor.getWattsC1() << " W" << endl;
cout << "Watts, Channel 2: " << sensor.getWattsC2() << " W" << endl;
cout << "Watts, Channel 3: " << sensor.getWattsC3() << " W" << endl;
cout << "Energy, Channel 1: " << sensor.getEnergyC1() << " kWh" << endl;
cout << "Energy, Channel 2: " << sensor.getEnergyC2() << " kWh" << endl;
cout << "Energy, Channel 3: " << sensor.getEnergyC3() << " kWh" << endl;
cout << "Battery Level: " << sensor.getBatteryLevel() << "%" << endl;
cout << endl;
upm_delay(3);
}
// sensor.dumpNodes(true);
cout << "Exiting..." << endl;

Public Types

enum  INDEX_VALUES_T : int {
  INDEX_PowerC1 = 0, INDEX_PowerC2 = 1, INDEX_PowerC3 = 2, INDEX_EnergyC1 = 3,
  INDEX_EnergyC2 = 4, INDEX_EnergyC3 = 5, INDEX_BatteryLevel = 18
}
 

Public Member Functions

 AeotecDSB09104 (int nodeID)
 
 ~AeotecDSB09104 ()
 
float getWattsC1 ()
 
float getWattsC2 ()
 
float getWattsC3 ()
 
float getEnergyC1 ()
 
float getEnergyC2 ()
 
float getEnergyC3 ()
 
void update ()
 
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
 
OZWm_instance
 
bool m_initialized
 

Member Enumeration Documentation

enum INDEX_VALUES_T : int

These values correspond to the index values of the given node

Constructor & Destructor Documentation

AeotecDSB09104 ( int  nodeID)

AeotecDSB09104 constructor

Parameters
nodeIDThe ZWave node number of the device we are interested in. Use the ozwdump example to see what nodes you have available.

AeotecDSB09104 Destructor

Member Function Documentation

float getWattsC1 ( )

Get the current Watts reading from Channel 1.

Returns
The Watts reading.

Here is the call graph for this function:

float getWattsC2 ( )

Get the current Watts reading from Channel 2.

Returns
The Watts reading.

Here is the call graph for this function:

float getWattsC3 ( )

Get the current Watts reading from Channel 3.

Returns
The Watts reading.

Here is the call graph for this function:

float getEnergyC1 ( )

Get the current Energy reading from Channel 1. The value is in kWh.

Returns
The Energy reading.

Here is the call graph for this function:

float getEnergyC2 ( )

Get the current Energy reading from Channel 2. The value is in kWh.

Returns
The Energy reading.

Here is the call graph for this function:

float getEnergyC3 ( )

Get the current Energy reading from Channel 3. The value is in kWh.

Returns
The Energy reading.

Here is the call graph for this function:

void update ( void  )

Query the device and update internal state. Strictly speaking, this is not really neccessary – a device may send this data on it's own at periodic intervals if configured to do so. This method causes OZW to specifically query the device for it's current Energy, Watts, and Battery Level status. The device may take some time to respond.

Here is the call graph for this function:

int getBatteryLevel ( )

Return the current bettery level of the meter as a percentage. The number returned will be between 0-100.

Returns
The Battery power level.

Here is the call graph for this function:

Inheritance diagram for AeotecDSB09104:
Inheritance graph
[legend]
Collaboration diagram for AeotecDSB09104:
Collaboration graph
[legend]

The documentation for this class was generated from the following files: