First time here? Check out the Help page!
| 1 | initial version |
You should read energyplus --help. If you haven't requested native CSV output (OutputControl:Files), you should pass --readvars so it runs ReadVarsESO to produce the meter files.
-r,--readvars Run ReadVarsESO after simulation
If you want the output in the same directory as your file.idf (and not a subfolder), adjust the "-d" parameter to match.
If you want another naming convention, use --output-prefix (and maybe --output-suffix)
-p,--output-prefix PRE Prefix for output file names (default: eplus)
Example:
from pathlib import Path
import subprocess
energyplus_exe = Path("C:/EnergyPlusV9-6-0/EnergyPlus.exe")
idf_file = Path("path/to/file.idf")
epw_file = Path("path/to/weather.epw")
cmd_arg = [
str(energyplus_exe),
"--readvars",
"--expandobjects", # If you have HVACTemplate objects
"--weather", str(epw_file),
"--output-directory", str(idf_file.parent),
"--output-prefix", idf_file.stem,
"--output-suffix", "C",
str(idf_file),
]
subprocess.check_call(command)
As a side note, there is a dedicated python workflow for this: https://github.com/NREL/EnergyPlus/blob/v25.2.0/workflows/energyplus.py
energyplus --help
Usage: energyplus [OPTIONS] [input_file] [SUBCOMMAND]
Positionals:
input_file TEXT:FILE Input file (default: in.idf in current directory)
Options:
-h,--help Print this help message and exit
-v,--version Display program version information and exit
-a,--annual Excludes: --design-day
Force annual simulation
-D,--design-day Excludes: --annual
Force design-day-only simulation
-d,--output-directory DIR Output directory path (default: current directory)
-i,--idd IDD Input data dictionary path (default: Energy+.idd in executable directory)
-m,--epmacro Run EPMacro prior to simulation
-p,--output-prefix PRE Prefix for output file names (default: eplus)
-r,--readvars Run ReadVarsESO after simulation
-c,--convert Output IDF->epJSON or epJSON->IDF, dependent on input file type
--convert-only Only convert IDF->epJSON or epJSON->IDF, dependent on input file type. No simulation
-s,--output-suffix SUFFIX Suffix style for output file names (default: L)
L: Legacy (e.g., eplustbl.csv)
C: Capital (e.g., eplusTable.csv)
D: Dash (e.g., eplus-table.csv)
-j,--jobs N Multi-thread with N threads; 1 thread with no arg. (Currently only for G-Function generation)
-w,--weather EPW Weather file path (default: in.epw in current directory)
-x,--expandobjects Run ExpandObjects prior to simulation
Subcommands:
auxiliary Run Auxiliary Python Tools
Example: energyplus -w weather.epw -r input.idf