Documentation ¶
Overview ¶
Contains support for basic Smart Charging, for instance using control pilot.
Index ¶
- Constants
- Variables
- type CentralSystemHandler
- type ChargePointHandler
- type ChargingProfileStatus
- type ClearChargingProfileConfirmation
- type ClearChargingProfileFeature
- type ClearChargingProfileRequest
- type ClearChargingProfileStatus
- type GetCompositeScheduleConfirmation
- type GetCompositeScheduleFeature
- type GetCompositeScheduleRequest
- type GetCompositeScheduleStatus
- type SetChargingProfileConfirmation
- type SetChargingProfileFeature
- type SetChargingProfileRequest
Constants ¶
const ClearChargingProfileFeatureName = "ClearChargingProfile"
const GetCompositeScheduleFeatureName = "GetCompositeSchedule"
const ProfileName = "SmartCharging"
The profile name
const SetChargingProfileFeatureName = "SetChargingProfile"
Variables ¶
var Profile = ocpp.NewProfile( ProfileName, SetChargingProfileFeature{}, ClearChargingProfileFeature{}, GetCompositeScheduleFeature{})
Provides support for basic Smart Charging, for instance using control pilot.
Functions ¶
This section is empty.
Types ¶
type CentralSystemHandler ¶
type CentralSystemHandler interface { }
Needs to be implemented by Central systems for handling messages part of the OCPP 1.6 SmartCharging profile.
type ChargePointHandler ¶
type ChargePointHandler interface { OnSetChargingProfile(request *SetChargingProfileRequest) (confirmation *SetChargingProfileConfirmation, err error) OnClearChargingProfile(request *ClearChargingProfileRequest) (confirmation *ClearChargingProfileConfirmation, err error) OnGetCompositeSchedule(request *GetCompositeScheduleRequest) (confirmation *GetCompositeScheduleConfirmation, err error) }
Needs to be implemented by Charge points for handling messages part of the OCPP 1.6 SmartCharging profile.
type ChargingProfileStatus ¶
type ChargingProfileStatus string
Status reported in SetChargingProfileConfirmation.
const ( ChargingProfileStatusAccepted ChargingProfileStatus = "Accepted" ChargingProfileStatusRejected ChargingProfileStatus = "Rejected" ChargingProfileStatusNotSupported ChargingProfileStatus = "NotSupported" )
type ClearChargingProfileConfirmation ¶
type ClearChargingProfileConfirmation struct {
Status ClearChargingProfileStatus `json:"status" validate:"required,clearChargingProfileStatus16"`
}
This field definition of the ClearChargingProfile confirmation payload, sent by the Charge Point to the Central System in response to a ClearChargingProfileRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewClearChargingProfileConfirmation ¶
func NewClearChargingProfileConfirmation(status ClearChargingProfileStatus) *ClearChargingProfileConfirmation
Creates a new ClearChargingProfileConfirmation, containing all required fields. There are no optional fields for this message.
func (ClearChargingProfileConfirmation) GetFeatureName ¶
func (c ClearChargingProfileConfirmation) GetFeatureName() string
type ClearChargingProfileFeature ¶
type ClearChargingProfileFeature struct{}
If the Central System wishes to clear some or all of the charging profiles that were previously sent the Charge Point, it SHALL send a ClearChargingProfileRequest. The Central System can use this message to clear (remove) either a specific charging profile (denoted by id) or a selection of charging profiles that match with the values of the optional connectorId, stackLevel and chargingProfilePurpose fields. The Charge Point SHALL respond with a ClearChargingProfileConfirmation payload specifying whether it was able to process the request.
func (ClearChargingProfileFeature) GetFeatureName ¶
func (f ClearChargingProfileFeature) GetFeatureName() string
func (ClearChargingProfileFeature) GetRequestType ¶
func (f ClearChargingProfileFeature) GetRequestType() reflect.Type
func (ClearChargingProfileFeature) GetResponseType ¶
func (f ClearChargingProfileFeature) GetResponseType() reflect.Type
type ClearChargingProfileRequest ¶
type ClearChargingProfileRequest struct { Id *int `json:"id,omitempty" validate:"omitempty"` ConnectorId *int `json:"connectorId,omitempty" validate:"omitempty,gte=0"` ChargingProfilePurpose types.ChargingProfilePurposeType `json:"chargingProfilePurpose,omitempty" validate:"omitempty,chargingProfilePurpose16"` StackLevel *int `json:"stackLevel,omitempty" validate:"omitempty,gte=0"` }
The field definition of the ClearChargingProfile request payload sent by the Central System to the Charge Point.
func NewClearChargingProfileRequest ¶
func NewClearChargingProfileRequest() *ClearChargingProfileRequest
Creates a new ClearChargingProfileRequest. All fields are optional and may be set afterwards.
func (ClearChargingProfileRequest) GetFeatureName ¶
func (r ClearChargingProfileRequest) GetFeatureName() string
type ClearChargingProfileStatus ¶
type ClearChargingProfileStatus string
Status reported in ClearChargingProfileConfirmation.
const ( ClearChargingProfileStatusAccepted ClearChargingProfileStatus = "Accepted" ClearChargingProfileStatusUnknown ClearChargingProfileStatus = "Unknown" )
type GetCompositeScheduleConfirmation ¶
type GetCompositeScheduleConfirmation struct { Status GetCompositeScheduleStatus `json:"status" validate:"required,compositeScheduleStatus"` ConnectorId *int `json:"connectorId,omitempty" validate:"omitempty,gt=0"` ScheduleStart *types.DateTime `json:"scheduleStart,omitempty"` ChargingSchedule *types.ChargingSchedule `json:"chargingSchedule,omitempty" validate:"omitempty"` }
This field definition of the GetCompositeSchedule confirmation payload, sent by the Charge Point to the Central System in response to a GetCompositeScheduleRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewGetCompositeScheduleConfirmation ¶
func NewGetCompositeScheduleConfirmation(status GetCompositeScheduleStatus) *GetCompositeScheduleConfirmation
Creates a new GetCompositeScheduleConfirmation, containing all required fields. Optional fields may be set afterwards.
func (GetCompositeScheduleConfirmation) GetFeatureName ¶
func (c GetCompositeScheduleConfirmation) GetFeatureName() string
type GetCompositeScheduleFeature ¶
type GetCompositeScheduleFeature struct{}
The CSMS requests the Charging Station to report the Composite Charging Schedule by sending a GetCompositeScheduleRequest. The Charging Station calculates the schedule, according to the parameters specified in the request. The composite schedule is the result of the calculation of all active schedules and possible local limits present in the Charging Station. The Charging Station responds with a GetCompositeScheduleResponse with the status and ChargingSchedule. If the Charging Station is not able to report the requested schedule, for instance if the evseID is unknown, it SHALL respond with a status Rejected.
func (GetCompositeScheduleFeature) GetFeatureName ¶
func (f GetCompositeScheduleFeature) GetFeatureName() string
func (GetCompositeScheduleFeature) GetRequestType ¶
func (f GetCompositeScheduleFeature) GetRequestType() reflect.Type
func (GetCompositeScheduleFeature) GetResponseType ¶
func (f GetCompositeScheduleFeature) GetResponseType() reflect.Type
type GetCompositeScheduleRequest ¶
type GetCompositeScheduleRequest struct { ConnectorId int `json:"connectorId" validate:"gte=0"` Duration int `json:"duration" validate:"gte=0"` ChargingRateUnit types.ChargingRateUnitType `json:"chargingRateUnit,omitempty" validate:"omitempty,chargingRateUnit16"` }
The field definition of the GetCompositeSchedule request payload sent by the Central System to the Charge Point.
func NewGetCompositeScheduleRequest ¶
func NewGetCompositeScheduleRequest(connectorId int, duration int) *GetCompositeScheduleRequest
Creates a new GetCompositeScheduleRequest, containing all required fields. Optional fields may be set afterwards.
func (GetCompositeScheduleRequest) GetFeatureName ¶
func (r GetCompositeScheduleRequest) GetFeatureName() string
type GetCompositeScheduleStatus ¶
type GetCompositeScheduleStatus string
Status reported in GetCompositeScheduleConfirmation.
const ( GetCompositeScheduleStatusAccepted GetCompositeScheduleStatus = "Accepted" GetCompositeScheduleStatusRejected GetCompositeScheduleStatus = "Rejected" )
type SetChargingProfileConfirmation ¶
type SetChargingProfileConfirmation struct {
Status ChargingProfileStatus `json:"status" validate:"required,chargingProfileStatus16"`
}
This field definition of the SetChargingProfile confirmation payload, sent by the Charge Point to the Central System in response to a SetChargingProfileRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewSetChargingProfileConfirmation ¶
func NewSetChargingProfileConfirmation(status ChargingProfileStatus) *SetChargingProfileConfirmation
Creates a new SetChargingProfileConfirmation, containing all required fields. There are no optional fields for this message.
func (SetChargingProfileConfirmation) GetFeatureName ¶
func (c SetChargingProfileConfirmation) GetFeatureName() string
type SetChargingProfileFeature ¶
type SetChargingProfileFeature struct{}
The Central System MAY send charging profiles to a Charge Point that are to be used as default charging profiles. Such charging profiles MAY be sent at any time. If a charging profile with the same chargingProfileId, or the same combination of stackLevel / ChargingProfilePurpose, exists on the Charge Point, the new charging profile SHALL replace the existing charging profile, otherwise it SHALL be added. The Charge Point SHALL then re-evaluate its collection of charge profiles to determine which charging profile will become active.
func (SetChargingProfileFeature) GetFeatureName ¶
func (f SetChargingProfileFeature) GetFeatureName() string
func (SetChargingProfileFeature) GetRequestType ¶
func (f SetChargingProfileFeature) GetRequestType() reflect.Type
func (SetChargingProfileFeature) GetResponseType ¶
func (f SetChargingProfileFeature) GetResponseType() reflect.Type
type SetChargingProfileRequest ¶
type SetChargingProfileRequest struct { ConnectorId int `json:"connectorId" validate:"gte=0"` ChargingProfile *types.ChargingProfile `json:"csChargingProfiles" validate:"required"` }
The field definition of the SetChargingProfile request payload sent by the Central System to the Charge Point.
func NewSetChargingProfileRequest ¶
func NewSetChargingProfileRequest(connectorId int, chargingProfile *types.ChargingProfile) *SetChargingProfileRequest
Creates a new SetChargingProfileRequest, containing all required fields. There are no optional fields for this message.
func (SetChargingProfileRequest) GetFeatureName ¶
func (r SetChargingProfileRequest) GetFeatureName() string