pplapp module, developed by Direct Energy Partners, includes several built-in functions. These functions are
designed to either retrieve measurement data from the NATS interface or send commands to the controller through the
NATS interface. The controller then forwards these commands to the respective devices in the microgrid. Below is a list
of all the commands available for use in the custom application.
To use these functions, call the app instance of the pplapp module and enter the desired function. See the examples
below for more information.
getAllMeasurements
getAllMeasurements
This function retrieves all measurements from the devices. It returns a dictionary where the keys are all the devices
in the microgrid application and the values are the corresponding measurements. Each measurement is also a dictionary,
as shown in the example below.
getMeasurement
getMeasurement
This function fetches a specific measurement from a device. The function requires two input parameters: deviceId, which corresponds to a device listed in the
devices.json file, and registerName, which should be defined in the address map of that device. Refer to the example below for clarity.setCommands
setCommands
This function sends commands to a device in the system. It requires two input parameters: deviceId, which corresponds to a device listed in the
devices.json file, and commands, which is a dictionary containing all the commands to be sent to that device. Note that the commands should be defined in the address map of the device. Refer to the example below for clarity.