#### Smart Charging Profile
- :white_check_mark: ClearChargingProfile
-- :white_check_mark: GetCompositeSchedule
+- :x: GetCompositeSchedule
- :white_check_mark: SetChargingProfile
#### Remote Trigger Profile
{
"key": "SupportedFeatureProfiles",
"readonly": true,
- "value": "Core,LocalAuthListManagement"
+ "value": "Core,FirmwareManagement,LocalAuthListManagement,SmartCharging,RemoteTrigger"
},
{
"key": "LocalAuthListEnabled",
{
"key": "SupportedFeatureProfiles",
"readonly": true,
- "value": "Core,LocalAuthListManagement"
+ "value": "Core,FirmwareManagement,LocalAuthListManagement,SmartCharging,RemoteTrigger"
},
{
"key": "LocalAuthListEnabled",
{
"key": "MeterValuesSampledData",
"readonly": false,
- "value": "Energy.Active.Import.Register"
+ "value": "Energy.Active.Import.Register,Current.Import,Voltage"
},
{
"key": "MeterValueSampleInterval",
{
"key": "SupportedFeatureProfiles",
"readonly": true,
- "value": "Core,LocalAuthListManagement"
+ "value": "Core,FirmwareManagement,LocalAuthListManagement,SmartCharging,RemoteTrigger"
},
{
"key": "LocalAuthListEnabled",
{
"key": "SupportedFeatureProfiles",
"readonly": true,
- "value": "Core,LocalAuthListManagement"
+ "value": "Core,FirmwareManagement,LocalAuthListManagement,SmartCharging,RemoteTrigger"
},
{
"key": "LocalAuthListEnabled",
{
"key": "MeterValuesSampledData",
"readonly": false,
- "value": "Energy.Active.Import.Register"
+ "value": "Energy.Active.Import.Register,Current.Import,Voltage"
},
{
"key": "MeterValueSampleInterval",
{
"key": "SupportedFeatureProfiles",
"readonly": true,
- "value": "Core,LocalAuthListManagement"
+ "value": "Core,FirmwareManagement,LocalAuthListManagement,SmartCharging,RemoteTrigger"
},
{
"key": "LocalAuthListEnabled",
{
"key": "SupportedFeatureProfiles",
"readonly": true,
- "value": "Core,LocalAuthListManagement"
+ "value": "Core,FirmwareManagement,LocalAuthListManagement,SmartCharging,RemoteTrigger"
},
{
"key": "LocalAuthListEnabled",
{
"key": "MeterValuesSampledData",
"readonly": false,
- "value": "SoC,Energy.Active.Import.Register"
+ "value": "SoC,Energy.Active.Import.Register,Voltage"
},
{
"key": "MeterValueSampleInterval",
{
"key": "SupportedFeatureProfiles",
"readonly": true,
- "value": "Core,LocalAuthListManagement"
+ "value": "Core,FirmwareManagement,LocalAuthListManagement,SmartCharging,RemoteTrigger"
},
{
"key": "LocalAuthListEnabled",
{
"key": "SupportedFeatureProfiles",
"readonly": true,
- "value": "Core,LocalAuthListManagement"
+ "value": "Core,FirmwareManagement,LocalAuthListManagement,SmartCharging,RemoteTrigger"
},
{
"key": "LocalAuthListEnabled",
{
"key": "SupportedFeatureProfiles",
"readonly": true,
- "value": "Core,LocalAuthListManagement"
+ "value": "Core,FirmwareManagement,LocalAuthListManagement,SmartCharging,RemoteTrigger"
},
{
"key": "LocalAuthListEnabled",
}
if (
measurand !== MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER &&
- !this.getConfigurationKey(StandardParametersKey.MeterValuesSampledData).value.includes(
+ !this.getConfigurationKey(StandardParametersKey.MeterValuesSampledData)?.value.includes(
measurand
)
) {
phase &&
sampledValueTemplates[index]?.phase === phase &&
sampledValueTemplates[index]?.measurand === measurand &&
- this.getConfigurationKey(StandardParametersKey.MeterValuesSampledData).value.includes(
+ this.getConfigurationKey(StandardParametersKey.MeterValuesSampledData)?.value.includes(
measurand
)
) {
!phase &&
!sampledValueTemplates[index].phase &&
sampledValueTemplates[index]?.measurand === measurand &&
- this.getConfigurationKey(StandardParametersKey.MeterValuesSampledData).value.includes(
+ this.getConfigurationKey(StandardParametersKey.MeterValuesSampledData)?.value.includes(
measurand
)
) {
this.stopMeterValues(connectorId);
}
+ public hasFeatureProfile(featureProfile: SupportedFeatureProfiles) {
+ return this.getConfigurationKey(StandardParametersKey.SupportedFeatureProfiles)?.value.includes(
+ featureProfile
+ );
+ }
+
public bufferMessage(message: string): void {
this.messageBuffer.add(message);
}
if (!this.getConfigurationKey(StandardParametersKey.SupportedFeatureProfiles)) {
this.addConfigurationKey(
StandardParametersKey.SupportedFeatureProfiles,
- `${SupportedFeatureProfiles.Core},${SupportedFeatureProfiles.Local_Auth_List_Management},${SupportedFeatureProfiles.Smart_Charging}`
+ `${SupportedFeatureProfiles.Core},${SupportedFeatureProfiles.Firmware_Management},${SupportedFeatureProfiles.Local_Auth_List_Management},${SupportedFeatureProfiles.Smart_Charging},${SupportedFeatureProfiles.Remote_Trigger}`
);
}
this.addConfigurationKey(
}
if (
!this.getConfigurationKey(StandardParametersKey.LocalAuthListEnabled) &&
- this.getConfigurationKey(StandardParametersKey.SupportedFeatureProfiles).value.includes(
+ this.getConfigurationKey(StandardParametersKey.SupportedFeatureProfiles)?.value.includes(
SupportedFeatureProfiles.Local_Auth_List_Management
)
) {
OCPP16MeterValuesRequest,
OCPP16MeterValuesResponse,
} from '../../../types/ocpp/1.6/MeterValues';
+import {
+ OCPP16StandardParametersKey,
+ OCPP16SupportedFeatureProfiles,
+} from '../../../types/ocpp/1.6/Configuration';
import type ChargingStation from '../../ChargingStation';
import Constants from '../../../utils/Constants';
import { OCPP16ChargePointStatus } from '../../../types/ocpp/1.6/ChargePointStatus';
import { OCPP16DiagnosticsStatus } from '../../../types/ocpp/1.6/DiagnosticsStatus';
import { OCPP16ServiceUtils } from './OCPP16ServiceUtils';
-import { OCPP16StandardParametersKey } from '../../../types/ocpp/1.6/Configuration';
import { OCPPConfigurationKey } from '../../../types/ocpp/Configuration';
import OCPPError from '../../../exception/OCPPError';
import OCPPIncomingRequestService from '../OCPPIncomingRequestService';
private handleRequestSetChargingProfile(
commandPayload: SetChargingProfileRequest
): SetChargingProfileResponse {
+ if (!this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.Smart_Charging)) {
+ logger.error(
+ `${this.chargingStation.logPrefix()} Trying to set charging profile(s) without '${
+ OCPP16SupportedFeatureProfiles.Smart_Charging
+ }' feature enabled in ${
+ OCPP16StandardParametersKey.SupportedFeatureProfiles
+ } in configuration`
+ );
+ return Constants.OCPP_SET_CHARGING_PROFILE_RESPONSE_NOT_SUPPORTED;
+ }
if (!this.chargingStation.getConnectorStatus(commandPayload.connectorId)) {
logger.error(
`${this.chargingStation.logPrefix()} Trying to set charging profile(s) to a non existing connector Id ${
private handleRequestClearChargingProfile(
commandPayload: ClearChargingProfileRequest
): ClearChargingProfileResponse {
+ if (!this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.Smart_Charging)) {
+ logger.error(
+ `${this.chargingStation.logPrefix()} Trying to clear charging profile(s) without '${
+ OCPP16SupportedFeatureProfiles.Smart_Charging
+ }' feature enabled in ${
+ OCPP16StandardParametersKey.SupportedFeatureProfiles
+ } in configuration`
+ );
+ return Constants.OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_UNKNOWN;
+ }
const connectorStatus = this.chargingStation.getConnectorStatus(commandPayload.connectorId);
if (!connectorStatus) {
logger.error(
private async handleRequestGetDiagnostics(
commandPayload: GetDiagnosticsRequest
): Promise<GetDiagnosticsResponse> {
+ if (
+ !this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.Firmware_Management)
+ ) {
+ logger.error(
+ `${this.chargingStation.logPrefix()} Trying to get diagnostics without '${
+ OCPP16SupportedFeatureProfiles.Firmware_Management
+ }' feature enabled in ${
+ OCPP16StandardParametersKey.SupportedFeatureProfiles
+ } in configuration`
+ );
+ return Constants.OCPP_RESPONSE_EMPTY;
+ }
logger.debug(
this.chargingStation.logPrefix() +
' ' +
private handleRequestTriggerMessage(
commandPayload: OCPP16TriggerMessageRequest
): OCPP16TriggerMessageResponse {
+ if (!this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.Remote_Trigger)) {
+ logger.error(
+ `${this.chargingStation.logPrefix()} Trying to remote trigger message without '${
+ OCPP16SupportedFeatureProfiles.Remote_Trigger
+ }' feature enabled in ${
+ OCPP16StandardParametersKey.SupportedFeatureProfiles
+ } in configuration`
+ );
+ return Constants.OCPP_TRIGGER_MESSAGE_RESPONSE_NOT_IMPLEMENTED;
+ }
try {
switch (commandPayload.requestedMessage) {
case MessageTrigger.BootNotification: