dragg.devices package#

class dragg.devices.battery.Battery(hems)#

Bases: object

A class for the HVAC device in a smart home. This model uses a linear R1-C1 thermal model to determine the indoor air temperature of the home.

Source of linear model: https://hal.archives-ouvertes.fr/hal-01739625/document

add_constraints()#
resolve()#
class dragg.devices.electric_vehicle.EV(hems)#

Bases: object

add_constraints()#

Creates constraints that make the battery act as an EV with charge/discharge constraints based on occupancy and travel distance.

Returns:

None

override_charge(cmd)#
resolve()#
class dragg.devices.hvac.HVAC(hems)#

Bases: object

A class for the HVAC device in a smart home. This model uses a linear R1-C1 thermal model to determine the indoor air temperature of the home.

Source of linear model: https://hal.archives-ouvertes.fr/hal-01739625/document

add_constraints(enforce_bounds=True)#
Parameters:

enforce_bounds – boolean determines whether comfort bounds are strictly enforced

Returns:

cons, a list of CVXPY constraints

A method to introduce physical constraints to the HVAC equipment. The A/C and heat are alternately disabled by “season” to reduce on/off cycling and/or simaultaneous heating and cooling when the electricity price is negative.

override_t_in(cmd)#
Parameters:

cmd – float between [-1,1]

Returns:

none

A method for manually setting the temperature setpoint in the home. The result will set the thermal setpoint between the min and max safety bounds (unoccupied temperatures) as dictated by the normalized command.

resolve()#
Returns:

none

Re-solves only the HVAC portion of the MPC scheduling problem, since sometimes the comfort constraints are impossible to adhere to the comfort bounds are not enforced but the difference in the observed temp and the desired temp is minimized.

class dragg.devices.pv.PV(hems)#

Bases: object

A class for the HVAC device in a smart home. This model uses a linear R1-C1 thermal model to determine the indoor air temperature of the home.

Source of linear model: https://hal.archives-ouvertes.fr/hal-01739625/document

add_constraints()#
resolve()#
class dragg.devices.water_heater.WH(hems)#

Bases: object

A class for the water heater device in a smart home. This model uses a linear R1-C1 model of the water heater tank with electric resistance heating (efficiency ~=100%)

add_constraints(enforce_bounds=True)#
Parameters:

enforce_bounds – boolean determines whether comfort bounds are strictly enforced

Returns:

cons, a list of CVXPY constraints

A method to introduce physical constraints to the water heater.

override_p_wh(cmd)#
Parameters:

cmd – float in [-1,1]

Returns:

None

A method to override the current on/off status of the hot water heater. Directly controls the power consumed with a conservative check that the resulting water temperature will not exceed bounds in either direction.

resolve()#
Input:

None

Returns:

None

A method for re-solving the constraints specific to the hot water heater in the event that the whole house HEMS cannot satisfy all constraints – first attempts to minimize the device-specific electricity consumption while satisfying comfort bounds, second attempt minimizes the deviation of the new temperature and the desired setpoint.