# Communication
Source: https://docs.directenergypartners.com/commission/communication
A critical step during commissioning is to verify that the controller has successfully established communication with
all devices in the microgrid. This is essential for running the application.
There are several methods to check the connection between the controller and the devices. One method is to use a tool called
**MQTT Explorer** to monitor the devices in the microgrid. The state of each device will indicate whether it is operational
or has a communication fault.
Another method is to run a **custom NATS application**. This application retrieves measurements from the controller and can
display the device ID and state of each device, providing insight into their operational state.
Both approaches are effective. For more details on using MQTT Explorer or running the custom application, refer to the
information below.
### Get Device State
To determine whether the controller has successfully connected to the devices in the microgrid, it is necessary to check
the state of each device. This can be accomplished through either MQTT Explorer or by running a custom NATS application.
Detailed instructions for retrieving the device states using both methods are provided below.
* **Go to the Website**: Open your browser and visit [mqtt-explorer.com](https://mqtt-explorer.com/).
* **Download the App**: Select the version for your OS and download it.
* **Install**: Run the downloaded file and follow the installation prompts.
* **Open the App**: Find MQTT Explorer in your applications and launch it.
* **Add a Connection**: Click the `+` button to create a new connection.
* **Enter Details**:
* **Name**: Give your connection a descriptive name.
* **Protocol**: Choose `mqtt://`.
* **Host**: Enter your controller's IP address.
* **Port**: Set to `1883`.
* **Leave Username/Password Blank**.
* **Save**: Click `Save` to store the connection.
* **Connect**: Select your connection from the sidebar and click `Connect`.
* **Verify**: Confirm the connection status and check for active topics.
If the MQTT Explorer application cannot establish a connection to the host (i.e., the controller), please verify the
configuration settings in the controller's `config.json` file. You can find this file in the `/etc` folder of the
`ppl-base` repository. Ensure that the MQTT broker is assigned the correct IP address of the controller.
For more details, please refer to the **Configure Config File** section on the
[Configure DCIDE Controller Files](Configure%20PPL%20Files%2083ccac11bc15410994e889f37a76e999.md) page.
If the connection is successful, MQTT Explorer will start listening for incoming messages. The controller will
update the MQTT messages, including device measurements, every 5 seconds.
* Select a topic from the device list on the left.
* Choose the first (and only) entry from the dropdown menu.
* The device measurements will appear on the right.
* Look for the **state** parameter within the measurements.
To run a custom NATS application, please refer to the [Write Custom Applications](Write%20Custom%20Applications%209a8ce107e094477996db591944af2dd0.md) page.
It explains how to install the necessary libraries, update the IP address and NATS credentials, and execute the application.
To retrieve the state of each device, run the following application found in the examples folder: `device-states.py`.
Execute the application in the Terminal of your code editor (VS Code) using the following command:
```bash theme={null}
python device-states.py
```
This command will display the devices in the microgrid application along with their states.
When checking the device’s state, it is important to verify the devices that communicate over **Modbus TCP/IP**.
If the connection between the controller and the Modbus device is not established, the state will display **communicationFault**.
This indicates that the controller was unable to establish a connection, and further troubleshooting is needed.
### Resolve Communication Failure
Below are the steps to help resolve the communication failure:
Verify that the Modbus device is connected to the network switch of the DCIDE Controller using Ethernet cables.
Check the Ethernet cable connections at both ends to ensure they are plugged in correctly.
Check the network settings on the Modbus device to ensure the IP address, subnet mask, and gateway are correctly configured.
Review the device settings in the `devices.json` file, located in the `/etc` folder in the `ppl-base` repository:
* Ensure `ipAddress` is set correctly
* Ensure `slaveId` is set correctly
* Ensure `port` is set correctly
Compare the IP address, slave ID, and port settings on the Modbus device with those in the `devices.json` file, and update them as needed.
For more information on modifying device settings and uploading them to the controller, see the [Configure DCIDE Controller Files](Configure%20PPL%20Files%2083ccac11bc15410994e889f37a76e999.md) page.
Confirm that there is no other controller currently connected to the device (some devices only support a single Modbus client connection).
Check if the device’s address map includes a **communicationCheck** register. For instructions on adding Modbus registers
to the address map, refer to the [Configure DCIDE Controller Files](Configure%20PPL%20Files%2083ccac11bc15410994e889f37a76e999.md) page.
**What's next?**
If none of the above steps resolve the connection issue, retrieve the log files from the controller.
Refer to the next section on how to retrieve the log files. If you need assistance, contact PPL Support by
emailing [pplsupport@directenergypartners.com](mailto:pplsupport@directenergypartners.com).
# Connection
Source: https://docs.directenergypartners.com/commission/dashboard/connection
Once the DCIDE Controller Dashboard is running, open your browser and navigate to [localhost:8000](http://localhost:8000).
Before connecting, ensure that the controller is powered on and that the following files have been added to the
controller: the `license.txt` file, and the `etc` folder containing the `config.json`, `devices.json`, and all
associated address map files. For instructions on creating these files, refer to the
[File Configuration](/configure/index) section.
### Connect to the Controller
In the connection settings, enter the IP address of the DCIDE Controller.
Ensure the port is set to `4222`.
Update the **username** and **password** fields to match the credentials defined in the `config.json` file on the
controller, under the `nats` entry.
The username and password must be identical to the values in the `config.json` file. If they do not match, the
connection will fail and you will be prompted with an authorization error.
Click **Connect** to establish the connection to the controller.
### Troubleshooting Connection Issues
If the dashboard is unable to connect to the controller, review the following common causes:
If the application indicates that it took too long to establish a connection, this is a probable indication that:
* The **IP address** is incorrect.
* The **port** is not set to `4222`.
* The **controller is not online** or not reachable on the network.
* The **DCIDE Controller application has not started** on the controller. Possible causes include:
* Missing `license.txt` file on the controller.
* Missing `devices.json` file on the controller.
* Missing `config.json` file on the controller.
If you receive an authorization error, the **username** or **password** does not match the credentials defined in the
`config.json` file under the `nats` entry. Verify and correct the credentials, then try connecting again.
# Features
Source: https://docs.directenergypartners.com/commission/dashboard/features
Once connected to the controller, the DCIDE Controller Dashboard provides the following capabilities:
### Device State
Get a consolidated overview of every device's operational state in the microgrid. The Device State section displays
each device along with its current status — such as running, faulted, or communication fault — allowing you to
quickly identify which devices are healthy and which require attention. This is particularly useful during
commissioning to verify that all devices are online and communicating correctly with the controller.
### Read Measurements
Monitor live measurements from the devices in the microgrid. Measurements are updated every second. An indicator
displays when the last update was received. If the measurements stop updating — indicated by the **last update**
timer increasing in seconds — click the **Fetch** button to resubscribe to the measurements reported by the
controller.
Each device or component has its own tab in the measurement section. You can switch between components by selecting
the corresponding tab.
### Send Commands
Send commands to individual components and devices. Select a device from the dropdown to get started. There are two
modes for sending commands:
* **Auto** — Select a command from the command dropdown, then select a value from the value dropdown or enter a value
manually if that particular command does not have predefined values (e.g. voltage setpoint registers).
* **Manual** — Select a device from the dropdown, then enter both the command and the value manually.
When using Manual mode, ensure that the command you enter exists in the address map of the selected device. If the
command is not defined in the address map, it cannot and will not be executed.
### Device Health Check
Verify read registers for Modbus TCP/IP and CAN devices to confirm proper communication. Click **Get Devices File**
to load all devices defined on the controller. The dashboard will list all Modbus TCP/IP and CAN devices. If no
Modbus or CAN devices are found, the dashboard will notify you accordingly.
Select a device to check its communication status and read registers.
**Modbus TCP/IP devices:**
* The health check will verify all read registers (function codes 1 through 4).
* You can run a batch check by clicking on the **Run All** button, which automatically goes through each register one by one and verifies whether
it can be read from the device.
* Alternatively, you can check each register individually.
Before running a batch check or checking registers individually, the device must first pass the communication check.
**CAN devices:**
* Since CAN does not use a direct write-reply mechanism, the health check passively listens for incoming messages
matching the expected CAN IDs.
### Fetch Logs
Retrieve log files from the controller for troubleshooting during startup and commissioning. Once fetched, you can
browse through the log files directly in the dashboard by selecting the tab of each log file.
# Introduction
Source: https://docs.directenergypartners.com/commission/dashboard/index
The DCIDE Controller Dashboard is a web-based tool designed to support startup and commissioning of the DCIDE Controller. It provides
direct visibility into the controller, allowing you to monitor device measurements, send commands to components within
the microgrid, perform device health checks on Modbus TCP/IP and CAN registers, and retrieve log files for
troubleshooting — all from your local machine.
# Installation
Source: https://docs.directenergypartners.com/commission/dashboard/installation
The DCIDE Controller Dashboard is distributed as a Docker image that runs on your local machine. Follow the steps below to install
and run it.
### Install Docker Desktop
Before pulling the DCIDE Controller Dashboard image, ensure Docker Desktop is installed on your machine.
* Visit the [Docker Desktop download page](https://www.docker.com/products/docker-desktop/).
* Select the version for your operating system (Windows, macOS, or Linux) and download the installer.
* Run the downloaded installer and follow the on-screen instructions.
* On **Windows**, ensure WSL 2 is enabled if prompted.
* On **macOS**, drag the Docker icon into the Applications folder.
* Open Docker Desktop from your applications.
* Wait for Docker to fully start — the Docker icon in the system tray should indicate it is running.
### Pull the DCIDE Controller Dashboard Image
Once Docker Desktop is running, pull the DCIDE Controller Dashboard image from Docker Hub.
Open a terminal on your local machine:
* **Windows**: use Command Prompt, PowerShell, or Git Bash.
* **macOS or Linux**: open the default Terminal application.
Run the following command to pull the DCIDE Controller Dashboard image from
[Docker Hub](https://hub.docker.com/r/directenergypartners/ppl-dashboard):
```bash theme={null}
docker pull directenergypartners/ppl-dashboard
```
### Run the DCIDE Controller Dashboard
You can start the DCIDE Controller Dashboard using either the terminal or Docker Desktop.
Make sure Docker Desktop is running on your machine before executing the command. Run the following command in your terminal:
```bash theme={null}
docker run -p 8000:8000 directenergypartners/ppl-dashboard:latest
```
The dashboard will be accessible at [localhost:8000](http://localhost:8000).
Launch Docker Desktop on your machine.
Go to the **Images** section in the sidebar.
* Locate the `directenergypartners/ppl-dashboard` image.
* Click the **Start** (Play) button.
* In the **Optional Settings**, set the **Host Port** to `8000`.
* Click **Run**.
The dashboard will be accessible at [localhost:8000](http://localhost:8000).
# Introduction
Source: https://docs.directenergypartners.com/commission/index
This section provides detailed instructions on verifying communication between the controller and devices within the
microgrid, an essential step in the commissioning process. The methods covered include using the **Dashboard** to
support startup of the controller and commissioning of the devices in the microgrid, as well as using MQTT Explorer
and a custom NATS application to monitor and retrieve device states.
Before proceeding, please ensure you have completed the necessary steps outlined in the previous sections, including
powering up the unit, modifying the configuration files, updating the device files, and successfully rebooting the
controller. These prerequisites are essential for following the instructions in this document.
This is a live document and is updated regularly. For the latest version, always refer to the online documentation.
# Live Data
Source: https://docs.directenergypartners.com/commission/live-data
Live Data streams real-time measurements from the controller and the devices it interfaces with directly to your
**DCIDE** project's single line diagram. Once enabled, the diagram will visualize power flow and current flow between
components, along with the voltages and statuses reported by each device and port. This provides a live,
at-a-glance view of your microgrid without needing to log in to the controller directly.
This page explains how to enable Live Data on your DCIDE project, how to link the controller to that project, and
how to configure your diagram so that each component displays the correct data.
Before continuing, make sure the controller has been configured and commissioned as described in the
[File Configuration](/configure/index) section, including a valid `devices.json` file with unique `id` values for
each device.
## Enable Live Data on Your DCIDE Project
Open your project in DCIDE and navigate to the **Settings** tab.
Scroll down until you see the **Live Data** toggle button, and switch it on to enable live data for the project.
Once enabled, a **Project ID** will be shown in the settings. Copy this value, as it needs to be added to the
controller's `config.json` file.
Enter a **secret** to secure the live data stream between the controller and your DCIDE project. This prevents
other controllers or clients from being able to stream data into your project.
## Connect the Controller to DCIDE
With the Project ID and secret available, the controller needs to be configured to stream data to DCIDE.
Add a `dcide` entry to the controller's `config.json` file, and fill in the `projectId` and `secret` you copied
from your DCIDE project settings. For a full description of these parameters, see the
[Config File](/configure/configuration/config#dcide) documentation.
```json icon="code" theme={null}
{
"dcide": {
"projectId": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"secret": "my-dcide-secret"
}
}
```
The controller requires a stable internet connection in order to stream data to the DCIDE endpoint. Without
internet access, Live Data will not function, even if the configuration is correct.
Reboot the controller so that the updated `config.json` file is loaded and the controller starts streaming data
to your DCIDE project.
## Configure the DCIDE Diagram
Enabling Live Data and connecting the controller only makes the data stream available to your DCIDE project. To
display that data on the single line diagram, every component that the controller interfaces with must be linked to
its corresponding device by setting an **Identifier**.
On your DCIDE single line diagram, click the component you want to link to a device on the controller. This
opens the sidebar on the right.
In the sidebar, go to the **Edit** tab, then select **Live Data**, and scroll down to **Settings**.
In the **Identifier** field, enter the identifier for this component. This value must be identical to the `id` of
the corresponding device in the `devices.json` file on the controller.
Repeat this process for every component on the diagram that corresponds to a device on the controller. Any
component without a matching identifier will not display live data.
The identifier set on a DCIDE component must be identical to the `id` of the device as defined in `devices.json`.
If the values do not match, DCIDE will not be able to associate incoming data with that component. See the
[Devices File](/configure/devices/devices) documentation for more information on setting a device's `id`.
## Required Registers
DCIDE looks for specific register names in order to visualize data points and power flow on the diagram. For a
device to be visualized correctly, its address map must include the applicable registers below, read from the
corresponding connected device.
| Data Point | Register Name | Unit |
| - | - | - |
| Voltage | `measure.ports.port{number}.voltage` | V (volt) |
| Current | `measure.ports.port{number}.current` | A (ampere) |
| Power | `measure.ports.port{number}.power` | W (watt) |
| SOC | `measure.ports.port1.soc` | % (percent) |
These registers must use **SI units**, as shown in the table above. Voltage must be reported in volts, current in
amperes, power in watts, and state of charge as a percentage. If a device reports values in different units (e.g.
millivolts or kilowatts), apply the appropriate `scaling` in the address map so the value is converted to SI units.
Otherwise, voltage, current, power flow, and SOC will not be displayed correctly on the DCIDE diagram.
### Sign Convention
In addition to using SI units, the `current` and `power` registers for each port must follow a specific sign
convention so that DCIDE can correctly visualize the direction of power flow. The convention is defined from the
perspective of looking at the device (e.g. a converter or battery):
* **Positive** power or current on a port means power flows **toward** the device.
* **Negative** power or current on a port means power flows **away from** the device.
If a device reports current or power with the opposite sign convention, apply a negative `scaling` factor in the
address map to invert the sign. Otherwise, the direction of power flow will be displayed incorrectly on the DCIDE
diagram.
For more information on defining registers and applying scaling in the address map, see the
[Address Map Files](/configure/address-map/index) documentation.
# Logs
Source: https://docs.directenergypartners.com/commission/logs
For troubleshooting, it may be helpful to download the log files from the DCIDE Controller. This section explains different
methods for downloading these log files. The available methods include using the NATS application, the SCP command in the
terminal, or FileZilla. The first method is preferred as it is the easiest.
### Via NATS Application (Preferred)
In the examples folder, there is an application called `download-logs.py` that retrieves log files from the DCIDE Controller
and stores them in a folder called `logs` on your local machine within the current directory. Follow the steps below:
Open Visual Studio Code.
Open the folder containing the `dep-ppl-app` repository.
Open a new terminal by clicking on **Terminal** in the top menu bar and selecting **New Terminal**. A terminal window
will open at the bottom of your screen.
Run the following command in the terminal:
```bash theme={null}
python download-logs.py
```
The files will be stored in the `logs` folder on your local machine and current directory.
### Via SCP Command
On your local machine, open a terminal:
* **Windows**: use Command Prompt, PowerShell, or a terminal emulator like Git Bash.
* **MacOS or Linux**: open the default Terminal application.
* Alternatively, you can use the terminal in **VS Code**.
To download a specific log file from the remote controller, use the `scp` command:
```bash theme={null}
scp admin@:/opt/plcnext/appshome/data/60002172000969/log/ /local/path/
```
* Replace `ipAddress` with the IP address of the controller.
* Replace `filename` with the actual name of the log file you want to download
* Filenames include: *ppl.log*, *pplpy.log*, *livebit.log*, *natsdriver.log.*
* Replace `/local/path/` with the directory path on your local machine where you want to save the log file.
For example, if your controller is at IP `192.168.1.10`, you want to download the `pplpy.log` file, and you want to save
it to your Desktop, the command would look like this:
```bash theme={null}
scp admin@192.168.1.10:/opt/plcnext/appshome/data/60002172000969/log/pplpy.log ~/Desktop/
```
After running the command, you’ll be prompted to enter the password for the `admin` user. Once you provide the correct
password, the log file will be copied to your specified local directory.
Here are some useful tips for downloading log files using the SCP command:
If you want to download all the log files in the `/opt/plcnext/appshome/data/60002172000969/log` directory, you can use the following command:
```bash theme={null}
scp admin@192.168.1.10:/opt/plcnext/appshome/data/60002172000969/log/* /local/path/
```
This command will copy all files in the `/opt/plcnext/appshome/data/60002172000969/log` directory to your local machine.
If you want to download the log files to the current directory on your local machine, you can use the following command:
```bash theme={null}
scp admin@192.168.1.10:/opt/plcnext/appshome/data/60002172000969/log/ppl.log .
```
### Via FileZilla
* **Go to the Website**: Open your browser and visit [FileZilla official website](https://filezilla-project.org/).
* **Download FileZilla**: Click on the **Download FileZilla Client** button and choose the appropriate version for your
operating system (Windows, macOS, Linux).
* **Install**: Run the downloaded file and follow the installation prompts.
* After installation, open FileZilla from your Start Menu or Applications folder.
* **Open the FileZilla Interface:** You’ll see fields at the top labeled `Host`, `Username`, `Password`, and `Port`.
* **Enter Connection Details:**
* **Host:** Enter the IP address of the controller (e.g., `192.168.1.10`).
* **Username:** Enter the username for your controller (`admin`).
* **Password:** Enter the admin password for your controller.
* **Port:** Enter `22` for SFTP (secure FTP).
* **Click Quickconnect:** Connect to the controller.
* **Remote Site:** In the *Remote site* panel (right side), navigate to the `/opt/plcnext/appshome/data/60002172000969/log` directory where the logs are stored.
* **Select Logs:** Click on the `/opt/plcnext/appshome/data/60002172000969/log/` folder to open it and view the log files.
* **Select Files:** Click on the log files you want to download (you can select multiple files by
holding the `Ctrl` (Windows) or `Cmd` (macOS) key).
* **Download Files:** Right-click on the selected files and choose **Download** or drag them to the *Local site* panel.
* **Monitor Download:** Check the download progress at the bottom of the FileZilla interface.
* Once the download is complete, you can disconnect by clicking on the **Disconnect** button (red "X" icon) in the toolbar or simply close the FileZilla application.
If you have questions about possible errors in the log files or would like the PPL Support team to review them, feel free to email your request to [pplsupport@directenergypartners.com](mailto:pplsupport@directenergypartners.com), and be sure to include the log files.
# Introduction
Source: https://docs.directenergypartners.com/configure/address-map/index
The purpose of this section is to guide you in creating comprehensive and accurate address maps, which are essential for effective communication between a controller and its connected devices. Address maps act as blueprints, detailing how to access and manipulate device registers for reading data or issuing commands.
This section will specifically cover the creation of address maps for various communication protocols, including Modbus TCP/IP, CANbus, MQTT, digital I/O’s and analog I/O’s. Each subsection will provide detailed instructions, conventions to follow, and examples to illustrate the process. By adopting consistent naming conventions and including all required and optional parameters, you will be able to create address maps that ensure seamless integration and communication within your system.
The address maps are located in the `/etc` folder of the `ppl-base` repository. They follow a typical naming convention: `_address_map.json`. Each address map file should always have a `.json` extension.
## File Validator
Use the File Validator to verify that your address map files are correct, contain no errors, and include the required registers and parameters so the DCIDE Controller can interface with your devices.
Validate your configuration files before uploading them to the controller.
# Analog I/O
Source: https://docs.directenergypartners.com/configure/address-map/types/aio
### Naming Conventions
While not mandatory, it is recommended to adopt the following naming conventions for clarity and usability:
* **Write Operations:** Prefix register names with `control.` to indicate that the register is used to set the analog output.
* **Read Operations:** Prefix register names with `measure.` to signify that the register is used to read the analog input signal.
See the example address map below for register naming conventions.
### Required Parameters
A unique name for the register.
**Example:** `measure.voltage`
Corresponds to the number on the analog input or output module.
**Example:** `0`
Please note that the address should start from 0, not from 1.
Indicates whether the register is an input or an output.
**Options:** `input | output`
### Optional Parameters
The scaling factor to apply to the analog register's return value or the value being written.
**Example:** `50`
The offset to apply to the analog register's return value or the value being written.
**Example:** `100`
### Example
```json aio_address_map.json icon="code" theme={null}
[
{
"name": "measure.voltage",
"address": 0,
"type": "input",
"scaling": 50,
"offset": 100
},
{
"name": "control.lights",
"address": 0,
"type": "output"
}
]
```
# Breaker
Source: https://docs.directenergypartners.com/configure/address-map/types/breaker
### Naming Conventions
While not mandatory, it is recommended to adopt the following naming conventions for clarity and usability:
* **Read Operations:** Prefix register names with `measure.` to signify that the register is used to read the breaker state.
See the example address map below for register naming conventions.
### Required Parameters
A unique name for the register.
**Example:** `measure.breaker`
Corresponds to the number on the digital input module.
**Example:** `0`
Please note that the address should start from 0, not from 1. However, the physical address on the I/O module begins at 1.
Indicates whether the register is an input or an output.
**Options:** `input | output`
### Required Registers
This register is used to measure the breaker's status.
### Example
```json breaker_address_map.json icon="code" theme={null}
[
{
"name": "measure.breaker",
"address": 0,
"type": "input"
}
]
```
# CANbus
Source: https://docs.directenergypartners.com/configure/address-map/types/canbus
Each entry in the JSON-formatted address map corresponds to a data field within a CAN frame on the actual device. Every entry in the address map must contain several required and optional parameters, which are described below. The final address map should cover all relevant CAN data fields for the device.
### Understanding CAN Frames
CAN (Controller Area Network) communication uses frames to transmit data. Each frame is identified by a CAN ID and contains up to 8 bytes of data. Data fields within a frame are defined by their byte position, bit position, and bit length, allowing for precise extraction of values from the CAN frame payload.
### Naming Conventions
While not mandatory, it is recommended to adopt the following naming conventions for clarity and usability:
* **Write Operations:** Prefix names with `control.` to indicate that the field is used for controlling the device.
* **Read Operations:** Prefix names with `measure.` to signify that the field is used for measurement purposes.
* **Fault and Warning Fields:** Use the prefixes `fault.` or `warning.` for fields that monitor faults or warnings. This helps in generating appropriate Telegram notifications and alerts for the system.
See the example CANbus address map below for naming conventions.
### Required Parameters
Each register in the address map must include the following parameters:
The CAN identifier for the frame containing this data field. The canId can be specified as a decimal integer or as a hexadecimal string (prefixed with `0x`).
**Example:** `100` or `"0x64"`
The starting byte position within the CAN frame data payload (0-7).
**Options:** `0 - 7`
The starting bit position within the start byte (0-7).
**Options:** `0 - 7`
The total number of bits for this data field (1-64).
**Options:** `1 - 64`
A unique name for the data field, representing the measurement point read from or written to the CAN device.
**Example:** `measure.ports.port1.voltage`
The data type of the value.
**Options:** `int8 | uint8 | int16 | uint16 | int32 | uint32 | float32 | string32 | int64 | uint64 | float64`
### Optional Parameters
These parameters are not necessary for every entry but can be included as needed:
The scaling factor to apply to the CAN data field's return value or the value being written.
**Example:** `0.1`
The offset to apply to the CAN data field's return value or the value being written.
**Example:** `10`
The number of decimal places used to store the register's return value. Must be a non-negative integer (0 or higher). If not specified, it defaults to `1`.
**Example:** `2`
The direction of the power or current flow on a port of the device. When the direction is set to `output`,
the register value will be inverted.
**Options:** `input | output`
The minimum value of the register. For write register, setting the minimum value prevents you from
writing a value lower than the minimum value. The control command will be blocked by the DCIDE Controller.
**Example:** `0`
The maximum value of the register. For write register, setting the maximum value prevents you from
writing a value higher than the maximum value. The control command will be blocked by the DCIDE Controller.
**Example:** `10`
Indicates if mapping should be applied to the return value or the value being written.
Indicates the type of mapping to be applied.
**Options:** `bitwise | value`
* **bitwise:** Each bit in a number corresponds to a specific state (e.g., fault or status).
* **value:** The entire return value corresponds to a state.
**Example:**
```json icon="code" theme={null}
{
"map": {
"type": "bitwise"
}
}
```
Specifies the byte order notation.
**Options:** `little | big`
### Expression Registers
In addition to standard CAN data fields, you can define **optional** expression registers. An expression register computes a value from other registers in the address map using a specified operator and operands, rather than reading directly from the device.
Each expression register requires the following parameters:
A unique name for the expression register.
**Example:** `measure.ports.port2.power`
The operator used to evaluate the expression.
**Options:** `+ | - | * | / | > | < | >= | <= | == | != | contains`
A pipe-separated (`|`) list of register names to use as operands. All referenced registers must exist in the address map itself.
**Example:** `measure.ports.port2.voltage|measure.ports.port2.current`
The number of decimal places used to store the expression's return value. Must be a non-negative integer (0 or higher). If not specified, it defaults to `1`.
**Example:** `2`
All registers referenced in the operands must exist in the address map itself.
```json icon="code" theme={null}
{
"name": "measure.ports.port2.power",
"operator": "*",
"operands": "measure.ports.port2.voltage|measure.ports.port2.current"
}
```
### Saving the Address Map
By following the naming conventions and adding all the required and optional parameters to each CAN data field, you have created a complete address map for the controller
to communicate and interact with the device. The final JSON file should be saved with a unique name and a `.json` extension. For example, `canbus_address_map.json`.
### Example
```json canbus_address_map.json icon="code" theme={null}
[
{
"canId": 100,
"startByte": 0,
"startBit": 0,
"bitLength": 16,
"name": "measure.ports.port1.voltage",
"datatype": "uint16"
},
{
"canId": 100,
"startByte": 2,
"startBit": 0,
"bitLength": 16,
"name": "measure.ports.port1.current",
"datatype": "int16",
"scaling": 0.1,
"offset": 0
},
{
"canId": "0xC8",
"startByte": 0,
"startBit": 0,
"bitLength": 8,
"name": "control.ports.port1.method",
"datatype": "uint8",
"map": {
"type": "value",
"0": "idle",
"1": "net",
"2": "GPWR",
"3": "FPWR"
}
},
{
"canId": 300,
"startByte": 0,
"startBit": 0,
"bitLength": 16,
"name": "fault.active",
"datatype": "uint16",
"map": {
"type": "bitwise",
"0": "Overvoltage",
"1": "Undervoltage",
"2": "Overcurrent",
"3": "Overtemperature",
"4": "Communication error",
"5": "Internal fault"
}
}
]
```
# Contactor
Source: https://docs.directenergypartners.com/configure/address-map/types/contactor
### Naming Conventions
While not mandatory, it is recommended to adopt the following naming conventions for clarity and usability:
* **Write Operations:** Prefix register names with `control.` to indicate that the register is used to set the digital output.
* **Read Operations:** Prefix register names with `measure.` to signify that the register is used to read the digital input signal.
See the example address map below for register naming conventions.
### Required Parameters
A unique name for the register.
**Example:** `control.contactor.main`
Corresponds to the number on the digital input or output module.
**Example:** `0`
Please note that the address should start from 0, not from 1. However, the physical address on the I/O module begins at 1.
Indicates whether the register is an input or an output.
**Options:** `input | output`
### Required Registers
This register is used to control the main contactor.
### Optional Registers
**Reference Contactor**
This register is used to control the reference contactor. Required when `referenceContactorFeedback` is enabled on the device.
**Contactor Feedback**
This register is used to measure the main contactor. Required when `mainContactorFeedback` is enabled on the device.
This register is used to measure the reference contactor. Required when `referenceContactorFeedback` is enabled on the device.
### Example
The example below shows a complete address map for a contactor device with all required and optional registers.
```json contactor_address_map.json icon="code" theme={null}
[
{
"name": "control.contactor.main",
"address": 0,
"type": "output"
},
{
"name": "control.contactor.reference",
"address": 1,
"type": "output"
},
{
"name": "measure.contactor.main",
"address": 8,
"type": "input"
},
{
"name": "measure.contactor.reference",
"address": 9,
"type": "input"
}
]
```
# Digital I/O
Source: https://docs.directenergypartners.com/configure/address-map/types/dio
### Naming Conventions
While not mandatory, it is recommended to adopt the following naming conventions for clarity and usability:
* **Write Operations:** Prefix register names with `control.` to indicate that the register is used to set the digital output.
* **Read Operations:** Prefix register names with `measure.` to signify that the register is used to read the digital input signal.
See the example address map below for register naming conventions.
### Required Parameters
A unique name for the register.
**Example:** `measure.start`
Corresponds to the number on the digital input or output module.
**Example:** `6`
Please note that the address should start from 0, not from 1. However, the physical address on the I/O module begins at 1.
Indicates whether the register is an input or an output.
**Options:** `input | output`
### Optional Parameters
Indicates whether to invert the input or output of the digital I/O, meaning that "on" becomes "off" and vice versa. This relates to the digital input or output being a normally open or normally closed contact.
### Example
```json dio_address_map.json icon="code" theme={null}
[
{
"name": "control.reset",
"address": 2,
"type": "output"
},
{
"name": "measure.start",
"address": 6,
"type": "input"
},
{
"name": "measure.stop",
"address": 7,
"type": "input",
"invert": true
}
]
```
# Modbus TCP/IP
Source: https://docs.directenergypartners.com/configure/address-map/types/modbus
Each entry in the JSON-formatted address map corresponds to a Modbus register on the actual device. Every register in the address map must contain several required and optional parameters, which are described below. The final address map should cover all relevant Modbus registers, including both read and write registers.
### Understanding Modbus Registers
Modbus registers or addresses have two key distinctions: read operations and write operations. Modbus read operations correspond to function codes FC1, FC2, FC3, and FC4. Write operations, used for sending commands to devices, are associated with function codes FC5, FC6, FC15, and FC16. This distinction is crucial when adding Modbus registers to the device address map.
Please note that for most devices, the most commonly used function codes are FC3, FC6, and FC16. However, it is important to know that the DCIDE Controller supports all Modbus function codes, despite the frequent use of these particular ones.
### Naming Conventions
While not mandatory, it is recommended to adopt the following naming conventions for clarity and usability:
* **Write Operations:** Prefix register names with `control.` to indicate that the register is used for controlling the device.
* **Read Operations:** Prefix register names with `measure.` to signify that the register is used for measurement purposes.
* **Fault and Warning Registers:** Use the prefixes "fault." or "warning." for registers that monitor faults or warnings. This helps in generating appropriate Telegram notifications and alerts for the system.
See the example Modbus address map below for register naming conventions.
### Required Parameters
Each register in the address map must include the following parameters, regardless of whether it is for reading or writing Modbus registers:
The Modbus device address from which to read a register or to which to write a value.
**Example:** `0`
Specifies the number of registers to read or write. This should be 1 for (u)int16 data types and 2 for (u)int32, float32 or string32 data types and 4 for (u)int64 or float64 data types.
**Example:** `1`
A unique name for the register, representing the measurement point read from or written to the Modbus device.
**Example:** `measure.ports.port1.voltage`
The data type of the value.
**Options:** `int16 | uint16 | int32 | uint32 | float32 | string32 | int64 | uint64 | float64`
The Modbus function code required to read from or write to the device.
**Options:** `1 | 2 | 3 | 4 | 5 | 6 | 15 | 16`
### Optional Parameters
These parameters are not necessary for every register but can be included as needed:
The scaling factor to apply to the Modbus register's return value or the value being written.
**Example:** `0.1`
The offset to apply to the Modbus register's return value or the value being written.
**Example:** `10`
The number of decimal places used to store the register's return value. Must be a non-negative integer (0 or higher). If not specified, it defaults to `1`.
**Example:** `2`
The direction of the power or current flow on a port of the device. When the direction is set to `output`,
the register value will be inverted.
**Options:** `input | output`
The minimum value of the register. For write register, setting the minimum value prevents you from
writing a value lower than the minimum value. The control command will be blocked by the DCIDE Controller.
**Example:** `0`
The maximum value of the register. For write register, setting the maximum value prevents you from
writing a value higher than the maximum value. The control command will be blocked by the DCIDE Controller.
**Example:** `10`
Indicates if mapping should be applied to the return value or the value being written.
Indicates the type of mapping to be applied.
**Options:** `bitwise | value`
* **bitwise:** Each bit in a number corresponds to a specific state (e.g., fault or status).
* **value:** The entire return value corresponds to a state.
**Example:**
```json icon="code" theme={null}
{
"map": {
"type": "bitwise"
}
}
```
Indicates if the register is a multi-read register.
Specifies the word order notation.
**Options:** `little | big`
Specifies the byte order notation.
**Options:** `little | big`
### `communicationCheck` Register
There is a specific register that is **required** in every Modbus address map, known as `communicationCheck`. This register allows the DCIDE Controller to verify communication with the Modbus device. The controller pings the device and attempts to read the value from the register specified as communicationCheck. A successful read confirms the connection between the DCIDE Controller and the Modbus device.
This register only needs the required parameters to be filled in; optional parameters are not necessary. However, the register must be a valid Modbus register on the device. Therefore, it can be a duplicate of another Modbus register in your address map, but with a different name. For example:
```json icon="code" theme={null}
{
"address": 0,
"numberOfRegisters": 1,
"name": "communicationCheck",
"datatype": "int16",
"functionCode": 3
}
```
### Expression Registers
In addition to standard Modbus registers, you can define **optional** expression registers. An expression register computes a value from other registers in the address map using a mathematical expression, rather than reading directly from the device.
Each expression register requires the following parameters:
A unique name for the expression register.
**Example:** `measure.string1.port1.power`
A mathematical expression that references other registers in the address map by their name, enclosed in curly braces `{}`.
**Example:** `{measure.string1.port1.voltage} * {measure.string1.port1.current}`
The number of decimal places used to store the expression's return value. Must be a non-negative integer (0 or higher). If not specified, it defaults to `1`.
**Example:** `2`
All registers referenced in the expression must exist in the address map itself.
```json icon="code" theme={null}
{
"name": "measure.string1.port1.power",
"expression": "{measure.string1.port1.voltage} * {measure.string1.port1.current}"
}
```
### Saving the Address Map
By following the naming conventions and adding all the required and optional parameters to each Modbus register, you have created a complete address map for the controller
to communicate and interact with the device. The final JSON file should be saved with a unique name and a `.json` extension. For example, `modbus_address_map.json`.
### Example
```json modbus_address_map.json icon="code" theme={null}
[
{
"address": 0,
"numberOfRegisters": 1,
"name": "measure.ports.port1.voltage",
"datatype": "int16",
"functionCode": 3
},
{
"address": 1,
"numberOfRegisters": 1,
"name": "measure.ports.port2.current",
"datatype": "int16",
"functionCode": 3,
"scaling": 0.1,
"offset": 0,
"direction": "output"
},
{
"address": 2,
"numberOfRegisters": 1,
"name": "control.ports.port1.method",
"datatype": "uint16",
"functionCode": 6,
"map": {
"type": "value",
"0": "idle",
"1": "net",
"1026": "GPWR",
"1282": "FPWR"
}
},
{
"address": 3,
"numberOfRegisters": 1,
"name": "fault.active.0",
"datatype": "uint16",
"functionCode": 3,
"map": {
"type": "bitwise",
"0": "GFDI fault",
"1": "IMI fault",
"2": "PM heatsink temp",
"3": "Control board temp",
"4": "24V undervoltage",
"5": "Ext fan lockd",
"6": "DC OV",
"7": "DC UV",
"8": "Link OV",
"9": "Link starve",
"10": "Link OI",
"11": "Link Prim Pos 1200V",
"12": "Link Prim Neg 1200V",
"13": "Link Sec Pos 1200V",
"14": "Link Sec Neg 1200V",
"15": "AC1 A-B Hard Sw Cond"
}
},
{
"address": 0,
"numberOfRegisters": 1,
"name": "communicationCheck",
"datatype": "int16",
"functionCode": 3
}
]
```
# MQTT
Source: https://docs.directenergypartners.com/configure/address-map/types/mqtt
### Naming Conventions
While not mandatory, it is recommended to adopt the following naming conventions for clarity and usability:
* **Read Operations:** Prefix register names with `measure.` to indicate that the register is used for measurement purposes.
### Required Parameters
A unique name for the register.
**Example:** `measure.voltage`
The key of the MQTT message.
**Example:** `DCV_V`
The path to the readings in the MQTT message.
**Example:** `readings`
The path to the key in the MQTT message.
**Example:** `param`
The path to the value in the MQTT message.
**Example:** `value`
Indicates whether the value includes the unit.
### Example
```json mqtt_address_map.json icon="code" theme={null}
[
{
"name": "measure.voltage",
"key": "DCV_V",
"pathToReadings": "readings",
"pathToKey": "param",
"pathToValue": "value",
"valueIncludesUnit": false
}
]
```
# Precharge
Source: https://docs.directenergypartners.com/configure/address-map/types/precharge
### Naming Conventions
While not mandatory, it is recommended to adopt the following naming conventions for clarity and usability:
* **Write Operations:** Prefix register names with `control.` to indicate that the register is used to set the digital output.
* **Read Operations:** Prefix register names with `measure.` to signify that the register is used to read the digital input signal.
See the example address map below for register naming conventions.
### Required Parameters
A unique name for the register.
**Example:** `control.contactor.main`
Corresponds to the number on the digital input or output module.
**Example:** `0`
Please note that the address should start from 0, not from 1. However, the physical address on the I/O module begins at 1.
Indicates whether the register is an input or an output.
**Options:** `input | output`
### Required Registers
This register is used to control the main contactor.
This register is used to control the auxiliary contactor.
### Optional Registers
**Reference Contactor**
This register is used to control the reference contactor. Required when `referenceContactorFeedback` is enabled on the device.
**Contactor Feedback**
This register is used to measure the main contactor. Required when `mainContactorFeedback` is enabled on the device.
This register is used to measure the auxiliary contactor. Required when `auxiliaryContactorFeedback` is enabled on the device.
This register is used to measure the reference contactor. Required when `referenceContactorFeedback` is enabled on the device.
**Breaker Feedback**
This register is used to measure the breaker state. Required when `breakerFeedback` is enabled on the device.
### Example
The example below shows a complete address map for a precharge device with all required and optional registers.
```json precharge_address_map.json icon="code" theme={null}
[
{
"name": "control.contactor.main",
"address": 0,
"type": "output"
},
{
"name": "control.contactor.auxiliary",
"address": 1,
"type": "output"
},
{
"name": "control.contactor.reference",
"address": 2,
"type": "output"
},
{
"name": "measure.contactor.main",
"address": 8,
"type": "input"
},
{
"name": "measure.contactor.auxiliary",
"address": 9,
"type": "input"
},
{
"name": "measure.contactor.reference",
"address": 10,
"type": "input"
},
{
"name": "measure.breaker",
"address": 11,
"type": "input"
}
]
```
# Configuration
Source: https://docs.directenergypartners.com/configure/configuration/config
The configuration file is essential for the proper functioning of the controller, as it includes important settings related to its communication interfaces, such as MQTT, CAN, Telegram, and NATS. The configuration file supports the following entries:
## Required Entries
These entries must be configured for each controller:
* **plcnext**
* **nats**
## Optional Entries
These entries can be added to enable additional functionality. If included, their parameters must be configured correctly:
* **mqtt** - configures the MQTT broker connection
* **can** - configures CAN bus interfaces
* **telegram** - enables Telegram notifications and alerts
* **dcide** - enables live data and power flow on your DCIDE project
Below, we will provide detailed information on each entry, including the required parameters and any optional ones. The configuration file can be found in the `/etc` folder of the `ppl-base` repository and is listed as `config.json`.
## plcnext
### Required Parameters
This is the IP address of the controller. It should always be configured to the controller’s current IP address, as it is used to create sockets.
**Example:** `192.168.1.10`
### Optional Parameters
Though these parameters are not required for the controller to operate, it is good practice to include them in the configuration file to avoid losing track of login credentials.
The username for logging into the WBM of the controller or a shell session. This should be set to `admin`.
**Example:** `admin`
The password for logging into the WBM of the controller or a shell session.
**Example:** `password`
## nats
### Required Parameters
The required parameters are used to set up a local NATS server on the controller. This NATS server is used to integrate with custom applications developed by the customer.
The required parameters are used to set up a local NATS server on the controller. This NATS server is used to integrate with custom applications developed by the customer.
The username for connecting to the local NATS server.
**Example:** `client`
The password for connecting to the local NATS server.
**Example:** `password`
**Example:**
```json icon="code" theme={null}
{
"local": {
"username": "client",
"password": "password"
}
}
```
### Optional Parameters
The optional parameters are used for setting up a NATS connection to the cloud, which hosts a database for storing data. By providing these parameters, the controller can periodically push data to the cloud.
The optional parameters are used for setting up a NATS connection to the cloud, which hosts a database for storing data. By providing these parameters, the controller can periodically push data to the cloud.
The username for connecting to the cloud NATS server.
**Example:** `client`
The password for connecting to the cloud NATS server.
**Example:** `password`
The IP address of the cloud NATS server.
**Example:** `192.168.1.5`
The bucket name for storing data.
**Example:** `my-bucket`
**Example:**
```json icon="code" theme={null}
{
"cloud": {
"username": "client",
"password": "password",
"ipAddress": "192.168.1.5",
"bucket": "my-bucket"
}
}
```
## mqtt (optional)
### Required Parameters
This entry contains all relevant information for the MQTT broker.
This is the IP address of the broker. The broker is hosted on the DCIDE Controller itself, so this should always be the controller’s IP address.
**Example:** `192.168.1.10`
The port number of the MQTT broker. If not specified, it defaults to `1883`.
**Default:** `1883`
**Example:**
```json icon="code" theme={null}
{
"broker": {
"ipAddress": "192.168.1.10",
"port": 1883
}
}
```
## can (optional)
The `can` entry is an optional array that configures the CAN bus interfaces on the controller. Each entry in the array represents a CAN bus interface. If this entry is included, the following parameters are required.
### Required Parameters
An array of CAN bus interface configurations.
The bit rate of the CAN bus interface. Must be one of the following values: `10000`, `20000`, `50000`, `125000`, `250000`, `500000`, `800000`, `1000000`.
**Example:** `500000`
The slot number of the CAN bus interface/module in the bus configuration. Must be a value between 1 and 64 (inclusive).
**Example:** `1`
**Example:**
```json icon="code" theme={null}
[
{
"bitRate": 500000,
"slotNumber": 1
},
{
"bitRate": 125000,
"slotNumber": 5
}
]
```
## telegram (optional)
The `telegram` entry is optional and can be used to enable notifications and alerts. These include livebit messages every 24 hours and alerts for critical device failures in the system. If the customer does not wish to receive updates via Telegram, they simply need to omit this entry from the config file. If this entry is included, the following parameters are required.
### Required Parameters
Represents the unique chat ID of the Telegram channel. Each Telegram channel has its own unique ID.
**Example:** `123456789`
A token consisting of letters and numbers, required for authorizing the bot and sending requests to the Bot API. The Bot API is already added to the Telegram channel.
**Example:** `123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ`
## dcide (optional)
The `dcide` entry is optional and enables live data and live power flow on your DCIDE project single line diagram. By adding this entry with the required parameters, live data from your microgrid is fed back into the DCIDE project and power flow is shown on the diagram. This includes power flow, current flow, voltage levels, battery state of charge, and device status.
### Required Parameters
The project ID of your DCIDE project. You can find it in the DCIDE project settings tab by activating live data and copying the Project ID that is listed there.
**Example:** `a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6`
The secret for your DCIDE project's live data connection. You can find it in your DCIDE project by going to settings, enabling live data, and then modifying the secret there. The secret in your DCIDE project should match the secret you fill in in the config file on the controller.
**Example:** `my-dcide-secret`
## File Validator
Use the File Validator to verify that your `config.json` is correct, contains no errors, and includes all required parameters so the DCIDE Controller can start up properly.
Validate your configuration files before uploading them to the controller.
# Example
Source: https://docs.directenergypartners.com/configure/configuration/example
```json config.json icon="code" theme={null}
{
"plcnext": {
"ipAddress": "192.168.1.10",
"username": "admin",
"password": "password"
},
"mqtt": {
"broker": {
"ipAddress": "192.168.1.10",
"port": 1883
}
},
"can": [
{
"bitRate": 500000,
"slotNumber": 1
},
{
"bitRate": 125000,
"slotNumber": 5
}
],
"telegram": {
"chatId": "-123456789",
"botToken": "123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ"
},
"dcide": {
"projectId": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"secret": "my-dcide-secret"
},
"nats": {
"local": {
"username": "client",
"password": "password"
},
"cloud": {
"username": "plc",
"password": "password",
"ipAddress": "192.168.1.5",
"bucket": "my-bucket"
}
}
}
```
Please note that the configuration file comes pre-filled with all the necessary parameters. The only exception is if the controller's IP address changes during commissioning.
In that case, you will need to update the ipAddress entries in both the plcnext and mqtt sections. All other parameters can remain unchanged.
# Introduction
Source: https://docs.directenergypartners.com/configure/control-map/index
In this section, you will learn how to create control maps for devices. Control maps are particularly important for devices that communicate over Modbus TCP/IP.
The purpose of control maps is to either read multiple registers with a single command or send multiple commands to a device with a single command. It is important to note that each device that requires a control map will have its own specific control map. Not all device types need a control map; for instance, control maps are less commonly used for digital and analog I/O’s, though they can exist.
For digital and analog I/O’s, all registers listed in the address map with the prefix “measure.” are automatically read from the modules. Control maps for digital I/O’s are typically used to control multiple outputs with one command. For more information, see the section below.
The control maps can be found in the `/etc` folder of the `ppl-base` repository. They follow a typical naming convention: `_control.json`. Each control map file must have a .json extension. For clarity, it is recommended, though not required, that the `uniqueName` is the same as that of the corresponding address map.
## File Validator
Use the File Validator to check whether your control maps are correct, contain no errors, and reference valid registers so the DCIDE Controller can start up and interface with the configured devices.
Validate your configuration files before uploading them to the controller.
# Analog I/O
Source: https://docs.directenergypartners.com/configure/control-map/types/aio
So far, a control map for analog inputs or outputs has not been created because there has been no use case for it. As previously mentioned, the analog I/O’s will automatically and periodically read every register in the address map marked with “measure.” Therefore, a control command like **getMeasurements** is not needed in this case. Although a control map for analog I/O’s has not been created before, the structure and required parameters for constructing one remain the same.
### Required Parameters
The unique name of the control command.
This contains a list of write commands that will be executed when the control command is called upon.
It's always advisable to have your custom-created device and config files, addresses, and control maps reviewed by the DEP PPL support team.
They can verify that your files are accurate and free from errors by running them in a simulated environment. To request support, please email [pplsupport@directenergypartners.com](mailto:pplsupport@directenergypartners.com).
# Digital I/O
Source: https://docs.directenergypartners.com/configure/control-map/types/dio
A control map for digital I/O’s is typically used to control multiple digital outputs with a single command. This will be illustrated by the example provided below. As mentioned in the introduction, the digital I/O’s will automatically and periodically read every register in the address map marked with “measure.” Therefore, in this case, a control command like **getMeasurements** is not required.
### Required Parameters
The unique name of the control command.
**Example:** `red`
This contains a list of write commands that will be executed when the control command is called upon.
**Example:** `control.status.input1 = 1 | control.status.input2 = 0 | control.status.input3 = 0 | control.status.input4 = 0`
### Example
The example below shows a part of the control map of the LED status indicator on the DCIDE Controller panel. Changing its color requires setting or adjusting four digital outputs. To simplify this process and avoid changing each output individually, the control map includes commands labeled with color names that will adjust all four digital outputs simultaneously.
```json dio_control_map.json icon="code" theme={null}
[
{
"name": "off",
"commands": "control.status.input1 = 0 | control.status.input2 = 0 | control.status.input3 = 0 | control.status.input4 = 0"
},
{
"name": "red",
"commands": "control.status.input1 = 1 | control.status.input2 = 0 | control.status.input3 = 0 | control.status.input4 = 0"
},
{
"name": "yellow",
"commands": "control.status.input1 = 1 | control.status.input2 = 1 | control.status.input3 = 0 | control.status.input4 = 0"
},
{
"name": "flashblue",
"commands": "control.status.input1 = 0 | control.status.input2 = 0 | control.status.input3 = 1 | control.status.input4 = 1"
},
{
"name": "flashwhite",
"commands": "control.status.input1 = 1 | control.status.input2 = 1 | control.status.input3 = 1 | control.status.input4 = 1"
}
]
```
# Modbus TCP/IP
Source: https://docs.directenergypartners.com/configure/control-map/types/modbus
A dedicated control map is required for each Modbus device. However, this control map can be reused for devices of the same type from the same manufacturer. For example, if you have multiple 30C3 converters in your microgrid application, you can use the same control map for all of them.
### Required Parameters
The unique name of the control command.
**Example:** `getMeasurements`
This contains a list of read or write commands that will be executed when the control command is called upon.
**Example:** `measurements1? | measurements2? | measurements3? | measurements4?`
Note the difference between read and write commands:
* **Read Commands:**
* Add a ‘?’ after every register to be read.
* Separate each register with a ‘|’.
* **Write Commands:**
* Place a ‘=’ between the control register and the value to be written.
* Separate each control register with a ‘|’.
Please refer to the example control map below for more clarity.
The control command **getMeasurements** is essential for every control map for Modbus devices. This command lists all the read registers from the address map that the controller needs to retrieve from the connected Modbus device. These can be individual read registers or grouped as multi-read registers. Other control commands are optional.
### Example
```json modbus_control_map.json icon="code" theme={null}
[
{
"name": "getMeasurements",
"commands": "measurements1? | measurements2? | measurements3? | measurements4?"
},
{
"name": "initialize",
"commands": "control.ports.port1.method = net | control.ports.port2.method = constant-voltage | control.ports.port3.method = idle | control.mode = auto"
},
{
"name": "start",
"commands": "control.enable = 1"
},
{
"name": "stop",
"commands": "control.disable = 1"
},
{
"name": "faultReset",
"commands": "control.fault.reset = 1"
}
]
```
# Configuration
Source: https://docs.directenergypartners.com/configure/devices/devices
In this section, you will learn how to create and configure your own devices file. This file is essential for integrating and interfacing the DCIDE Controller with
the devices in your microgrid application. The devices file can be found in the `/etc` folder of the `ppl-base` repository and is listed as `devices.json`.
The devices file is crucial for the operation of the DCIDE Controller, as it contains the configuration details for all devices within your microgrid application.
This JSON-formatted file is stored directly on the DCIDE Controller. Upon startup, the controller reads this file and establishes connections with the listed devices.
When adding a new device, it is critical to specify the communication protocol or the type for each device. This defines how the controller communicates with each device.
The supported communication protocols and types include:
* **Modbus TCP/IP**
* **CANbus**
* **MQTT**
* **Digital I/O**
* **Analog I/O**
* **Precharge**
Each device entry in the file must specify the appropriate protocol from the list above. In addition to the protocol, a device entry in the devices file also contains
other required and optional parameters. The required and optional parameters for each communication protocol are explained in more detail below.
## File Validator
Use the File Validator to verify that your `devices.json` is correct, contains no errors, and references the required address maps and control maps so the DCIDE Controller can start up and interface with your devices.
Validate your configuration files before uploading them to the controller.
# Example
Source: https://docs.directenergypartners.com/configure/devices/example
Here is an example of a complete `devices.json` file, featuring devices with various protocols and types. Please note that this file is for illustration only and
cannot be uploaded to the controller. Ensure that you modify, add, or remove devices as needed to accurately reflect all the devices in your application.
```json devices.json icon="code" theme={null}
[
{
"id": "converter1",
"type": "converter",
"protocol": "Modbus TCP/IP",
"ipAddress": "192.168.1.20",
"port": 502,
"slaveId": 240,
"controlMap": "cet_30C3_control",
"addressMap": "cet_30C3_address_map",
"forwardMap": "cet_30C3_forward_map",
"disabled": false,
"critical": true,
"communicationInterval": 0.2
},
{
"id": "battery1",
"type": "battery",
"protocol": "CANbus",
"addressMap": "canbus_device_address_map",
"controlMap": "canbus_device_control",
"disabled": false,
"frameFormat": "11-bit",
"module": 1
},
{
"id": "pushbuttons",
"type": "digitalInputOutput",
"addressMap": "pushbuttons_address_map",
"retainInputs": true,
"disabled": false
},
{
"id": "indicators",
"type": "digitalInputOutput",
"controlMap": "indicators_rgb7_control",
"addressMap": "indicators_address_map",
"disabled": false
},
{
"id": "transducer",
"type": "analogInputOutput",
"addressMap": "vmt_address_map",
"disabled": false
},
{
"id": "battery1_precharge",
"type": "precharge",
"addressMap": "battery1_precharge_address_map",
"disabled": false,
"holdReferenceInSeconds": 5,
"prechargePeriodInSeconds": 10,
"holdAuxiliaryInSeconds": 2,
"tresholdVoltage": 700,
"maximumVoltage": 760,
"mainContactorFeedback": true,
"auxiliaryContactorFeedback": false,
"referenceContactorFeedback": true,
"breakerFeedback": true,
"maxFeedbackRetries": 3
},
{
"id": "breaker1",
"type": "breaker",
"addressMap": "breaker1_address_map",
"disabled": false
},
{
"id": "contactor1",
"type": "contactor",
"addressMap": "contactor1_address_map",
"disabled": false,
"holdReferenceInSeconds": 5,
"contactorFeedback": true
}
]
```
# Analog I/O
Source: https://docs.directenergypartners.com/configure/devices/types/aio
### Required Parameters
To add an analog input or an analog output device, such as voltage transducer, the following parameters are required.
A unique identifier for the device.
**Example:** `transducer`
Indicates the type of device. For this type of device, it is always `analogInputOutput`.
**Example:** `analogInputOutput`
The name of the device’s address map on the controller.
**Example:** `vmt_address_map`
Indicates whether the device is enabled or disabled. A value of true means the device is disabled, while false means the device is enabled.
### Example
The snippet below illustrates an analog input/output device, highlighting the required parameters. Note that no optional parameters should be added for this device type.
```json icon="code" theme={null}
{
"id": "transducer",
"type": "analogInputOutput",
"addressMap": "vmt_address_map",
"disabled": false
}
```
# Breaker
Source: https://docs.directenergypartners.com/configure/devices/types/breaker
### Required Parameters
To add a breaker device, the following parameters are required.
A unique identifier for the device.
**Example:** `breaker1`
Indicates the type of device. For this type of device, it is always `breaker`.
**Example:** `breaker`
The name of the device’s address map on the controller.
**Example:** `breaker1_address_map`
Indicates whether the device is enabled or disabled. A value of true means the device is disabled, while false means the device is enabled.
### Example
The snippet below demonstrates a breaker device, highlighting the required parameters.
```json icon="code" theme={null}
{
"id": "breaker1",
"type": "breaker",
"addressMap": "breaker1_address_map",
"disabled": false
}
```
When configuring a breaker device, ensure that all required parameters are correctly specified to avoid configuration errors.
Always verify that the paths provided for addressMap are accurate and that the files exist in the specified locations.
# CANbus
Source: https://docs.directenergypartners.com/configure/devices/types/canbus
### Required Parameters
To add a device using the CANbus communication protocol, the following parameters are required.
A unique identifier for the device.
**Example:** `battery1`
Indicates the type of device.
**Options:** `converter`, `battery`, `other`
The communication protocol between the controller and the device. For this type of device, it will always be `CANbus`.
**Example:** `CANbus`
The name of the device's address map on the controller.
**Example:** `canbus_device_address_map`
Indicates whether the device is enabled or disabled. A value of true means the device is disabled, while false means the device is enabled.
### Optional Parameters
The parameters listed below are optional and are not required for a device with the CANbus protocol to work properly. However, sometimes it is desirable to add these optional parameters for specific device requirements.
The name of the device's control map on the controller.
**Example:** `canbus_device_control`
Specifies the CAN frame format to use for communication. Defaults to `29-bit` if not specified.
**Options:** `11-bit | 29-bit`
Physical CAN module number. Defaults to `1` if not specified. If you only have one physical CAN module, this parameter is not needed. If you have more than one, each CAN device needs this parameter set, otherwise it will default to CAN module `1`.
**Options:** `1 | 2`
### Example
The snippet below demonstrates a device with id `battery1` and protocol `CANbus`, including all the required parameters along with the optional parameters.
```json icon="code" theme={null}
{
"id": "battery1",
"type": "battery",
"protocol": "CANbus",
"addressMap": "canbus_device_address_map",
"controlMap": "canbus_device_control",
"disabled": false,
"frameFormat": "11-bit",
"module": 1
}
```
When configuring a device with CANbus communication, ensure all required parameters are correctly specified to prevent configuration errors.
Always verify that the paths provided for addressMap and controlMap are accurate and that the files exist in the specified locations.
# Contactor
Source: https://docs.directenergypartners.com/configure/devices/types/contactor
## How It Works
### Hardware Layout
Contactor is a predefined device type in the controller that handles the closing and opening of contactors based on manual control commands.
A contactor device controls up to two contactors on a DC bus connection. The main contactor is required, the reference contactor is optional.
* **Main contactor**: switches the positive line of the DC connection.
* **Reference contactor** *(optional)*: switches the negative line of the DC connection.
### Control
The contactor device is always in one of the following states:
0. **Open**: all contactors are open. The device waits for a `control.enable` command to close the contactors.
1. **Closed reference**\*: the reference contactor is closed first. The device waits for `holdReferenceInSeconds` before continuing *(\*only if a reference contactor register is defined in the address map. If not, this state is skipped and the device immediately transitions to the Closed state)*.
2. **Closed**: the main contactor is closed. The DC bus is now fully connected through the main and reference contactors. The device returns to the `Open` state when a `control.disable` command is received, or if contactor feedback is enabled and a contactor is no longer in the expected state.
* **`control.enable`**: closes the contactors.
* **`control.disable`**: opens the contactors.
If contactor feedback is enabled and a contactor does not reach its expected state within 15 seconds, all contactors are opened and the device resets to the `Open` state.
## Required Parameters
To add a contactor device, the following parameters are required.
A unique identifier for the device.
**Example:** `contactor1`
Indicates the type of device. For this type of device, it is always `contactor`.
**Example:** `contactor`
The name of the device's address map on the controller.
**Example:** `contactor1_address_map`
Indicates whether the device is enabled or disabled. A value of true means the device is disabled, while false means the device is enabled.
## Optional Parameters
The following parameters are optional and provide additional functionality to the device.
The duration in seconds the device remains in the `Closed reference` state, with the reference contactor closed, before closing the main contactor. Defaults to `3` seconds if not specified.
**Example:** `5`
Enables feedback for both contactors (main and reference) at once. When set to `true`, this is equivalent to setting `mainContactorFeedback` and `referenceContactorFeedback` both to `true`.
Indicates whether feedback is enabled for the main contactor. When enabled, the address map must contain a `measure.contactor.main` register.
Indicates whether feedback is enabled for the reference contactor. When enabled, the address map must contain both a `control.contactor.reference` and a `measure.contactor.reference` register.
## Example
The snippet below demonstrates a contactor device, highlighting both the required and optional parameters.
```json icon="code" theme={null}
{
"id": "contactor1",
"type": "contactor",
"addressMap": "contactor1_address_map",
"disabled": false,
"holdReferenceInSeconds": 5,
"contactorFeedback": true
}
```
When configuring a contactor device, ensure that all required parameters are correctly specified to avoid configuration errors.
Always verify that the paths provided for addressMap are accurate and that the files exist in the specified locations.
# Digital I/O
Source: https://docs.directenergypartners.com/configure/devices/types/dio
### Required Parameters
To add a digital input or a digital output device, such as pushbuttons or a LED status indicator, the following parameters are required.
A unique identifier for the device.
**Example:** `pushbuttons`
Indicates the type of device. For this type of device, it is always `digitalInputOutput`.
**Example:** `digitalInputOutput`
The name of the device’s address map on the controller.
**Example:** `pushbuttons_address_map`
Indicates whether the device is enabled or disabled. A value of true means the device is disabled, while false means the device is enabled.
### Optional Parameters
The following parameters can be added to digital input or output devices; however, they are optional and not required. These parameters provide additional functionality to the device.
This parameter indicates if the inputs should be retained or not. If true, when input changes state, it will keep the value for 10 seconds.
Note that this parameter is relevant only for digital inputs, not for outputs.
The name of the device’s control map on the controller.
**Example:** `indicators_rgb7_control`
### Example
The snippet below demonstrates two different digital input/output devices, highlighting both the required and optional parameters.
```json icon="code" theme={null}
[
{
"id": "pushbuttons",
"type": "digitalInputOutput",
"addressMap": "pushbuttons_address_map",
"retainInputs": true,
"disabled": false
},
{
"id": "indicators",
"type": "digitalInputOutput",
"controlMap": "indicators_rgb7_control",
"addressMap": "indicators_address_map",
"disabled": false
}
]
```
When configuring a digital input or output device, ensure that all required parameters are correctly specified to avoid configuration errors.
Optional parameters can provide additional functionality and control but are not necessary for basic operation.
Always verify that the paths provided for addressMap and controlMap are accurate and that the files exist in the specified locations.
# Modbus TCP/IP
Source: https://docs.directenergypartners.com/configure/devices/types/modbus
### Required Parameters
To add a device using the Modbus TCP/IP communication protocol, the following parameters are required.
A unique identifier for the device.
**Example:** `converter1`
Indicates the type of device.
**Options:** `converter`, `battery`, `other`
The communication protocol between the controller and the device. For this type of device, it will always be `Modbus TCP/IP`.
**Example:** `Modbus TCP/IP`
The static IP address set for the device.
**Example:** `192.168.1.20`
The port number used for communication. Please consult the device's manual to determine the port on which it communicates.
**Example:** `502`
The slave ID of the device. Please consult the device's manual to determine the specific slave ID.
**Example:** `1`
The name of the device’s control map on the controller.
**Example:** `cet_30C3_control`
The name of the device’s address map on the controller.
**Example:** `cet_30C3_address_map`
Indicates whether the device is enabled or disabled. A value of true means the device is disabled, while false means the device is enabled.
### Optional Parameters
The parameters listed below are optional and are not required for a device with the Modbus TCP/IP protocol to work properly. However, sometimes it is desirable to add these optional parameters for device monitoring or because they are required by the manufacturer.
Marks this device as critical or not. If a device is marked as critical (value true), any fault occurring on this device will send out an alert or notification over Telegram.
Indicates the delay between consecutive Modbus operations, read or write. Between each Modbus command, the controller will wait this amount of time. The value is expressed in seconds.
**Example:** `0.2`
Indicates the name of the device’s forward map on the controller.
**Example:** `cet_30C3_forward_map`
### Example
The snippet below demonstrates a device with id `converter1` and protocol `Modbus TCP/IP`, including all the required parameters along with the optional parameters.
```json icon="code" theme={null}
{
"id": "converter1",
"type": "converter",
"protocol": "Modbus TCP/IP",
"ipAddress": "192.168.1.20",
"port": 502,
"slaveId": 240,
"controlMap": "cet_30C3_control",
"addressMap": "cet_30C3_address_map",
"forwardMap": "cet_30C3_forward_map",
"disabled": false,
"critical": true,
"communicationInterval": 0.2
}
```
When configuring a device with Modbus TCP/IP communication, ensure all required parameters are correctly specified to prevent configuration errors. Optional parameters can offer additional
functionality and control but are not essential for basic operation. Always verify that the paths provided for addressMap and controlMap are accurate and that the files exist in the specified locations.
# MQTT
Source: https://docs.directenergypartners.com/configure/devices/types/mqtt
### Required Parameters
To add an MQTT device, the following parameters are required.
A unique identifier for the device.
**Example:** `aculink_meter`
Indicates the type of device. For this type of device, it is always `other`.
**Example:** `other`
The communication protocol between the controller and the device. For this type of device, it will always be `MQTT`.
**Example:** `MQTT`
The name of the device’s address map on the controller.
**Example:** `aculink_meter_address_map`
Indicates whether the device is enabled or disabled. A value of true means the device is disabled, while false means the device is enabled.
The MQTT topic of the device to which the controller will subscribe.
**Example:** `DCMG_meter`
### Optional Parameters
The following parameters can be added to MQTT devices; however, they are optional and not required. These parameters provide additional functionality to the device.
This parameter lists the registers to forward to another device.
**Example:**
```json icon="code" theme={null}
{
"forward": {
"register1": "device2.register1",
"register2": "device2.register2"
}
}
```
### Example
The snippet below demonstrates two different MQTT devices, highlighting both the required and optional parameters.
```json icon="code" theme={null}
{
"id": "aculink_meter",
"type": "other",
"protocol": "MQTT",
"addressMap": "aculink_meter_address_map",
"disabled": false,
"topic": "DCMG_meter",
"forward": {
"measure.voltage": "battery1_precharge.control.voltage"
}
}
```
# Precharge
Source: https://docs.directenergypartners.com/configure/devices/types/precharge
## How It Works
### Hardware Layout
Precharge is a predefined device type in the controller that automatically handles the precharge logic and the closing of contactors, based on a voltage measurement or setpoint.
A precharge device controls up to three contactors on a DC bus connection. The main and auxiliary contactors are required, the reference contactor is optional.
* **Main contactor**: switches the positive line of the DC connection.
* **Reference contactor** *(optional)*: switches the negative line of the DC connection.
* **Auxiliary contactor**: switches the precharge contactor, placed in series with a precharge resistor. It is used to limit inrush current during startup.
### Voltage Source
The precharge logic requires a voltage measurement to determine when to start or stop the sequence. The voltage can come from two sources:
* **Setpoint** (`status.voltage`): a value written directly to the precharge device, for example by another device or a control script.
* **Analog measurement** (`measure.voltage`): a value forwarded from a connected analog measuring device via `analogMeasurementAddressMap`. When an analog address map is configured, this source takes priority over the voltage setpoint.
### Precharge Sequence
The precharge device is always in one of the following states:
0. **Open**: all contactors are open. The device monitors the voltage measurement or setpoint and waits for the conditions to start the precharge sequence. The sequence starts when the voltage rises above `tresholdVoltage` (and below `maximumVoltage`, if configured). If `breakerFeedback` is enabled, a valid breaker signal is also required.
1. **Closed reference**\*: the reference contactor is closed first. The device waits for `holdReferenceInSeconds` before continuing *(\*only if a reference contactor register is defined in the address map. If not, this state is skipped and the device immediately transitions to the Precharging state)*.
2. **Precharging**: the auxiliary contactor is closed, allowing current to flow through the precharge resistor. The device waits for `prechargePeriodInSeconds` to allow the DC link capacitance to charge.
3. **Closed with auxiliary**: the main contactor is closed. The auxiliary contactor remains closed for `holdAuxiliaryInSeconds` to ensure a controlled transition before it is opened.
4. **Closed**: the auxiliary contactor opens. The DC bus is now fully connected through the main and reference contactors.
The device returns to the **Open** state if the voltage drops below `tresholdVoltage`, exceeds `maximumVoltage` (if configured), the breaker signal is lost (if `breakerFeedback` is enabled), or the main or reference contactor feedback is lost (if the respective feedback options are enabled).
If contactor feedback is enabled and a contactor does not reach its expected state within 5 seconds, the precharge sequence is aborted and restarted from the beginning. If `maxFeedbackRetries` is configured, the device counts each such retry. When the maximum number of retries is reached, the device enters a fault state and requires a `control.reset` command before it can resume normal operation.
### Manual Control
For testing purposes (for example, to verify the precharge configuration and contactor wiring), the precharge sequence can be controlled manually by writing commands directly to the precharge device:
* **`control.enable`**: manually starts the precharge sequence, regardless of the voltage measurement or setpoint.
* **`control.disable`**: manually stops the precharge sequence and opens all contactors.
After using manual control, use **`control.reset`** to clear the manual enable/disable state and return to normal operation, where the precharge sequence is driven by the voltage measurement or setpoint.
## Required Parameters
To add a precharge device, the following parameters are required.
A unique identifier for the device.
**Example:** `battery1_precharge`
Indicates the type of device. For this type of device, it is always `precharge`.
**Example:** `precharge`
The name of the device’s address map on the controller.
**Example:** `battery1_precharge_address_map`
Indicates whether the device is enabled or disabled. A value of true means the device is disabled, while false means the device is enabled.
The duration in seconds the device remains in the `Precharging` state, with the auxiliary contactor closed, before closing the main contactor.
**Example:** `10`
The duration in seconds the auxiliary contactor remains closed after the main contactor has been closed.
**Example:** `2`
The minimum voltage in volts required to start the precharge sequence. While in the `Open` state, the device waits until the voltage measurement or setpoint rises above this value before initiating the sequence. If the voltage drops below this value while in the `Closed` state, the device opens all contactors and returns to the `Open` state.
**Example:** `700`
## Optional Parameters
The following parameters can be added to digital input or output devices; however, they are optional and not required. These parameters provide additional functionality to the device.
Enables feedback for all three contactors (main, auxiliary, and reference) at once. When set to `true`, this is equivalent to setting `mainContactorFeedback`, `auxiliaryContactorFeedback`, and `referenceContactorFeedback` all to `true`.
Indicates whether feedback is enabled for the main contactor. When enabled, the address map must contain a `measure.contactor.main` register.
Indicates whether feedback is enabled for the auxiliary contactor. When enabled, the address map must contain a `measure.contactor.auxiliary` register.
Indicates whether feedback is enabled for the reference contactor. When enabled, the address map must contain a `measure.contactor.reference` register.
Indicates whether the breaker feedback is enabled or not.
The maximum voltage in volts above which the precharge sequence will not start, or if already in the `Closed` state, will cause the device to open all contactors and return to the `Open` state.
**Example:** `760`
The duration in seconds the device remains in the `Closed reference` state, with the reference contactor closed, before engaging the auxiliary contactor. Defaults to `3` seconds if not specified.
**Example:** `5`
Indicates the name of the device's analog measurement address map on the controller.
**Example:** `battery1_analog_address_map`
The maximum number of times the precharge device may retry the precharge sequence when the contactor control and feedback do not match. When the limit is reached, the device enters a fault state and requires a `control.reset` command before it is released. Defaults to `-1`, which allows unlimited retries. A value of `0` means no retries are allowed.
**Example:** `3`
## Example
The snippet below demonstrates a precharge device, highlighting both the required and optional parameters.
```json icon="code" theme={null}
{
"id": "battery1_precharge",
"type": "precharge",
"addressMap": "battery1_precharge_address_map",
"disabled": false,
"holdReferenceInSeconds": 5,
"prechargePeriodInSeconds": 10,
"holdAuxiliaryInSeconds": 2,
"tresholdVoltage": 700,
"maximumVoltage": 760,
"mainContactorFeedback": true,
"auxiliaryContactorFeedback": false,
"referenceContactorFeedback": true,
"breakerFeedback": true,
"maxFeedbackRetries": 3
}
```
When configuring a precharge device, ensure that all required parameters are correctly specified to avoid configuration errors.
Optional parameters can provide additional functionality and control but are not necessary for basic operation.
Always verify that the paths provided for addressMap are accurate and that the files exist in the specified locations.
# Introduction
Source: https://docs.directenergypartners.com/configure/index
In this section, the process of configuring the devices file and the config file for the DCIDE Controller will be explained. These files are essential for the
controller's operation and communication with devices in the microgrid. Additionally, the creation of custom address and control maps for various devices, including
Modbus devices and digital and analog I/O’s, will be covered.
Direct Energy Partners has created a general repository called `dep-ppl-base`, containing all the necessary files and folders required to operate the microgrid controller.
Customers can start modifying these files to suit their specific microgrid applications. Below, you will find detailed instructions on how to fork, clone and modify the files
contained in the dep-ppl-base repository.
Once all the files have been created, they should be uploaded to the DCIDE Controller. After this, the next step is to commission and troubleshoot the communication
between the DCIDE Controller and the devices in the microgrid system, as well as to commission the individual devices. Another possible next step is to develop a custom application.
## File Validator
Use the File Validator to verify that your configuration files are correct, contain no errors, and include the required registers and parameters needed for the DCIDE Controller to start up and interface with the configured devices.
Validate your devices file, config file, address maps, and control maps before uploading them to the controller.
This is a live document and is updated regularly. For the latest version, always refer to the online documentation.
# Clone Repository
Source: https://docs.directenergypartners.com/configure/repository/clone
Now you can clone your forked repository to your computer so you can work on it.
## Clone Your Fork Locally
You need **Git** to clone and manage repositories locally. If you don't have it installed, follow the steps below to install it.
* **Windows:** Download and install Git from [https://git-scm.com/download/win](https://git-scm.com/download/win)
* **Mac:** Download and install Git from [https://git-scm.com/download/mac](https://git-scm.com/download/mac)
* **Linux:** Install Git via your package manager, for example:
```bash theme={null}
sudo apt install git # Debian/Ubuntu
sudo yum install git # RedHat/CentOS
```
Open your forked repository on GitHub (it will be under your account).
Click the green Code button and copy the URL (choose HTTPS).
Open your code editor (Visual Studio, Windsurf, or any IDE that supports Git).
Open a terminal on your local machine.
Run the following command, replacing the URL with your fork’s URL:
```bash theme={null}
git clone https://github.com/YOUR_USERNAME/dep-ppl-base.git
```
Make sure to replace `YOUR_USERNAME` with your actual GitHub username.
```bash theme={null}
cd dep-ppl-base
```
## Open Project in Code Editor
### Visual Studio
- Open Visual Studio.
- Click Open a project or solution.
- Navigate to the cloned **dep-ppl-base** folder and open it.
### Windsurf
- Open Windsurf.
- Click Open Project and select the cloned **dep-ppl-base** folder.
You are now ready to start making changes.
# Copy etc Folder
Source: https://docs.directenergypartners.com/configure/repository/copy
This section explains how to copy the `etc` folder from your local `dep-ppl-base` repository to the DCIDE Controller.
This method is intended only when the controller has no direct internet access to GitHub. If the controller has internet access, prefer using the pull method.
Whenever you make changes to configuration files, you must upload the updated `etc` folder (or the changed files inside it) again to the controller.
## Prerequisites
Ensure you have the `dep-ppl-base` repository on your local machine/computer and that the `etc` folder contains the desired configuration files.
Have the controller IP address, admin username, and password available. File transfer will use SFTP (port 22).
## Using FileZilla
Start FileZilla on your Windows machine.
In the Quickconnect bar:
- Host:
\
- Username:
admin
- Password:
\
- Port:
22
Click Quickconnect and accept any host key prompt if shown.
- Local (left): browse to your local repository's
etc folder.
- Remote (right): browse to
/opt/plcnext/appshome/data/60002172000969.
Drag the local etc folder (or the modified files inside it) to the remote pane to upload. Approve overwrite if prompted.
Confirm the etc folder and files appear on the remote path. Re-run this upload whenever you change files locally.
## Using WinSCP
Start WinSCP and click New Site.
Set:
- File protocol:
SFTP
- Host name:
\
- Port number:
22
- User name:
admin
- Password:
\
Click Login and accept the host key if prompted.
In the two‑pane view:
- Left: open your local repository's
etc folder.
- Right: open
/opt/plcnext/appshome/data/60002172000969.
Drag the local etc folder (or selected changed files) to the right pane. Confirm overwrite if asked.
Check the files are present on the controller. Repeat this upload after every local change.
# Fork Repository
Source: https://docs.directenergypartners.com/configure/repository/fork
This section explains how to fork the `dep-ppl-base` repository and start working on it locally using a code editor
like **Visual Studio** or **Windsurf**. Follow each step carefully.
## Create a GitHub Account
Before you can fork a repository, you need a GitHub account. If you don't have one, follow the steps below to create one.
Click **Sign up** in the top-right corner.
Follow the instructions to create your account (choose a username, email, and password).
Verify your email address.
## Fork the Repository
Forking a repository creates your own copy of it in your GitHub account.
Click the **Fork** button in the top-right corner of the page.
Choose your GitHub account as the destination for the fork.
Wait a few seconds. GitHub will create a copy of the repository under your account.
You now have your own copy of `dep-ppl-base` where you can make changes freely. Next step is to clone your forked repository to your local machine.
# Introduction
Source: https://docs.directenergypartners.com/configure/repository/index
The DCIDE Controller relies on **devices file**, **configuration file**, and **address maps** to manage and monitor the microgrid system.
To get started with development, you can use the starter repository **[dep-ppl-base](https://github.com/Direct-Energy-Partners/dep-ppl-base)** on GitHub as a foundation for your work.
GitHub is a powerful tool for **version control**, allowing you to safely track changes, collaborate with others, and maintain your own copy of the repository.
## Starter Repository
This starter repository provides a basic starting point for development. It includes:
- Sample config file
- Sample devices file
- Reference address maps
This repository is the foundation for creating your own customized setup.
## Recommended Workflow
Set up a GitHub account, fork and clone the **dep-ppl-base** repository, and then modify or add the necessary files to customize your setup.
After making your changes, be sure to commit and push your latest changes to GitHub, and then pull the changes on the DCIDE Controller to keep it up to date.
All these steps and concepts will be explained in detail in the next sections.
GitHub will help you safely track and save your changes as you work.
# Pull Changes
Source: https://docs.directenergypartners.com/configure/repository/pull
This section explains how to clone your personal `dep-ppl-base` repository from GitHub to the DCIDE Controller,
as well as how to pull the latest changes from the remote repository to the controller.
Pulling or cloning is only possible if the controller has internet access to reach GitHub. Ensure the controller is connected to the internet before proceeding.
If the controller doesn’t have direct internet access to GitHub, you can instead use the copy method to transfer the `etc` folder from your local `dep-ppl-base` repository to the DCIDE Controller.
## Clone the Repository
If you have already cloned the repository, you can skip this section and go directly to the [Pull the Latest Changes](#pull-the-latest-changes) section.
Open a terminal on your local machine and connect to the controller using SSH:
```bash theme={null}
ssh admin@
```
Enter the admin password when prompted.
```bash theme={null}
cd /opt/plcnext/appshome/data/60002172000969
```
```bash theme={null}
git init
```
```bash theme={null}
git config --global --add safe.directory /opt/plcnext/appshome/data/60002172000969
```
```bash theme={null}
git remote add origin https://github.com/YOUR_USERNAME/dep-ppl-base.git
```
Make sure to replace `YOUR_USERNAME` with your actual GitHub username.
Enable sparse-checkout to clone only specific paths:
```bash theme={null}
git sparse-checkout init --cone
git sparse-checkout set etc
git pull
```
```bash theme={null}
git checkout main
```
Pull the contents from the remote repository:
```bash theme={null}
git pull
```
## Pull the Latest Changes
To pull the latest changes from the remote repository on the DCIDE Controller, follow these steps:
Ensure the controller has internet access to GitHub. Without connectivity, `git pull` will fail.
Open a terminal on your local machine and connect to the controller using SSH:
```bash theme={null}
ssh admin@
```
Enter the admin password when prompted.
Change directory to the location where you cloned the repository.
```bash theme={null}
cd /opt/plcnext/appshome/data/60002172000969
```
Run the following command to pull the latest changes from the remote repository:
```bash theme={null}
git pull
```
# Push Changes
Source: https://docs.directenergypartners.com/configure/repository/push
This section guides you through committing and pushing your local changes to your cloned GitHub repository.
Once you have updated the necessary files, such as the `devices` file, the `config` file, or any address and control maps,
you need to save these changes to your repository. Pushing your changes ensures they are stored on GitHub, making them accessible
from other machines or for later deployment to the DCIDE Controller.
You can commit and push your changes either by using Git commands in the terminal or by using the built-in Git features in a
code editor like Visual Studio or Windsurf. The following steps will walk you through both methods.
## Using Git Commands
Open a terminal on your local machine.
Run the following command to check the status of your repository:
```bash theme={null}
git status
```
Run the following command to add your changes to the staging area:
```bash theme={null}
git add .
```
or run the following command to only add specific files:
```bash theme={null}
git add
```
Run the following command to commit your changes:
```bash theme={null}
git commit -m "Your commit message"
```
Run the following command to push your changes to your remote repository:
```bash theme={null}
git push
```
## Using Visual Studio
Open your project in Visual Studio Code
Open the Source Control panel by clicking the Git icon on the left sidebar (or pressing Ctrl+Shift+G).
- Hover over the files you modified and click the + icon, or
- Click + next to Changes to stage all files.
Write a commit message in the text box at the top of the Source Control panel describing your changes.
Click the checkmark icon to commit the staged changes.
- Click the three dots ... at the top of the Source Control panel and select Push, or
- Click the upward arrow icon if it appears near the bottom left corner.
# On DCIDE Controller
Source: https://docs.directenergypartners.com/custom-applications/application/run/controller
Once you have tested your custom application locally, you can deploy it to the DCIDE Controller. The application should be
placed in the `/opt/plcnext/appshome/data` folder on the controller. There are two ways to get the `dep-ppl-app` repository
with the application onto the controller.
## Transfer the Application
Clone the repository directly on the controller using Git. The benefit of this approach is that any changes you make
to the repository can be pulled directly onto the controller using `git pull`.
The controller needs access to the internet for this option.
Open a terminal and connect to the controller via SSH:
```bash theme={null}
ssh admin@
```
Navigate to the application data folder:
```bash theme={null}
cd /opt/plcnext/appshome/data
```
Clone your forked `dep-ppl-app` repository:
```bash theme={null}
git clone https://github.com//dep-ppl-app.git
```
Whenever you push changes to your repository, you can pull them onto the controller:
```bash theme={null}
cd /opt/plcnext/appshome/data/dep-ppl-app
git pull
```
Use **FileZilla** to copy the entire `dep-ppl-app` repository folder to the controller.
Open FileZilla (or another SFTP client) on your local machine.
Connect to the controller using:
- Host: `controller_ip`
- Username: `admin`
- Password: `admin password`
- Port: `22`
- Navigate on the controller side to: `/opt/plcnext/appshome/data`
- Navigate on your local machine side to the folder containing the `dep-ppl-app` repository.
Drag and drop the `dep-ppl-app` folder from your local machine to the controller folder.
Verify the file transfer was successful.
## Install and Run the Application
Once the repository is on the controller, follow these steps to install and run the application.
SSH into the controller and navigate to the repository folder:
```bash theme={null}
cd /opt/plcnext/appshome/data/dep-ppl-app
```
Run the installation script. This will create a Python virtual environment, install all dependencies from
`requirements.txt`, and set up a cronjob that automatically starts the application when the controller reboots.
```bash theme={null}
bash install.sh
```
Manually start the application by running:
```bash theme={null}
bash start.sh
```
To stop the application at any time, run:
```bash theme={null}
bash stop.sh
```
After running `bash install.sh`, the application will automatically start on every reboot of the controller thanks to
the cronjob. You can always manually start or stop the application using `bash start.sh` and `bash stop.sh`.
# On Local Machine
Source: https://docs.directenergypartners.com/custom-applications/application/run/local
The custom application can be run on various platforms, including your local machine (laptop or desktop), external devices
such as a Raspberry Pi, or a virtual machine. It can also be executed directly on the DCIDE Controller. This guide provides
instructions on running the application on your local machine.
It is recommended to run your custom application on a local machine first. This approach allows you to test and
troubleshoot the newly developed application. Once testing is complete, the application can then be transferred to the
DCIDE Controller for execution.
Follow the steps below to run the custom application on your local machine. The instructions assume that a code editor
is open and the `dep-ppl-app` repository is loaded.
Open the `app/main.py` file in the repository and implement your custom application logic. This is the main entry
point for your application. See the [Main Script](/custom-applications/application/write/boilerplate) section
for more details on how to structure your code.
Open the `.env` file in the root of the repository and update the following values:
* **IP\_ADDRESS** — the IP address of the controller.
* **NATS\_USERNAME** — the username for the NATS client connection.
* **NATS\_PASSWORD** — the password for the NATS client connection.
The username and password for the NATS connection should match the credentials specified in the `config.json`
file on the controller under the **nats local** section.
Make sure all required Python dependencies are installed. Open a terminal in the repository folder and run:
```bash theme={null}
pip install -r requirements.txt
```
Open a terminal in the repository folder and run the application with:
```bash theme={null}
python -m app
```
This will start the main Python application defined in the `app` folder.
# Main Script
Source: https://docs.directenergypartners.com/custom-applications/application/write/boilerplate
The main entry point for your custom application is the `app/main.py` file inside the `dep-ppl-app` repository. This
script handles the NATS connection to the DCIDE Controller, sets up logging, and runs a continuous control loop where you
implement your custom logic.
You should edit this file directly to build your application. As your application grows, you can create additional modules
and a full folder structure inside the `app` folder to organize your code.
### The Main Script
Below is the default `main.py` script included in the repository:
```python app/main.py icon="python" theme={null}
"""
Main entry point for the app.
"""
import logging
import os
import sys
import time
from dotenv import load_dotenv
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from pplapp import Pplapp
# -- Configuration ------------------------------------------------------------
STARTUP_DELAY_S = 5
CONTROL_LOOP_INTERVAL_S = 5
# -- Logging ------------------------------------------------------------------
log = logging.getLogger("app")
log.setLevel(logging.INFO)
formatter = logging.Formatter(
fmt="[%(asctime)s] %(levelname)s %(name)s %(message)s",
datefmt="%d.%m.%Y %H:%M:%S",
)
_project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
fileHandler = logging.FileHandler(os.path.join(_project_root, "app.log"))
fileHandler.setFormatter(formatter)
log.addHandler(fileHandler)
consoleHandler = logging.StreamHandler()
consoleHandler.setFormatter(formatter)
log.addHandler(consoleHandler)
# -- Main Application Logic ---------------------------------------------------
def ems(app):
# TODO: Implement energy management system logic
pass
def main() -> None:
load_dotenv()
ipAddress = os.getenv("IP_ADDRESS")
username = os.getenv("NATS_USERNAME")
password = os.getenv("NATS_PASSWORD")
if not ipAddress or not username or not password:
log.error("IP_ADDRESS, NATS_USERNAME, and NATS_PASSWORD must be set in .env")
sys.exit(1)
log.info("Connecting to DCIDE Controller at %s", ipAddress)
app = Pplapp(ipAddress, username, password)
time.sleep(STARTUP_DELAY_S)
try:
while True:
try:
ems(app)
except Exception as e:
log.exception("Error in control loop: %s", e)
time.sleep(CONTROL_LOOP_INTERVAL_S)
except KeyboardInterrupt:
log.info("Shutdown requested")
app.stop()
log.info("Clean shutdown complete")
if __name__ == "__main__":
main()
```
### How It Works
The script does the following:
* **Loads environment variables** from the `.env` file (`IP_ADDRESS`, `NATS_USERNAME`, `NATS_PASSWORD`).
* **Sets up logging** to both the console and a file (`app.log` in the project root).
* **Connects to the controller** using the `pplapp` module.
* **Runs a continuous control loop** that calls the `ems()` function at a configurable interval.
* **Handles errors gracefully** — exceptions in the loop are logged without crashing the application, and a keyboard interrupt triggers a clean shutdown.
The `ems()` function is where you implement your custom logic. The `app` parameter gives you access to all `pplapp`
module functions for reading data from and sending commands to the controller.
### Extending Your Application
The `app` folder is your workspace. As your application grows beyond a single file, you can create a full folder structure
inside it. For example:
```example App Folder Structure theme={null}
app/
├── __main__.py # Allows running the app with python -m app
├── main.py # Main entry point – edit this to implement your application
├── helpers/
│ ├── __init__.py
│ └── calculations.py
└── strategies/
├── __init__.py
└── peak_shaving.py
```
Import your modules in `main.py` and call them from the `ems()` function. This keeps your code modular and maintainable.
# Integrations
Source: https://docs.directenergypartners.com/custom-applications/application/write/integrations
By exposing the NATS interface, Direct Energy Partners allows third-party applications to interact seamlessly with the
DCIDE Controller. This capability supports the development of custom applications such as:
* **Energy Management Systems (EMS)**: Optimize energy distribution based on real-time data.
* **Monitoring Tools**: Provide detailed analytics and reporting on power and energy usage.
* **Automation Systems**: Automate responses to specific power or energy usage events, like activating backup generators during peak times.
# Module Functions
Source: https://docs.directenergypartners.com/custom-applications/application/write/module-functions
The `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.
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.
```python icon="python" theme={null}
measurements = app.getAllMeasurements()
# Example:
measurements = {
"converter1": {
"measure.ports.port1.voltage": "480",
"measure.ports.port2.voltage": "351",
"measure.ports.port3.voltage": "415"
},
"battery1": {
"measure.ports.port1.voltage": "415",
"measure.ports.port1.current": "10",
"measure.ports.port1.power": "4150"
}
}
```
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.
```python icon="python" theme={null}
measurement = app.getMeasurements(deviceId, registerName)
# Example 1:
methodPort2 = app.getMeasurements("converter1", "measure.ports.port2.method")
# Example 2:
voltagePort2 = app.getMeasurements("converter1", "measure.ports.port2.voltage")
```
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.
```python icon="python" theme={null}
app.setCommands(deviceId, commands)
# Example 1:
app.setCommands("converter1", {"control.ports.port2.voltage": 350})
# Example 2:
app.setCommands("converter1", {
"control.ports.port3.method": "constant-power",
"control.ports.port3.power": 5000,
}
)
```
# Target SOC
Source: https://docs.directenergypartners.com/custom-applications/examples/target-soc
The code below describes an application to manage the state of charge of a battery system. It continuously checks the
battery's SOC and adjusts the power setpoint to charge or discharge the battery towards a target SOC, constrained by
predefined minimum and maximum SOC levels. The power setpoint is limited by the maximum import/export capabilities of
the converter and the charge/discharge limits of the battery. Commands are then sent to the converter to adjust its
power output accordingly. The script runs in an infinite loop with a specified delay between each iteration, and it
handles exceptions and graceful shutdown on user interruption.
```python target-soc.py icon="python" theme={null}
"""
Main entry point for the target SOC application.
"""
import logging
import os
import sys
import time
from dotenv import load_dotenv
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from pplapp import Pplapp
# -- Configuration ------------------------------------------------------------
STARTUP_DELAY_S = 5
CONTROL_LOOP_INTERVAL_S = 5
POWER = 10000
MINSOC = 20
MAXSOC = 90
TARGETSOC = 75
BATTERY_ID = "battery1"
CONVERTER_ID = "converter1"
# -- Logging ------------------------------------------------------------------
log = logging.getLogger("app")
log.setLevel(logging.INFO)
formatter = logging.Formatter(
fmt="[%(asctime)s] %(levelname)s %(name)s %(message)s",
datefmt="%d.%m.%Y %H:%M:%S",
)
_project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
fileHandler = logging.FileHandler(os.path.join(_project_root, "app.log"))
fileHandler.setFormatter(formatter)
log.addHandler(fileHandler)
consoleHandler = logging.StreamHandler()
consoleHandler.setFormatter(formatter)
log.addHandler(consoleHandler)
# -- Helper Functions ----------------------------------------------------------
def limit(setpoint, minimum, maximum):
return max(min(setpoint, maximum), minimum)
def setPower(app, powerSetpoint):
commands = {
"control.ports.port2.method": "constant-power",
"control.ports.port2.power": str(powerSetpoint)
}
app.setCommands(CONVERTER_ID, commands)
def disableBatteryPort(app):
commands = {
"control.ports.port2.method": "disabled",
"control.ports.port2.power": str(0)
}
app.setCommands(CONVERTER_ID, commands)
# -- Main Application Logic ---------------------------------------------------
def ems(app):
# Check if target SOC is within limits
targetSoc = limit(TARGETSOC, MINSOC, MAXSOC)
# Battery reported State of Charge
soc = int(float(app.getMeasurements(BATTERY_ID, "measure.ports.port1.soc")))
if soc < targetSoc:
powerSetpoint = -POWER # Charge the battery, need to set negative power setpoint to converter port
elif soc > targetSoc:
powerSetpoint = POWER # Discharge the battery, need to set positive power setpoint to converter port
else:
powerSetpoint = 0
# Check if power setpoint is within limits of the converter
converterImportPowerMax = int(app.getMeasurements(CONVERTER_ID, "measure.ports.port2.power.import.max"))
converterExportPowerMax = int(app.getMeasurements(CONVERTER_ID, "measure.ports.port2.power.export.max"))
powerSetpoint = limit(powerSetpoint, converterExportPowerMax, converterImportPowerMax)
# Check if power setpoint is within limits of the battery
batteryChargePowerMax = int(app.getMeasurements(BATTERY_ID, "measure.ports.port1.power.charge.max"))
batteryDischargePowerMax = int(app.getMeasurements(BATTERY_ID, "measure.ports.port1.power.discharge.max"))
powerSetpoint = limit(powerSetpoint, -batteryChargePowerMax, batteryDischargePowerMax)
setPower(app, powerSetpoint)
log.info("Battery SOC: %s%% - Target SOC: %s%%", soc, targetSoc)
log.info("Power Setpoint: %sW", powerSetpoint)
def main() -> None:
load_dotenv()
ipAddress = os.getenv("IP_ADDRESS")
username = os.getenv("NATS_USERNAME")
password = os.getenv("NATS_PASSWORD")
if not ipAddress or not username or not password:
log.error("IP_ADDRESS, NATS_USERNAME, and NATS_PASSWORD must be set in .env")
sys.exit(1)
log.info("Connecting to DCIDE Controller at %s", ipAddress)
app = Pplapp(ipAddress, username, password)
time.sleep(STARTUP_DELAY_S)
try:
while True:
try:
ems(app)
except Exception as e:
log.exception("Error in control loop: %s", e)
time.sleep(CONTROL_LOOP_INTERVAL_S)
except KeyboardInterrupt:
log.info("Shutdown requested")
disableBatteryPort(app)
time.sleep(CONTROL_LOOP_INTERVAL_S)
app.stop()
log.info("Clean shutdown complete")
if __name__ == "__main__":
main()
```
# Introduction
Source: https://docs.directenergypartners.com/custom-applications/index
Direct Energy Partners allows customers to develop their own applications for microgrids. By creating an **Energy Management System (EMS)** or **Power Management System (PMS)**,
customers can customize solutions to fit their specific energy needs. This guide details the process of developing custom applications using the **NATS** protocol to interact with the DCIDE Controller.
To assist customers in starting their application development, we have created a starter repository called `dep-ppl-app`.
This repository includes all the necessary files and examples to help you get started. Below, you will find detailed instructions on how to fork, clone and modify the files in the repository,
as well as how to run the application and write custom code using the built-in functions.
This is a live document and is updated regularly. For the latest version, always refer to the online documentation.
# What is NATS?
Source: https://docs.directenergypartners.com/custom-applications/nats
First of all, a brief explanation on what **NATS** is. NATS (Neural Autonomic Transport System) is an open-source messaging system
ideal for cloud-native applications, IoT messaging, and microservices architectures. It offers:
* **High Performance**: Handles millions of messages per second.
* **Low Latency**: Delivers sub-millisecond latency.
* **Scalability**: Scales effortlessly to millions of connections.
* **Simple API**: Features a straightforward, easy-to-use API.
* **Lightweight**: Utilizes minimal system resources.
### NATS in DCIDE Controller Application
Direct Energy Partners employs NATS for two-way communication between its controller and external applications.
This setup allows applications like PMS to monitor and control power and energy resources efficiently.
### Communication Patterns
1. **Publish/Subscribe**: External applications subscribe to topics for updates like real-time energy consumption data or alerts.
2. **Request/Reply**: Applications send requests to the controller for actions (e.g., adjusting power settings) and receive immediate responses.
# Clone Repository
Source: https://docs.directenergypartners.com/custom-applications/repository/clone
Now you can clone your forked repository to your computer so you can work on it.
## Clone Your Fork Locally
You need **Git** to clone and manage repositories locally. If you don't have it installed, follow the steps below to install it.
* **Windows:** Download and install Git from [https://git-scm.com/download/win](https://git-scm.com/download/win)
* **Mac:** Download and install Git from [https://git-scm.com/download/mac](https://git-scm.com/download/mac)
* **Linux:** Install Git via your package manager, for example:
```bash theme={null}
sudo apt install git # Debian/Ubuntu
sudo yum install git # RedHat/CentOS
```
Open your forked repository on GitHub (it will be under your account).
Click the green Code button and copy the URL (choose HTTPS).
Open your code editor (Visual Studio, Windsurf, or any IDE that supports Git).
Open a terminal on your local machine.
Run the following command, replacing the URL with your fork’s URL:
```bash theme={null}
git clone https://github.com/YOUR_USERNAME/dep-ppl-app.git
```
Make sure to replace `YOUR_USERNAME` with your actual GitHub username.
```bash theme={null}
cd dep-ppl-app
```
## Open Project in Code Editor
### Visual Studio
- Open Visual Studio.
- Click Open a project or solution.
- Navigate to the cloned **dep-ppl-app** folder and open it.
### Windsurf
- Open Windsurf.
- Click Open Project and select the cloned **dep-ppl-app** folder.
You are now ready to start developing your custom application. Please refer to the next section for more information.
# Fork Repository
Source: https://docs.directenergypartners.com/custom-applications/repository/fork
This section explains how to fork the `dep-ppl-app` repository and start working on it locally using a code editor
like **Visual Studio** or **Windsurf**. Follow each step carefully.
## Create a GitHub Account
Before you can fork a repository, you need a GitHub account. If you don't have one, follow the steps below to create one.
Click **Sign up** in the top-right corner.
Follow the instructions to create your account (choose a username, email, and password).
Verify your email address.
## Fork the Repository
Forking a repository creates your own copy of it in your GitHub account.
Click the **Fork** button in the top-right corner of the page.
Choose your GitHub account as the destination for the fork.
Wait a few seconds. GitHub will create a copy of the repository under your account.
You now have your own copy of `dep-ppl-app` where you can make changes freely. Next step is to clone your forked repository to your local machine.
# Introduction
Source: https://docs.directenergypartners.com/custom-applications/repository/index
Direct Energy Partners has created a repository that allows customers to develop their own applications, called **[dep-ppl-app](https://github.com/Direct-Energy-Partners/dep-ppl-app)**.
This repository contains all the necessary files and examples to help you get started.
The `dep-ppl-app` repository includes:
* The `app` folder containing `main.py` — the main entry point for your custom application.
* The `pplapp` module.
* Bash scripts: `install.sh`, `start.sh`, and `stop.sh` for managing the application.
* A `requirements.txt` file listing all Python dependencies.
* A `.env` file that stores the username and password for the NATS client connection.
* Example application scripts.
Below, you will find detailed instructions on how to fork, clone and modify the files in the `dep-ppl-app` repository,
install the Python libraries and how to run your applications. Additionally, the instructions include guidance
on writing your own applications using the `pplapp` module and its built-in functions.
GitHub will help you safely track and save your changes as you work.
# Introduction
Source: https://docs.directenergypartners.com/installation/index
This guide walks you through the key steps for powering up, configuring, and connecting your DCIDE Controller so it integrates seamlessly into your local
network. You’ll learn how to start the controller, adjust its network settings, update the default credentials, and install the applications you need. The guide also
covers setting up remote support access to keep your system connected and manageable.
Each section is designed to be clear and practical, ensuring a smooth setup experience from start to finish. Whether you’re working with the standalone or panel
version of the DCIDE Controller, you’ll find all the essential instructions here to get your system up and running with confidence.
This is a live document and is updated regularly. For the latest version, always refer to the online documentation.
# Power Supply
Source: https://docs.directenergypartners.com/installation/power/power-supply
The first step in commissioning the DEP DCIDE Controller is to provide it with the necessary power supply. Depending on the version of your
controller, the power-up process may vary slightly. Here, we outline the steps for each version to ensure proper power connection.
### DCIDE Controller
Connect the controller directly to a 24V DC power supply.
### DCIDE Controller Panel
The DCIDE Controller panel is equipped with two built-in Meanwell 24V DC power supplies for redundancy. This ensures that if one power supply fails,
the control panel will continue to operate using the other power supply. Additionally, the panel includes a UPS battery to provide backup power during a complete power outage.
To ensure proper operation and redundancy, follow these steps:
Connect two different voltage sources to the two Meanwell power supplies. Both power supplies can be found in the top left corner inside the DCIDE Controller panel.
For optimal redundancy, connect one AC voltage source and one DC voltage source to the Meanwell 24V DC power units.
Ensure the input voltage is within the following limits for the Meanwell WDR-480-24 power supplies:
* **AC Input:** 180 – 550VAC
* **DC Input:** 254 – 780VDC
# App Installation
Source: https://docs.directenergypartners.com/installation/settings/app
To install all the required apps, such as the DCIDE Controller App and the Mosquitto Broker, follow the steps below.
A Phoenix Contact SD card (8GB, 16GB, or 32GB) is required to install the DCIDE Controller App and the Mosquitto MQTT Broker on the controller.
## Install App
Login to the Web-Based Management (WBM) interface of the DCIDE Controller.
Navigate to the **System** tab in the left navigation plane and select **App Management**.
Click **Install A PLCnext Technology App** and upload the application you want to install on the DCIDE Controller. The file must have a `.app` extension.
Click on the **Start** button to start the application.
Repeat steps 3 and 4 for each app you want to install on the DCIDE Controller.
## Required Apps
There are a few apps that are required to be installed on the DCIDE Controller to ensure proper operation. These apps are the **DCIDE Controller App**
and the **Mosquitto MQTT Broker**.
Download the apps from the [PLCnext App Store](https://www.plcnextstore.com) or click on the links below.
### DCIDE Controller App
This application is the runtime developed by Direct Energy Partners. It is required for the controller to interface with all microgrid devices.
Download the DCIDE Controller App from the PLCnext Store.
Make sure to download the latest version 1.1.1 of the DCIDE Controller App.
### Mosquitto MQTT Broker
This application is required to connect MQTT devices to the controller. It runs an MQTT broker directly on the controller, enabling communication with MQTT
devices in the microgrid.
Download the Mosquitto MQTT Broker from the PLCnext Store.
Make sure to download version 2.0.18.4 of the Mosquitto MQTT Broker.
# Credentials
Source: https://docs.directenergypartners.com/installation/settings/credentials
### Change Admin Password
It is highly recommended to change the default password for the admin user. This enhances security by ensuring the
controller is protected with a password of your choice.
To change the admin user password, follow these steps:
Login to the Web-Based Management (WBM) interface of the DCIDE Controller.
Navigate to the **Security** tab in the left navigation plane and select **User Management**.
For the admin user, click on the pencil icon next to the user name to edit.
Type in the new password for the admin user and confirm.
Press the **Set Password** button to save the new password.
# License
Source: https://docs.directenergypartners.com/installation/settings/license
The license is a critical component of the DEP DCIDE Controller. Without a valid license, the platform runtime will not start.
Therefore, it is essential to ensure a valid license is in place before launching the runtime.
## Request License
If you do not have a license, or if your current license is about to expire, contact the Power Platform support team to request a license.
An expired license will cause the DCIDE Controller to shut down, leaving the system unusable and uncontrollable.
To avoid downtime, ensure that your license is renewed before it expires.
When requesting a license, you will need to provide the controller **UUID**.
This ensures that the generated license is securely tied to your specific controller and cannot be used on any other device.
### Retrieve Controller UUID
Login to the Web-Based Management (WBM) interface of the DCIDE Controller.
Navigate to the **Configuration** tab in the left navigation plane and select **PLCnext Store**.
Copy the controller **UUID** from the PLCnext Store page, under System Information.
For license requests or updates, please reach out to the support team at [pplsupport@directenergypartners.com](mailto:pplsupport@directenergypartners.com).
Make sure to include the controller **UUID** in your request.
## Upload License File
Once you have obtained a valid license, it must be uploaded to the DCIDE Controller to enable the runtime.
The license file is named **license.txt** and must be placed in the following directory on the controller:
```bash theme={null}
/opt/plcnext/appshome/data/60002172000969
```
There are multiple ways to upload the license file:
### Using SCP (Secure Copy)
Open a terminal on your local machine.
Use the scp command to copy the license file to the controller:
```bash theme={null}
scp /path/to/license.txt admin@:/opt/plcnext/appshome/data/60002172000969/
```
- Replace **/path/to/license.txt** with the path to your local license file.
- Replace **controller\_ip** with the IP address of your controller.
- Enter the admin password when prompted.
Verify the file has been uploaded by connecting to the controller via SSH and running:
```bash theme={null}
ls -l /opt/plcnext/appshome/data/60002172000969
```
### Using FileZilla
Open FileZilla (or another SFTP client) on your local machine.
Connect to the controller using:
- Host: `controller_ip`
- Username: `admin`
- Password: `admin password`
- Port: `22`
- Navigate on the controller side to: `/opt/plcnext/appshome/data/60002172000969`
- Navigate on your local machine side to the folder containing license.txt.
Drag and drop **license.txt** from your local machine to the controller folder.
Verify the file transfer was successful.
### Other Methods
Any method that allows transferring files over SSH or SFTP (e.g., WinSCP, rsync) can be used, as long as the license ends up in:
`/opt/plcnext/appshome/data/60002172000969`.
## Reboot Controller
After uploading the license, reboot the DCIDE Controller to ensure the new license is applied.
### Through WBM
Login to the Web-Based Management (WBM) interface of the DCIDE Controller.
Navigate to the **System** tab in the left navigation plane and select **Device Maintenance**.
Click on **Restart The Device** to reboot the controller.
### Through Shell Session
Open a terminal on your local machine and connect to the controller using SSH:
```bash theme={null}
ssh admin@
```
Enter the admin password when prompted.
```bash theme={null}
sudo reboot
```
## Verifying the License
After uploading and rebooting the controller, you should verify that the license file has been correctly recognized.
Connect to the controller via SSH through the terminal on your local machine:
```bash theme={null}
ssh admin@
```
```bash theme={null}
cd /opt/plcnext/appshome/data/60002172000969/log
```
Open the license.log file to check for the license status:
```bash theme={null}
nano license.log
```
If the license is valid, the log should contain a message indicating that the license is valid and successfully loaded.
If the log reports an error (e.g., license expired, invalid, or missing), double-check that the file is in the correct location and named license.txt, then reboot the controller again.
If the error persists, contact the support team at [pplsupport@directenergypartners.com](mailto:pplsupport@directenergypartners.com) and provide the **license.log** file for further assistance.
# Login
Source: https://docs.directenergypartners.com/installation/settings/login
This section explains how to log in to the controller’s Web-Based Management (WBM) interface. From the WBM, you can configure network settings, update admin credentials,
and install the required applications. Follow the steps below to get started.
### Connect Laptop
Use an Ethernet cable to connect your laptop directly to the DCIDE Controller. The connection method varies depending on your DCIDE Controller version:
* **DCIDE Controller:** Connect your laptop directly to the DCIDE Controller using any of the two Ethernet ports located at the bottom of the controller.
* **DCIDE Controller Panel:** Connect your laptop to the Ethernet connection port at the bottom of the panel. This port is directly connected to the network switch inside the DCIDE Controller panel.
### Setup Laptop
Set your laptop to the same IP range as the DCIDE Controller. This is required to access the DCIDE Controller's Web-Based Management (WBM) interface.
The default IP address of the DCIDE Controller is `192.168.1.10`.
Temporarily change your laptop's IP settings to be in the same range as the controller’s IP address. To do this, open the network settings on your
laptop and either change or add a new static IP address, subnet mask, and gateway. For example:
* **IP address:** `192.168.1.5`
* **Subnet mask:** `255.255.255.0`
* **Default gateway:** `192.168.1.1`
Below is explained how to change or add the network settings for Windows and Mac.
Right-click on the desired network connection and select **Properties**.
In the pop-up window, select **Internet Protocol Version 4 (TCP/IPv4)** and click on **Properties**.
In the next window, add the **IP address** with the **subnet mask** and add a **default gateway** as stated above.
After adding the IP address with the subnet mask and the default gateway, click **OK** to save the settings.
Click on the **Apple** menu in the top-left corner of your screen.
Select **System Settings** from the drop-down menu.
In the **System Settings** window, scroll down and click on **Network** in the sidebar.
On the right side, you will see a list of network interfaces (such as Wi-Fi, Ethernet, etc.).
Select the interface you want to configure (e.g., **Wi-Fi** or **Ethernet**).
After selecting the network interface, click on the **Details...** button.
* If you are using macOS Ventura or later: After selecting the network interface, you will see a list of available networks. Scroll down and select **TCP/IP**.
* In the **Configure IPv4** drop-down menu, select **Manually**.
* Add the **IP address,** **subnet mask** and **default gateway** as stated above.
Once all the details have been entered, click **OK** to save the settings.
### Login to the WBM
Open a web browser and enter `192.168.1.10/wbm` or click on this [link](https://192.168.1.10/wbm).
If prompted with a security warning stating ‘**Your connection is not private**’, click on **Advanced** and then click on **Proceed to 192.168.1.10 (unsafe)**.
Log in using the credentials provided to you by DEP:
* Username: `admin`
* Password: `[printed on the housing of the controller]`
# Network
Source: https://docs.directenergypartners.com/installation/settings/network
To integrate the DCIDE Controller into your local network, you need to change its default IP address to a static IP address on your network,
as well as modify the controller’s subnet mask and default gateway. This section provides detailed instructions on how to configure the network settings
of the controller using the Web-Based Management (WBM) interface.
To change the network settings of the DCIDE Controller, follow the steps below:
### Change Network Settings
Login to the Web-Based Management (WBM) interface of the DCIDE Controller.
Navigate to the **Configuration** tab in the left navigation plane and select **Network**.
Update the IP address, subnet mask, and default gateway to match your local network. **For example:**
* IP address: `172.200.1.120`
* Subnet mask: `255.255.255.0`
* Default gateway: `172.200.1.1`
Click **Save Page & Restart**. The controller will reboot with the new settings and become visible on your local network with the newly set IP address.
# Firmware Update
Source: https://docs.directenergypartners.com/installation/settings/update
The controller should have the latest firmware, version **2025.0**, running. This section will guide you on checking the
current firmware version and upgrading to the 2025.0 version if needed.
## Check Firmware Version
Login to the Web-Based Management (WBM) interface of the DCIDE Controller.
Navigate to the **Device** tab in the left navigation plane and select **General Data**.
Check the current firmware version and upgrade to the 2025.0 version if needed.
## Upgrade Firmware
There are two possible ways to upgrade the firmware of the DCIDE Controller. One way is to use the **Web-Based Management (WBM)** interface and the other way is to use
a **Shell session**. Regardless of the two options to update the firmware version of the controller, you first need to download the firmware from the Phoenix Contact website. For that:
Download the firmware from the Phoenix Contact website.
* Under Firmware, open the Version 2025.0 plane and click on `AXC_F_2152_FW_2025_0.zip` to start the download.
* Extract the ZIP file on your local computer.
### Through WBM (recommended)
Navigate to the **System** tab in the left navigation plane and select **Update**.
For the Firmware, click on the **Update** button.
Click the **Prepare and Stop** button. This will stop the application and allows you to upgrade the firmware safely.
Click on **Select File** and upload the `.raucb` file from the extracted ZIP folder.
Click on **Start Update** to start the update process. This process can take up to 2-3 minutes. The controller will automatically reboot after the update is complete.
### Through Shell Session
Copy the `axcf2152-2025.0.3-25.0.3.99.raucb` file from the extracted ZIP archive to the controller using SCP (Secure Copy Protocol):
```bash theme={null}
scp axcf2152-2025.0.3-25.0.3.99.raucb admin@192.168.1.10:~
```
Alternatively, use an FTP (File Transfer Protocol) software such as FileZilla to copy or move the `.raucb` file to the controller.
Open a shell session:
```bash theme={null}
ssh admin@192.168.1.10
```
Enter the default password (printed on the housing of the controller).
```bash theme={null}
sudo /etc/init.d/plcnext stop
```
```bash theme={null}
rauc install axcf2152-2025.0.3-25.0.3.99.raucb
```
```bash theme={null}
sudo reboot
```
Verify in the WBM that the firmware version has been updated to version 2025.0. Please refer to previous section for more information on how to check the current firmware version.
# Remote Access
Source: https://docs.directenergypartners.com/installation/support/remote-access
Setting up access for remote support is essential, as it allows Direct Energy Partners to assist with troubleshooting and provide help
during the commissioning process. Follow the steps below to set up access for remote support using TeamViewer or Windows Quick Assist.
### TeamViewer
Open the **TeamViewer** application on your laptop. If you haven't installed TeamViewer yet, you can download it from the TeamViewer website.
Use an Ethernet cable to connect your laptop directly to the DCIDE Controller. The connection method varies depending on your DCIDE Controller version:
* **DCIDE Controller:** Connect your laptop directly to the DCIDE Controller using any of the two Ethernet ports located at the bottom of the controller.
* **DCIDE Controller Panel:** Connect your laptop to the Ethernet connection port at the bottom of the panel. This port is directly connected to the network switch inside the DCIDE Controller panel.
Locate your personal credentials in the TeamViewer application. These credentials include:
* ID: `[9-digit or 10-digit code]`
* Password: \*\*\*\*`[see TeamViewer]`
Send a request for remote support to [pplsupport@directenergypartners.com](mailto:pplsupport@directenergypartners.com) and be sure to include the credentials in the email.
### Windows Quick Assist
To use the built-in Quick Assist application on a Windows computer for remote support, follow these steps. Note that Quick Assist only works on Windows computers.
In the search bar located in the taskbar at the bottom of your screen, type **Quick Assist** and open the application.
Use an Ethernet cable to directly connect your computer to the DCIDE Controller.
Send an email to [pplsupport@directenergypartners.com](mailto:pplsupport@directenergypartners.com) requesting remote support.
The PPL support team will reply with a **6-digit** code.
Enter the provided code into the Quick Assist app and click on **Submit**. A connection will be established between your computer and the PPL support team's computer. This may take a few seconds.
Once the connection is established, the PPL support team will request remote control through the Quick Assist app. Click **Allow Control** in the top bar to grant the support team access to control your computer.
### Additional Information
In the future, other methods to set up remote access may be added. For now, the steps above outline how to set up remote support using TeamViewer and Windows Quick Assist.