-
Notifications
You must be signed in to change notification settings - Fork 8
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
How do I add new commands? #6
Comments
Hi, @204maker As I understand it, you want to use setChargingProfile? In this script, there is no universal constructor for commands, since commands have different paths, required data. |
Added 'SetChargingProfile'. To avoid customizing the script, you can simply change the script code in several places.
$stevePathArray = array(
// Local cmd (not use)
'signin' => '/' . $supervision . '/manager/signin',
'getTransaction' => '/' . $supervision . '/manager/transactions',
'getConnectorState' => '/' . $supervision . '/manager/home/connectorStatus',
// OCPP cmd
'ReserveNow' => '/' . $supervision . '/manager/operations/' . $ocppVersion . '/ReserveNow',
'RemoteStartTransaction' => '/' . $supervision . '/manager/operations/' . $ocppVersion . '/RemoteStartTransaction',
'RemoteStopTransaction' => '/' . $supervision . '/manager/operations/' . $ocppVersion . '/RemoteStopTransaction',
'UnlockConnector' => '/' . $supervision . '/manager/operations/' . $ocppVersion . '/UnlockConnector',
'DataTransfer' => '/' . $supervision . '/manager/operations/' . $ocppVersion . '/DataTransfer',
'Reset' => '/' . $supervision . '/manager/operations/' . $ocppVersion . '/Reset',
'SetChargingProfile' => '/' . $supervision . '/manager/operations/' . $ocppVersion . '/SetChargingProfile'
);
case 'SetChargingProfile':
$allow = true; // Allow command?
if($allow) {
// Redirect to SetChargingProfile page
$content = curlConnectTo($steveServerAddres, $stevePath);
// Get token
$token = getCSRFToken($content);
// Prepare form
$form = "chargePointSelectList=".$ocppProtocol.";".$getData['ChargeBoxID'].";".$endpointURL."&connectorId=".$getData['ConnectorID']."&chargingProfilePk=".$getData['ChargingProfileID']."&_csrf=".$token."";
// Send form
curl_setopt($curl, CURLOPT_POSTFIELDS, $form);
curl_exec($curl);
return 'Ok';
}
break; Call: curl "http://localhost:8080/main.php?key=1234&ChargeBoxID=Ecc029&cmd=SetChargingProfile&ChargingProfileID=1&ConnectorID=0" |
Thank you so much! |
How about the MeterValues command? |
The idea would be to use the Current.Import or Current.Export to act as a trigger/flag to indicate that charging have started/ended. Our SteVe server is currently down so I have not tried this yet. Also, with the RemoteStartTransaction command, is it possible to call add a Charging Profile ID to it? |
Hi @204maker, Unfortunately, I will not have time to add this command, as I have to leave for a long time. I really wanted to help you. Perhaps someone can help you with this, with knowledge of PHP, or try it yourself (the most important thing is to determine what data needs to be sent / received, this can be done through the web inspector in the browser and then you can use command templates). |
Hai @DeltaVetal26 how to get the data from respective transcation id including start value, stop value, current voltage values, etc. |
I would like to change the Charging Profile on-the-fly on the charge point,
may I ask how will I be able to add this command on the Php file?
The text was updated successfully, but these errors were encountered: