Working with the DERS Simulator¶
There are multiple ways to work with the DER Simulator. The simplest is to run it from LabTest via the GUI. The other two options are to run it with the LabTest API or as a binary that DERSec sells separately.
Running the DER Simulator from DERSec LabTest¶
The DER Simulator can be run from the DERSec LabTest GUI. Details of this operation are in the LabTest Pro User Manual.
Scripting the DER Simulator with DERSec LabTest¶
Update the simulator parameters:
curl 'http://localhost:8555/info/der_sim' \
-H 'Accept: application/json, text/javascript, */*; q=0.01' \
-H 'Content-Type: application/json; charset=UTF-8' \
--data-raw '{"der_sim":{"num_of_devices":"1","static_sim":"no","device_type":"PV-3Phase","filename":"<<Using Default>>","mb_enable":"yes","mb_port":"502","mb_enc":"no","root-pem":"<<Using Default>>","cert-pem":"<<Using Default>>","key-pem":"<<Using Default>>","csip_enable":"no","csip_server_ip":"127.0.0.1","csip_server_port":"8443","csip_enc":"yes","csip-root-pem":"<<Using Default>>","csip-cert-pem":"<<Using Default>>","csip-key-pem":"<<Using Default>>","dnp3_enable":"no","dnp3_outstation_addr":"1234","dnp3_port":"8777","dnp3_remote_addr":"1234","ac_sim_enable":"no","dc_sim_enable":"no","pv_sim_enable":"no","das_sim_enable":"no"}}'
Start the simulator:
curl 'http://localhost:8555/sim' \
-H 'Accept: */*' \
-H 'Accept-Language: en-US,en;q=0.9' \
-H 'Content-Type: application/json; charset=UTF-8' \
--data-raw '"{\"num_of_devices\": \"1\", \"static_sim\": \"no\", \"device_type\": \"PV-3Phase\", \"filename\": \"<<Using Default>>\", \"mb_enable\": \"yes\", \"mb_port\": \"502\", \"mb_enc\": \"no\", \"root-pem\": \"<<Using Default>>\", \"cert-pem\": \"<<Using Default>>\", \"key-pem\": \"<<Using Default>>\", \"csip_enable\": \"no\", \"csip_server_ip\": \"127.0.0.1\", \"csip_server_port\": \"8443\", \"csip_enc\": \"yes\", \"csip-root-pem\": \"<<Using Default>>\", \"csip-cert-pem\": \"<<Using Default>>\", \"csip-key-pem\": \"<<Using Default>>\", \"dnp3_enable\": \"no\", \"dnp3_outstation_addr\": \"1234\", \"dnp3_port\": \"8777\", \"dnp3_remote_addr\": \"1234\", \"ac_sim_enable\": \"no\", \"dc_sim_enable\": \"no\", \"pv_sim_enable\": \"no\", \"das_sim_enable\": \"no\"}"'
Stop the simulator:
curl 'http://localhost:8555/sim' \
-X 'DELETE' \
-H 'Accept: application/json, text/javascript, */*; q=0.01'
Running the simulator as a binary¶
Sold separately, the simulator can be run as a Linux binary. The command line interface is as follows:
$ ./sim.py -h
usage: DERSec DER Simulator [-h] [-f FILENAME] [-s STATIC_SIM] [-d DEVICE_TYPE] [-N NUM_OF_DEVICES] [-fd FILENAME_DIRECTORY]
[-mb MB_ENABLE] [-p MB_PORT] [-e MB_ENC] [-mbc MB_CERT] [-mbk MB_KEY] [-mbr MB_ROOT_CERT]
[-csip_enable CSIP_CLIENT_ENABLE] [-csip_serv CSIP_SERVER_IP] [-csip_port CSIP_SERVER_PORT]
[-ce CSIP_ENC] [-cc CSIP_CERT] [-ck CSIP_KEY] [-cr CSIP_ROOT_CERT] [--use_test_pki_certs USE_TEST_PKI_CERTS]
[-d3 DNP3_ENABLE] [-d3p DNP3_PORT] [-d3o DNP3_OUTSTATION_ADDR] [-d3m DNP3_REMOTE_ADDR] [-ws WEBSOCKET_ENABLE]
[-ws_port WEBSOCKET_PORT] [-ws_ip WEBSOCKET_IP] [-m_c_p MON_CTL_WEB_PORT] [-dc_p DC_POWER_PROFILE]
[-wc WALL_CLOCK] [-wc_tz WALL_CLOCK_TIMEZONE] [-sd START_DELAY_INTERVAL] [--poll-rate POLL_RATE] [--post-rate POST_RATE]
[--compromised_behavior HACK_SCRIPT] [-start_clock_time START_CLOCK_TIME]
A static/dynamic DER simulator with different communication interfaces.
options:
-h, --help show this help message and exit
-f, --filename FILENAME
JSON file name
-s, --static STATIC_SIM
Run the simulator with fixed communication interface data (yes, no, True, or False)
-d, --device_type DEVICE_TYPE
Device Type: `PV` or `Batt`
-N, --num_of_devices NUM_OF_DEVICES
Number of simulated devices that will be created. Ports will be incremented by 1 for all subsequent devices.
-fd, --filename_directory FILENAME_DIRECTORY
A directory containing a list of num_of_devices JSON files (device_1.json, ...) used for the simulation
-mb, --mb_enable MB_ENABLE
Create DER Modbus Server (yes or no)
-p, --mb_port MB_PORT
Modbus Server Port
-e, --mb_enc MB_ENC Encrypt Modbus? (yes or no)
-mbc, --mb_cert MB_CERT
Modbus Client Cert File
-mbk, --mb_key MB_KEY
Modbus Client Cert File
-mbr, --mb_root_cert MB_ROOT_CERT
Modbus Client Cert File
-csip_enable, --csip_client_enable CSIP_CLIENT_ENABLE
Create IEEE 20203.5 Client (yes or no)
-csip_serv, --csip_server_ip CSIP_SERVER_IP
IEEE 2030.5 Server IP
-csip_port, --csip_server_port CSIP_SERVER_PORT
IEEE 2030.5 Server Port
-ce, --csip_enc CSIP_ENC
Encrypt IEEE 2030.5? (yes or no)
-cc, --csip_cert CSIP_CERT
IEEE 2030.5 Client Cert File
-ck, --csip_key CSIP_KEY
IEEE 2030.5 Client Key File
-cr, --csip_root_cert CSIP_ROOT_CERT
IEEE 2030.5 CA Cert File
--use_test_pki_certs USE_TEST_PKI_CERTS
Use the test PKI certs for IEEE 2030.5, pass in the path to the certs directory
-d3, --dnp3_enable DNP3_ENABLE
Create DNP3 Outstation (yes or no)
-d3p, --dnp3_port DNP3_PORT
DNP3 Outstation Port
-d3o, --dnp3_outstation_addr DNP3_OUTSTATION_ADDR
DNP3 Outstation Address
-d3m, --dnp3_remote_addr DNP3_REMOTE_ADDR
DNP3 Remote (Master) Address
-ws, --websocket_enable WEBSOCKET_ENABLE
Enable Websocket for Visualization (yes or no)
-ws_port, --websocket_port WEBSOCKET_PORT
Websocket Visualization Port
-ws_ip, --websocket_ip WEBSOCKET_IP
Websocket Visualization IP Address
-m_c_p, --mon_ctl_web_port MON_CTL_WEB_PORT
Monitoring and Control Website Port
-dc_p, --dc_profile DC_POWER_PROFILE
Irradiance profile or EV charging profile
-wc, --wall_clock WALL_CLOCK
Use real world time as simulation time
-wc_tz, --wall_clock_timezone WALL_CLOCK_TIMEZONE
A ZoneInfo string for the timezone
-sd, --start_delay_interval START_DELAY_INTERVAL
Interval in seconds for each device to randomly start within
--poll-rate POLL_RATE
Poll rate for IEEE 2030.5 client
--post-rate POST_RATE
Post rate for IEEE 2030.5 client
--compromised_behavior HACK_SCRIPT
A script to trigger SunSpec Modbus readback modifications.
-start_clock_time, --start-clock-time START_CLOCK_TIME
Specify the start time for the simulation clock in HH:MM:SS format (e.g., 14:30:00).
(C) DERSec 2025