{
  "$id": "SetDERControlRequest",
  "comment": "OCPP 2.1 Edition 1 (c) OCA, Creative Commons Attribution-NoDerivatives 4.0 International Public License",
  "definitions": {
    "DERControlEnumType": {
      "description": "Type of control.  Determines which setting field below is used.\r\n\r\n",
      "javaType": "DERControlEnum",
      "type": "string",
      "additionalProperties": false,
      "enum": [
        "EnterService",
        "FreqDroop",
        "FreqWatt",
        "FixedPFAbsorb",
        "FixedPFInject",
        "FixedVar",
        "Gradients",
        "HFMustTrip",
        "HFMayTrip",
        "HVMustTrip",
        "HVMomCess",
        "HVMayTrip",
        "LimitMaxDischarge",
        "LFMustTrip",
        "LVMustTrip",
        "LVMomCess",
        "LVMayTrip",
        "PowerMonitoringMustTrip",
        "VoltVar",
        "VoltWatt",
        "WattPF",
        "WattVar"
      ],
      "tsEnumNames": [
        "EnterService",
        "FreqDroop",
        "FreqWatt",
        "FixedPFAbsorb",
        "FixedPFInject",
        "FixedVar",
        "Gradients",
        "HFMustTrip",
        "HFMayTrip",
        "HVMustTrip",
        "HVMomCess",
        "HVMayTrip",
        "LimitMaxDischarge",
        "LFMustTrip",
        "LVMustTrip",
        "LVMomCess",
        "LVMayTrip",
        "PowerMonitoringMustTrip",
        "VoltVar",
        "VoltWatt",
        "WattPF",
        "WattVar"
      ]
    },
    "DERUnitEnumType": {
      "description": "Unit of the setpoint.\r\n",
      "javaType": "DERUnitEnum",
      "type": "string",
      "additionalProperties": false,
      "enum": [
        "Not_Applicable",
        "PctMaxW",
        "PctMaxVar",
        "PctWAvail",
        "PctVarAvail",
        "PctEffectiveV"
      ],
      "tsEnumNames": [
        "Not_Applicable",
        "PctMaxW",
        "PctMaxVar",
        "PctWAvail",
        "PctVarAvail",
        "PctEffectiveV"
      ]
    },
    "PowerDuringCessationEnumType": {
      "description": "Parameter is only sent, if the EV has to feed-in power or reactive power during fault-ride through (FRT) as defined by HVMomCess curve and LVMomCess curve.\r\n\r\n\r\n",
      "javaType": "PowerDuringCessationEnum",
      "type": "string",
      "additionalProperties": false,
      "enum": ["Active", "Reactive"],
      "tsEnumNames": ["Active", "Reactive"]
    },
    "DERCurvePointsType": {
      "javaType": "DERCurvePoints",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "x": {
          "description": "The data value of the X-axis (independent) variable, depending on the curve type.\r\n\r\n\r\n",
          "type": "number"
        },
        "y": {
          "description": "The data value of the Y-axis (dependent) variable, depending on the  &lt;&lt;cmn_derunitenumtype&gt;&gt; of the curve. If _y_ is power factor, then a positive value means DER is absorbing reactive power (under-excited), a negative value when DER is injecting reactive power (over-excited).\r\n\r\n",
          "type": "number"
        },
        "customData": {
          "$ref": "#/definitions/CustomDataType"
        }
      },
      "required": ["x", "y"]
    },
    "DERCurveType": {
      "javaType": "DERCurve",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "curveData": {
          "type": "array",
          "additionalItems": false,
          "items": {
            "$ref": "#/definitions/DERCurvePointsType"
          },
          "minItems": 1,
          "maxItems": 10
        },
        "hysteresis": {
          "$ref": "#/definitions/HysteresisType"
        },
        "priority": {
          "description": "Priority of curve (0=highest)\r\n\r\n\r\n",
          "type": "integer",
          "minimum": 0
        },
        "reactivePowerParams": {
          "$ref": "#/definitions/ReactivePowerParamsType"
        },
        "voltageParams": {
          "$ref": "#/definitions/VoltageParamsType"
        },
        "yUnit": {
          "$ref": "#/definitions/DERUnitEnumType"
        },
        "responseTime": {
          "description": "Open loop response time, the time to ramp up to 90% of the new target in response to the change in voltage, in seconds. A value of 0 is used to mean no limit. When not present, the device should follow its default behavior.\r\n\r\n\r\n",
          "type": "number"
        },
        "startTime": {
          "description": "Point in time when this curve will become activated. Only absent when _default_ is true.\r\n\r\n",
          "type": "string",
          "format": "date-time"
        },
        "duration": {
          "description": "Duration in seconds that this curve will be active. Only absent when _default_ is true.\r\n\r\n\r\n",
          "type": "number"
        },
        "customData": {
          "$ref": "#/definitions/CustomDataType"
        }
      },
      "required": ["priority", "yUnit", "curveData"]
    },
    "EnterServiceType": {
      "javaType": "EnterService",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "priority": {
          "description": "Priority of setting (0=highest)\r\n\r\n",
          "type": "integer",
          "minimum": 0
        },
        "highVoltage": {
          "description": "Enter service voltage high\r\n",
          "type": "number"
        },
        "lowVoltage": {
          "description": "Enter service voltage low\r\n\r\n\r\n",
          "type": "number"
        },
        "highFreq": {
          "description": "Enter service frequency high\r\n\r\n",
          "type": "number"
        },
        "lowFreq": {
          "description": "Enter service frequency low\r\n\r\n\r\n",
          "type": "number"
        },
        "delay": {
          "description": "Enter service delay\r\n\r\n\r\n",
          "type": "number"
        },
        "randomDelay": {
          "description": "Enter service randomized delay\r\n\r\n\r\n",
          "type": "number"
        },
        "rampRate": {
          "description": "Enter service ramp rate in seconds\r\n\r\n\r\n",
          "type": "number"
        },
        "customData": {
          "$ref": "#/definitions/CustomDataType"
        }
      },
      "required": ["priority", "highVoltage", "lowVoltage", "highFreq", "lowFreq"]
    },
    "FixedPFType": {
      "javaType": "FixedPF",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "priority": {
          "description": "Priority of setting (0=highest)\r\n",
          "type": "integer",
          "minimum": 0
        },
        "displacement": {
          "description": "Power factor, cos(phi), as value between 0..1.\r\n",
          "type": "number"
        },
        "excitation": {
          "description": "True when absorbing reactive power (under-excited), false when injecting reactive power (over-excited).\r\n",
          "type": "boolean"
        },
        "startTime": {
          "description": "Time when this setting becomes active\r\n",
          "type": "string",
          "format": "date-time"
        },
        "duration": {
          "description": "Duration in seconds that this setting is active.\r\n",
          "type": "number"
        },
        "customData": {
          "$ref": "#/definitions/CustomDataType"
        }
      },
      "required": ["priority", "displacement", "excitation"]
    },
    "FixedVarType": {
      "javaType": "FixedVar",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "priority": {
          "description": "Priority of setting (0=highest)\r\n",
          "type": "integer",
          "minimum": 0
        },
        "setpoint": {
          "description": "The value specifies a target var output interpreted as a signed percentage (-100 to 100). \r\n    A negative value refers to charging, whereas a positive one refers to discharging.\r\n    The value type is determined by the unit field.\r\n",
          "type": "number"
        },
        "unit": {
          "$ref": "#/definitions/DERUnitEnumType"
        },
        "startTime": {
          "description": "Time when this setting becomes active.\r\n",
          "type": "string",
          "format": "date-time"
        },
        "duration": {
          "description": "Duration in seconds that this setting is active.\r\n",
          "type": "number"
        },
        "customData": {
          "$ref": "#/definitions/CustomDataType"
        }
      },
      "required": ["priority", "setpoint", "unit"]
    },
    "FreqDroopType": {
      "javaType": "FreqDroop",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "priority": {
          "description": "Priority of setting (0=highest)\r\n\r\n\r\n",
          "type": "integer",
          "minimum": 0
        },
        "overFreq": {
          "description": "Over-frequency start of droop\r\n\r\n\r\n",
          "type": "number"
        },
        "underFreq": {
          "description": "Under-frequency start of droop\r\n\r\n\r\n",
          "type": "number"
        },
        "overDroop": {
          "description": "Over-frequency droop per unit, oFDroop\r\n\r\n\r\n",
          "type": "number"
        },
        "underDroop": {
          "description": "Under-frequency droop per unit, uFDroop\r\n\r\n",
          "type": "number"
        },
        "responseTime": {
          "description": "Open loop response time in seconds\r\n\r\n",
          "type": "number"
        },
        "startTime": {
          "description": "Time when this setting becomes active\r\n\r\n\r\n",
          "type": "string",
          "format": "date-time"
        },
        "duration": {
          "description": "Duration in seconds that this setting is active\r\n\r\n\r\n",
          "type": "number"
        },
        "customData": {
          "$ref": "#/definitions/CustomDataType"
        }
      },
      "required": ["priority", "overFreq", "underFreq", "overDroop", "underDroop", "responseTime"]
    },
    "GradientType": {
      "javaType": "Gradient",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "priority": {
          "description": "Id of setting\r\n\r\n\r\n",
          "type": "integer",
          "minimum": 0
        },
        "gradient": {
          "description": "Default ramp rate in seconds (0 if not applicable)\r\n\r\n\r\n",
          "type": "number"
        },
        "softGradient": {
          "description": "Soft-start ramp rate in seconds (0 if not applicable)\r\n\r\n\r\n",
          "type": "number"
        },
        "customData": {
          "$ref": "#/definitions/CustomDataType"
        }
      },
      "required": ["priority", "gradient", "softGradient"]
    },
    "HysteresisType": {
      "javaType": "Hysteresis",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "hysteresisHigh": {
          "description": "High value for return to normal operation after a grid event, in absolute value. This value adopts the same unit as defined by yUnit\r\n\r\n\r\n",
          "type": "number"
        },
        "hysteresisLow": {
          "description": "Low value for return to normal operation after a grid event, in absolute value. This value adopts the same unit as defined by yUnit\r\n\r\n\r\n",
          "type": "number"
        },
        "hysteresisDelay": {
          "description": "Delay in seconds, once grid parameter within HysteresisLow and HysteresisHigh, for the EV to return to normal operation after a grid event.\r\n\r\n\r\n",
          "type": "number"
        },
        "hysteresisGradient": {
          "description": "Set default rate of change (ramp rate %/s) for the EV to return to normal operation after a grid event\r\n\r\n\r\n",
          "type": "number"
        },
        "customData": {
          "$ref": "#/definitions/CustomDataType"
        }
      }
    },
    "LimitMaxDischargeType": {
      "javaType": "LimitMaxDischarge",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "priority": {
          "description": "Priority of setting (0=highest)\r\n\r\n\r\n",
          "type": "integer",
          "minimum": 0
        },
        "pctMaxDischargePower": {
          "description": "Only for PowerMonitoring. +\r\n    The value specifies a percentage (0 to 100) of the rated maximum discharge power of EV. \r\n    The PowerMonitoring curve becomes active when power exceeds this percentage.\r\n\r\n\r\n",
          "type": "number"
        },
        "powerMonitoringMustTrip": {
          "$ref": "#/definitions/DERCurveType"
        },
        "startTime": {
          "description": "Time when this setting becomes active\r\n\r\n\r\n",
          "type": "string",
          "format": "date-time"
        },
        "duration": {
          "description": "Duration in seconds that this setting is active\r\n\r\n\r\n",
          "type": "number"
        },
        "customData": {
          "$ref": "#/definitions/CustomDataType"
        }
      },
      "required": ["priority"]
    },
    "ReactivePowerParamsType": {
      "javaType": "ReactivePowerParams",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "vRef": {
          "description": "Only for VoltVar curve: The nominal ac voltage (rms) adjustment to the voltage curve points for Volt-Var curves (percentage).\r\n\r\n\r\n",
          "type": "number"
        },
        "autonomousVRefEnable": {
          "description": "Only for VoltVar: Enable/disable autonomous VRef adjustment\r\n\r\n\r\n",
          "type": "boolean"
        },
        "autonomousVRefTimeConstant": {
          "description": "Only for VoltVar: Adjustment range for VRef time constant\r\n\r\n\r\n",
          "type": "number"
        },
        "customData": {
          "$ref": "#/definitions/CustomDataType"
        }
      }
    },
    "VoltageParamsType": {
      "javaType": "VoltageParams",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "hv10MinMeanValue": {
          "description": "EN 50549-1 chapter 4.9.3.4\r\n    Voltage threshold for the 10 min time window mean value monitoring.\r\n    The 10 min mean is recalculated up to every 3 s. \r\n    If the present voltage is above this threshold for more than the time defined by _hv10MinMeanValue_, the EV must trip.\r\n    This value is mandatory if _hv10MinMeanTripDelay_ is set.\r\n\r\n\r\n",
          "type": "number"
        },
        "hv10MinMeanTripDelay": {
          "description": "Time for which the voltage is allowed to stay above the 10 min mean value. \r\n    After this time, the EV must trip.\r\n    This value is mandatory if OverVoltageMeanValue10min is set.\r\n\r\n\r\n",
          "type": "number"
        },
        "powerDuringCessation": {
          "$ref": "#/definitions/PowerDuringCessationEnumType"
        },
        "customData": {
          "$ref": "#/definitions/CustomDataType"
        }
      }
    },
    "CustomDataType": {
      "description": "This class does not get 'AdditionalProperties = false' in the schema generation, so it can be extended with arbitrary JSON properties to allow adding custom data.",
      "javaType": "CustomData",
      "type": "object",
      "properties": {
        "vendorId": {
          "type": "string",
          "maxLength": 255
        }
      },
      "required": ["vendorId"]
    }
  },
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "isDefault": {
      "description": "True if this is a default DER control\r\n\r\n",
      "type": "boolean"
    },
    "controlId": {
      "description": "Unique id of this control, e.g. UUID\r\n\r\n",
      "type": "string",
      "maxLength": 36
    },
    "controlType": {
      "$ref": "#/definitions/DERControlEnumType"
    },
    "curve": {
      "$ref": "#/definitions/DERCurveType"
    },
    "enterService": {
      "$ref": "#/definitions/EnterServiceType"
    },
    "fixedPFAbsorb": {
      "$ref": "#/definitions/FixedPFType"
    },
    "fixedPFInject": {
      "$ref": "#/definitions/FixedPFType"
    },
    "fixedVar": {
      "$ref": "#/definitions/FixedVarType"
    },
    "freqDroop": {
      "$ref": "#/definitions/FreqDroopType"
    },
    "gradient": {
      "$ref": "#/definitions/GradientType"
    },
    "limitMaxDischarge": {
      "$ref": "#/definitions/LimitMaxDischargeType"
    },
    "customData": {
      "$ref": "#/definitions/CustomDataType"
    }
  },
  "required": ["isDefault", "controlId", "controlType"]
}
