Using ActiveClass interfaceΒΆ

The interface described below requires the extras dependencies. Please see installation instructions.

The OpenDSSDirect.py interface may not support all classes or element by default, however you can access these values by using the class_to_dataframe interface.

An example is shown below for the Storage class.

[1]:
import opendssdirect as dss

dss.Text.Command('Redirect ../../tests/data/13Bus/IEEE13Nodeckt.dss')

dss.Circuit.AllBusNames()

dss.Text.Command(
    "New Storage.{bus_name} Bus1={bus_name} phases=1 kV=2.2 kWRated={rating} kWhRated={kwh_rating} kWhStored={initial_state} %IdlingkW=0 %reserve=0 %EffCharge=100 %EffDischarge=100 State=CHARGING".format(
        bus_name='675',
        rating=20,
        kwh_rating=20,
        initial_state=20
    ))


dss.Text.Command(
    "New Storage.{bus_name} Bus1={bus_name} phases=1 kV=2.2 kWRated={rating} kWhRated={kwh_rating} kWhStored={initial_state} %IdlingkW=0 %reserve=0 %EffCharge=100 %EffDischarge=100 State=CHARGING".format(
        bus_name='611',
        rating=20,
        kwh_rating=20,
        initial_state=20
    ))

dss.Solution.Solve()

[3]:
dss.utils.class_to_dataframe('Storage').transpose()
[3]:
Storage.675 Storage.611
phases 1 1
bus1 675 611
kv 2.2 2.2
conn wye wye
kW 0 0
kvar 0 0
pf 1 1
kVA 20 20
%Cutin 0 0
%Cutout 0 0
EffCurve
VarFollowInverter No No
kvarMax 25 25
kvarMaxAbs 25 25
WattPriority No No
PFPriority No No
%PminNoVars -1 -1
%PminkvarMax -1 -1
kWrated 20 20
%kWrated 100 100
kWhrated 20 20
kWhstored 20 20
%stored 100 100
%reserve 0 0
State Idling Idling
%Discharge 100 100
%Charge 100 100
%EffCharge 100 100
%EffDischarge 100 100
%IdlingkW 0 0
%R 0 0
%X 50 50
model 1 1
Vminpu 0.9 0.9
Vmaxpu 1.1 1.1
Balanced No No
LimitCurrent No No
yearly
daily
duty
DispMode Default Default
DischargeTrigger 0 0
ChargeTrigger 0 0
TimeChargeTrig 2 2
class 1 1
DynaDLL
DynaData
UserModel
UserData
debugtrace No No
spectrum
basefreq 60 60
enabled Yes Yes
like