Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetChargingProfile - Validation issue with ChargingProfilePurposeChargePointMaxProfile #152

Open
olga2323 opened this issue Oct 26, 2022 · 1 comment

Comments

@olga2323
Copy link

Dear all,

when using 1.6 and SetChargingProfile like so:

	cProfile.ChargingProfileId = 1
	cProfile.StackLevel = 0
	cProfile.ChargingProfilePurpose = types.ChargingProfilePurposeChargePointMaxProfile
	cProfile.ChargingProfileKind = types.ChargingProfileKindAbsolute

	cProfile.ChargingSchedule = types.NewChargingSchedule(types.ChargingRateUnitAmperes,
		types.ChargingSchedulePeriod{
			StartPeriod:  0,
			Limit:        float64(limit),
			NumberPhases: &phases,
		})

	err := cs.SetChargingProfile(chargePointName, func(confirmation *smartcharging.SetChargingProfileConfirmation, err error) {
               // some error handling/logging ....
	}, 0, &cProfile)
	if err != nil {
		logrus.WithFields(logrus.Fields{
			"ChargePoint": chargePointName,
		}).Errorf("SetChargingProfile NOT sent %v", err)
		return false
	}

returns an error when using types.ChargingProfilePurposeChargePointMaxProfile, with ChargingProfilePurposeTxDefaultProfile it works ok. I could not spot the issue but removing the validation chargingProfilePurpose brings success, also using ChargingProfilePurposeTxDefaultProfile works.

Lets me know if I can bring more info.

Thanks for all the work.

@lorenzodonini
Copy link
Owner

Hello,

I just tested this and it didn't throw any validation errors at all:

func test(chargePointID string) {
	cProfile := types.ChargingProfile{}
	cProfile.ChargingProfileId = 1
	cProfile.StackLevel = 0
	cProfile.ChargingProfilePurpose = types.ChargingProfilePurposeChargePointMaxProfile
	cProfile.ChargingProfileKind = types.ChargingProfileKindAbsolute
	phases := 3
	cProfile.ChargingSchedule = types.NewChargingSchedule(types.ChargingRateUnitAmperes,
		types.ChargingSchedulePeriod{
			StartPeriod:  0,
			Limit:        float64(10),
			NumberPhases: &phases,
		})
	err := centralSystem.SetChargingProfile(chargePointID, func(confirmation *smartcharging.SetChargingProfileConfirmation, err error) {
		if err != nil {
			logDefault(chargePointID, smartcharging.SetChargingProfileFeatureName).Errorf("error on request: %v", err)
		} else {
			logDefault(chargePointID, smartcharging.SetChargingProfileFeatureName).Infof("status: %v", confirmation.Status)
		}
	}, 0, &cProfile)
	if err != nil {
		fmt.Println(err)
	}
}

Is the error being returned on CSMS side or by the charging station? Also, can you confirm what error is being returned specifically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants