smartcharging

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

The Smart charging functional block contains OCPP 2.0 features that enable the CSO (or a third party) to influence the charging current/power transferred during a transaction, or set limits to the amount of current/power a Charging Station can draw from the grid.

Index

Constants

View Source
const ClearChargingProfileFeatureName = "ClearChargingProfile"
View Source
const ClearedChargingLimitFeatureName = "ClearedChargingLimit"
View Source
const GetChargingProfilesFeatureName = "GetChargingProfiles"
View Source
const GetCompositeScheduleFeatureName = "GetCompositeSchedule"
View Source
const ProfileName = "smartCharging"

Variables

Functions

This section is empty.

Types

type CSMSHandler

type CSMSHandler interface {
	// OnClearedChargingLimit is called on the CSMS whenever a ClearedChargingLimitRequest is received from a charging station.
	OnClearedChargingLimit(chargingStationID string, request *ClearedChargingLimitRequest) (confirmation *ClearedChargingLimitResponse, err error)
}

Needs to be implemented by a CSMS for handling messages part of the OCPP 2.0 Smart charging profile.

type ChargingProfileCriterion

type ChargingProfileCriterion struct {
	ChargingProfilePurpose types.ChargingProfilePurposeType `json:"chargingProfilePurpose,omitempty" validate:"omitempty,chargingProfilePurpose"`
	StackLevel             *int                             `json:"stackLevel,omitempty" validate:"omitempty,gte=0"`
	ChargingProfileID      []int                            `json:"chargingProfileId,omitempty" validate:"omitempty,dive,gte=0"` // This field SHALL NOT contain more ids than set in ChargingProfileEntries.maxLimit
	ChargingLimitSource    []types.ChargingLimitSourceType  `json:"chargingLimitSource,omitempty" validate:"omitempty,max=4,dive,chargingLimitSource"`
}

ChargingProfileCriterion specifies the charging profile within a GetChargingProfilesRequest. A ChargingProfile consists of ChargingSchedule, describing the amount of power or current that can be delivered per time interval.

type ChargingStationHandler

type ChargingStationHandler interface {
	// OnClearChargingProfile is called on a charging station whenever a ClearChargingProfileRequest is received from the CSMS.
	OnClearChargingProfile(request *ClearChargingProfileRequest) (confirmation *ClearChargingProfileResponse, err error)
	// OnGetChargingProfiles is called on a charging station whenever a GetChargingProfilesRequest is received from the CSMS.
	OnGetChargingProfiles(request *GetChargingProfilesRequest) (confirmation *GetChargingProfilesResponse, err error)
	// OnGetCompositeSchedule is called on a charging station whenever a GetCompositeScheduleRequest is received from the CSMS.
	OnGetCompositeSchedule(request *GetCompositeScheduleRequest) (confirmation *GetCompositeScheduleResponse, err error)
}

Needs to be implemented by Charging stations for handling messages part of the OCPP 2.0 Smart charging profile.

type ClearChargingProfileFeature

type ClearChargingProfileFeature struct{}

If the CSMS wishes to clear some or all of the charging profiles that were previously sent the Charging Station, it SHALL send a ClearChargingProfileRequest. The CSMS 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 Charging Station SHALL respond with a ClearChargingProfileResponse 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 {
	EvseID          *int                      `json:"evseId,omitempty" validate:"omitempty,gte=0"`
	ChargingProfile *ClearChargingProfileType `json:"chargingProfile,omitempty" validate:"omitempty,dive"`
}

The field definition of the ClearChargingProfile request payload sent by the CSMS to the Charging Station.

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 ClearChargingProfileResponse

type ClearChargingProfileResponse struct {
	Status ClearChargingProfileStatus `json:"status" validate:"required,clearChargingProfileStatus"`
}

This field definition of the ClearChargingProfile response payload, sent by the Charging Station to the CSMS in response to a ClearChargingProfileRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewClearChargingProfileResponse

func NewClearChargingProfileResponse(status ClearChargingProfileStatus) *ClearChargingProfileResponse

Creates a new ClearChargingProfileResponse, containing all required fields. There are no optional fields for this message.

func (ClearChargingProfileResponse) GetFeatureName

func (c ClearChargingProfileResponse) GetFeatureName() string

type ClearChargingProfileStatus

type ClearChargingProfileStatus string

Status reported in ClearChargingProfileResponse.

const (
	ClearChargingProfileStatusAccepted ClearChargingProfileStatus = "Accepted"
	ClearChargingProfileStatusUnknown  ClearChargingProfileStatus = "Unknown"
)

type ClearChargingProfileType

type ClearChargingProfileType struct {
	ID                     int                              `json:"id,omitempty" validate:"gte=0"`
	ChargingProfilePurpose types.ChargingProfilePurposeType `json:"chargingProfilePurpose,omitempty" validate:"omitempty,chargingProfilePurpose"`
	StackLevel             int                              `json:"stackLevel,omitempty" validate:"omitempty,gt=0"`
}

type ClearedChargingLimitFeature

type ClearedChargingLimitFeature struct{}

When an external control system sends a signal to release a previously imposed charging limit to a Charging Station, the Charging Station sends a ClearedChargingLimitRequest to notify the CSMS about this. The CSMS acknowledges with a ClearedChargingLimitResponse to the Charging Station. When the change has impact on an ongoing charging transaction and is more than: LimitChangeSignificance, the Charging Station needs to send a TransactionEventRequest to notify the CSMS.

func (ClearedChargingLimitFeature) GetFeatureName

func (f ClearedChargingLimitFeature) GetFeatureName() string

func (ClearedChargingLimitFeature) GetRequestType

func (f ClearedChargingLimitFeature) GetRequestType() reflect.Type

func (ClearedChargingLimitFeature) GetResponseType

func (f ClearedChargingLimitFeature) GetResponseType() reflect.Type

type ClearedChargingLimitRequest

type ClearedChargingLimitRequest struct {
	ChargingLimitSource types.ChargingLimitSourceType `json:"chargingLimitSource" validate:"required,chargingLimitSource"`
	EvseID              *int                          `json:"evseId,omitempty" validate:"omitempty,gte=0"`
}

The field definition of the ClearedChargingLimit request payload sent by the Charging Station to the CSMS.

func NewClearedChargingLimitRequest

func NewClearedChargingLimitRequest(chargingLimitSource types.ChargingLimitSourceType) *ClearedChargingLimitRequest

Creates a new ClearedChargingLimitRequest, containing all required fields. Optional fields may be set afterwards.

func (ClearedChargingLimitRequest) GetFeatureName

func (r ClearedChargingLimitRequest) GetFeatureName() string

type ClearedChargingLimitResponse

type ClearedChargingLimitResponse struct {
}

This field definition of the ClearedChargingLimit response payload, sent by the CSMS to the Charging Station in response to a ClearedChargingLimitRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewClearedChargingLimitResponse

func NewClearedChargingLimitResponse() *ClearedChargingLimitResponse

Creates a new ClearedChargingLimitResponse, which doesn't contain any required or optional fields.

func (ClearedChargingLimitResponse) GetFeatureName

func (c ClearedChargingLimitResponse) GetFeatureName() string

type CompositeSchedule

type CompositeSchedule struct {
	StartDateTime    *types.DateTime         `json:"startDateTime,omitempty" validate:"omitempty"`
	ChargingSchedule *types.ChargingSchedule `json:"chargingSchedule,omitempty" validate:"omitempty"`
}

type GetChargingProfileStatus

type GetChargingProfileStatus string

Status reported in GetChargingProfilesResponse.

const (
	GetChargingProfileStatusAccepted   GetChargingProfileStatus = "Accepted"
	GetChargingProfileStatusNoProfiles GetChargingProfileStatus = "NoProfiles"
)

type GetChargingProfilesFeature

type GetChargingProfilesFeature struct{}

The CSMS MAY ask a Charging Station to report all, or a subset of all the install Charging Profiles from the different possible sources, by sending a GetChargingProfilesRequest. This can be used for some automatic smart charging control system, or for debug purposes by a CSO. The Charging Station SHALL respond, indicating if it can report Charging Schedules by sending a GetChargingProfilesResponse message.

func (GetChargingProfilesFeature) GetFeatureName

func (f GetChargingProfilesFeature) GetFeatureName() string

func (GetChargingProfilesFeature) GetRequestType

func (f GetChargingProfilesFeature) GetRequestType() reflect.Type

func (GetChargingProfilesFeature) GetResponseType

func (f GetChargingProfilesFeature) GetResponseType() reflect.Type

type GetChargingProfilesRequest

type GetChargingProfilesRequest struct {
	RequestID       *int                     `json:"requestId,omitempty" validate:"omitempty,gte=0"`
	EvseID          *int                     `json:"evseId,omitempty" validate:"omitempty,gte=0"`
	ChargingProfile ChargingProfileCriterion `json:"chargingProfile" validate:"required"`
}

The field definition of the GetChargingProfiles request payload sent by the CSMS to the Charging Station.

func NewGetChargingProfilesRequest

func NewGetChargingProfilesRequest(chargingProfile ChargingProfileCriterion) *GetChargingProfilesRequest

Creates a new GetChargingProfilesRequest, containing all required fields. Optional fields may be set afterwards.

func (GetChargingProfilesRequest) GetFeatureName

func (r GetChargingProfilesRequest) GetFeatureName() string

type GetChargingProfilesResponse

type GetChargingProfilesResponse struct {
	Status GetChargingProfileStatus `json:"status" validate:"required,getChargingProfileStatus"`
}

This field definition of the GetChargingProfiles response payload, sent by the Charging Station to the CSMS in response to a GetChargingProfilesRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewGetChargingProfilesResponse

func NewGetChargingProfilesResponse(status GetChargingProfileStatus) *GetChargingProfilesResponse

Creates a new GetChargingProfilesResponse, containing all required fields. There are no optional fields for this message.

func (GetChargingProfilesResponse) GetFeatureName

func (c GetChargingProfilesResponse) GetFeatureName() string

type GetCompositeScheduleFeature

type GetCompositeScheduleFeature struct{}

The CSMS MAY request the Charging System to report the Composite Charging Schedule by sending a GetCompositeScheduleRequest. The Charging System SHALL calculate the Composite Charging Schedule intervals, from the moment the request payload is received: Time X, up to X + Duration, and send them in the GetCompositeScheduleResponse to the CSMS. The reported schedule, in the GetCompositeScheduleResponse payload, is the result of the calculation of all active schedules and possible local limits present in the Charging System. If the ConnectorId in the request is set to '0', the Charging System SHALL report the total expected power or current the Charging System expects to consume from the grid during the requested time period. If the Charging System is not able to report the requested schedule, for instance if the connectorId 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 {
	Duration         int                        `json:"duration" validate:"gte=0"`
	ChargingRateUnit types.ChargingRateUnitType `json:"chargingRateUnit,omitempty" validate:"omitempty,chargingRateUnit"`
	EvseID           int                        `json:"evseId" validate:"gte=0"`
}

The field definition of the GetCompositeSchedule request payload sent by the CSMS to the Charging System.

func NewGetCompositeScheduleRequest

func NewGetCompositeScheduleRequest(duration int, evseId 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 GetCompositeScheduleResponse

type GetCompositeScheduleResponse struct {
	Status   GetCompositeScheduleStatus `json:"status" validate:"required,getCompositeScheduleStatus"`
	EvseID   int                        `json:"evseId" validate:"gte=0"`
	Schedule *CompositeSchedule         `json:"schedule,omitempty" validate:"omitempty"`
}

This field definition of the GetCompositeSchedule response payload, sent by the Charging System to the CSMS in response to a GetCompositeScheduleRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewGetCompositeScheduleResponse

func NewGetCompositeScheduleResponse(status GetCompositeScheduleStatus, evseId int) *GetCompositeScheduleResponse

Creates a new GetCompositeScheduleResponse, containing all required fields. Optional fields may be set afterwards.

func (GetCompositeScheduleResponse) GetFeatureName

func (c GetCompositeScheduleResponse) GetFeatureName() string

type GetCompositeScheduleStatus

type GetCompositeScheduleStatus string

Status reported in GetCompositeScheduleResponse.

const (
	GetCompositeScheduleStatusAccepted GetCompositeScheduleStatus = "Accepted"
	GetCompositeScheduleStatusRejected GetCompositeScheduleStatus = "Rejected"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL