OpenEMS is a modular platform for energy management applications. It was developed around the requirements of controlling, monitoring and integrating energy storage systems together with renewable energy sources and further devices and services.
Note: Improvement of this documentation is currently in progress. Please find the latest draft version here: http://htmlpreview.github.io/?https://github.com/OpenEMS/openems/blob/feature/improve_doc/doc/openems.html
The OpenEMS stack contains three parts:
- OpenEMS Edge: this runs on the IoT edge device and actually controls the devices
- OpenEMS UI: the generic user interface
- OpenEMS Backend: this runs on a (cloud) server, connects the decentralized Edge systems and provides monitoring and control via internet
- Fast, PLC-like control of battery inverters and other devices
- Easily extendable due to the use of modern programming languages and modular architecture
- Wide range of supported devices - (battery) inverters, meters, etc. - and protocols
- Modern web-based real-time user interface
A number of devices, protocols and services are already implemented in OpenEMS:
- FENECON Mini 3-3 and 3-6 (testing)
- FENECON Pro 9-12
- FENECON Commercial AC
- FENECON Commercial DC
- REFU battery inverter
- Studer VS 70 (testing)
- Modbus/TCP
- Modbus/RTU
- JSON/REST
- JSON/Websocket
- Modbus/TCP
The target of this short guide is to quickly setup a development environment on your local machine. First you are going to setup OpenEMS Edge to simulate an energy storage system. The second part is setting up the OpenEMS UI.
-
Download a git client and install it.
-
Open a terminal, change to your preferred directory and clone the repository:
- On Windows: Press
Windows
+R
, entercmd
and pressEnter
. git clone https://github.com/OpenEMS/openems.git
- On Windows: Press
-
Download Eclipse for Java, install and start it
-
Install BndTools in Eclipse:
Menu:
Help
→Eclipse Marketplace...
→Find:
→ enterBndTools
→ pressInstall
-
Import OSGi projects:
Menu:
File
→Import...
→Bndtools
→Existing Bnd Workspace
→ Root directory:Browse...
→ select the directory with the source code →OK
→Finish
→ "Switch to Bndtools perspective?"yes
If Eclipse shows errors: Because of a bug in Bndtools it is necessary to manually trigger a build. Doubleclick the
cnf
project → doubleclickbuild.bnd
→ click onReload
in bottom right of the window. The errors should all disappear. -
Import Java projects:
Menu:
File
→Import...
→General
→Existing Projects into Workspace
→ "Select root directory:"Browse...
→ select the directory with the source code →Finish
-
Apply the simulator template configuration. Hint: OpenEMS is using a global JSON configuration file.
Open the
openems
project and copytemplate/Simulator.json
toetc/openems.d/config.json
-
Right click on
src/io.openems/App.java
and selectRun As...
→Java Application
. -
You should see it running in the console.
-
Download node.js LTS and install it.
-
Download Visual Studio Code, install and start it.
-
Open UI project in Visual Studio Code:
Menu:
File
→Open directory...
→ Select the "openems/ui/" directory →Select directory
-
Open the integrated terminal:
Menu:
Show
→Integrated terminal
-
Install Angular CLI:
npm install -g @angular/cli
-
Install dependencies:
npm install
-
Run OpenEMS UI:
ng serve
-
Open a browser at http://localhost:4200
The configuration of OpenEMS is placed in the json file /etc/openems.d/config.json. To parameterize a Bridge,Device,DeviceNature, Scheduler, Controller or Persistance you have to use ConfigChannels. A ConfigChannel represents one parameter the Thing needs. The value of the ConfigChannel will be automatically parsed by OpenEMS on the configuration read. Each thing will be instantiated by reflection so you have to define a "class" property, which is the qualified name of the desired class. The file is split into three sections:
things
: In the things section you need to set all devices to communicate with. Therefore you have to use a so called "Bridge". A Bridge connects several devices(Hardware) with the same protocol to openems. For example you want to read the data of a Socomec Meter and FeneconPro which are connected to the same RS485 Bus, you have to use a ModbusRtu bridge and set the Socomec Meter and FeneconPro as devices for this bridge. Each bridge/device has ConfigChannels to provide the paremters to establish the connection. The required parameters can be found in the according class. A device has DeviceNatures, where each nature requires a unique id. This id is used as reference by the controllers.scheduler
: The Scheduler executes the controllers according to the programmed behaviour. For example the SimpleScheduler orders and executes the Controller by the configured priority. Controllers are the smallest divisible logical control unit. Each Controller needs at least one device reference to do the work.persistence
:
Example configuration:
{
"things": [
{
"class": "io.openems.impl.protocol.modbus.ModbusRtu",
"serialinterface": "/dev/ttyUSB0",
"baudrate": 9600,
"databits": 8,
"parity": "none",
"stopbits": 1,
"devices": [
{
"class": "io.openems.impl.device.pro.FeneconPro",
"modbusUnitId": 4,
"ess": {
"id": "ess0",
"minSoc": 15
},
"meter": {
"id": "meter1"
}
},
{
"class": "io.openems.impl.device.socomec.Socomec",
"modbusUnitId": 5,
"meter": {
"id": "meter0",
"type": "grid"
}
}
]
}
],
"scheduler": {
"class": "io.openems.impl.scheduler.SimpleScheduler",
"controllers": [
{
"priority": 150,
"class": "io.openems.impl.controller.debuglog.DebugLogController",
"esss": [ "ess0" ],
"meters": [ "meter0", "meter1" ],
"rtc": "ess0"
},
{
"priority": 100,
"class": "io.openems.impl.controller.asymmetric.avoidtotaldischarge.AvoidTotalDischargeController",
"esss": "ess0"
},
{
"priority": 50,
"class": "io.openems.impl.controller.asymmetric.balancing.BalancingController",
"esss": "ess0",
"meter": "meter0"
},
{
"priority": 1,
"class": "io.openems.impl.controller.clocksync.ClockSyncController",
"rtc": "ess0"
},
{
"priority": 0,
"class": "io.openems.impl.controller.feneconprosetup.FeneconProSetupController",
"esss": "ess0"
}
]
},
"persistence": [
{
"class": "io.openems.impl.persistence.influxdb.InfluxdbPersistence",
"ip": "127.0.0.1",
"fems": 0
}
]
}
OpenEMS is mainly developed by FENECON GmbH in Germany. We are specialized in manufacturing and project development of energy storage systems. If you are interested in OpenEMS our development team would be glad to hear from you: fems@fenecon.de.