Merge PR #784: Update EV charger interface and add full charging current resolution

This commit is contained in:
jenkins 2026-01-12 10:47:40 +01:00
commit 7560cdb144
8 changed files with 25 additions and 17 deletions

View File

@ -54,10 +54,11 @@
"name": "maxChargingCurrent",
"displayName": "Maximum charging current",
"displayNameAction": "Set maximum charging current",
"type": "uint",
"type": "double",
"unit": "Ampere",
"minValue": 6,
"maxValue": 16,
"stepSize": 1.0,
"defaultValue": 6,
"writable": true
},

View File

@ -259,7 +259,7 @@ void IntegrationPluginEVBox::executeAction(ThingActionInfo *info)
quint16 maxChargingCurrent = thing->stateValue("maxChargingCurrent").toUInt();
port->sendCommand(EVBoxPort::Command68, 60, power ? maxChargingCurrent : 0, serial);
} else if (actionType.name() == "maxChargingCurrent") {
int maxChargingCurrent = info->action().paramValue(actionType.id()).toInt();
int maxChargingCurrent = qRound(info->action().paramValue(actionType.id()).toDouble());
port->sendCommand(EVBoxPort::Command68, 60, maxChargingCurrent, serial);
}
@ -279,7 +279,7 @@ void IntegrationPluginEVBox::finishPendingAction(Thing *thing)
if (actionType.name() == "power") {
thing->setStateValue("power", info->action().paramValue(actionType.id()));
} else if (actionType.name() == "maxChargingCurrent") {
thing->setStateValue("maxChargingCurrent", info->action().paramValue(actionType.id()));
thing->setStateValue("maxChargingCurrent", qRound(info->action().paramValue(actionType.id()).toDouble()));
}
info->finish(Thing::ThingErrorNoError);
}

View File

@ -56,11 +56,12 @@
"name": "maxChargingCurrent",
"displayName": "Maximum charging current",
"displayNameAction": "Set maximum charging current",
"type": "uint",
"type": "double",
"writable": true,
"unit": "Ampere",
"minValue": "6",
"maxValue": "32",
"stepSize": 1.0,
"defaultValue": 6
},
{
@ -157,11 +158,12 @@
"name": "maxChargingCurrent",
"displayName": "Maximum charging current",
"displayNameAction": "Set maximum charging current",
"type": "uint",
"type": "double",
"writable": true,
"unit": "Ampere",
"minValue": "6",
"maxValue": "32",
"stepSize": 1.0,
"defaultValue": 6
},
{

View File

@ -62,11 +62,12 @@
"name": "maxChargingCurrent",
"displayName": "Maximum charging current",
"displayNameAction": "Set maximum charging current",
"type": "uint",
"type": "double",
"unit": "Ampere",
"defaultValue": 6,
"minValue": 6,
"maxValue": 32,
"stepSize": 0.01,
"writable": true
},
{
@ -286,11 +287,12 @@
"name": "maxChargingCurrent",
"displayName": "Maximum charging current",
"displayNameAction": "Set maximum charging current",
"type": "uint",
"type": "double",
"unit": "Ampere",
"defaultValue": 6,
"minValue": 6,
"maxValue": 32,
"stepSize": 0.01,
"writable": true
},
{

View File

@ -143,10 +143,11 @@
"displayName": "Charging current",
"displayNameEvent": "Charging current changed",
"displayNameAction": "Set charging current",
"type": "uint",
"type": "double",
"unit": "Ampere",
"minValue": 6,
"maxValue": 32,
"stepSize": 1.0,
"defaultValue": 16,
"writable": true,
"suggestLogging": true

View File

@ -281,7 +281,7 @@ void IntegrationPluginKeba::executeAction(ThingActionInfo *info)
QUuid requestId;
if (thing->thingClassId() == kebaThingClassId) {
if (action.actionTypeId() == kebaMaxChargingCurrentActionTypeId) {
int milliAmpere = action.paramValue(kebaMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toUInt() * 1000;
int milliAmpere = qRound(action.paramValue(kebaMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toDouble() * 1000);
requestId = keba->setMaxAmpereGeneral(milliAmpere);
} else if (action.actionTypeId() == kebaPowerActionTypeId) {
requestId = keba->enableOutput(action.param(kebaPowerActionTypeId).value().toBool());
@ -302,7 +302,7 @@ void IntegrationPluginKeba::executeAction(ThingActionInfo *info)
} else if (thing->thingClassId() == kebaSimpleThingClassId) {
if (action.actionTypeId() == kebaSimpleMaxChargingCurrentActionTypeId) {
int milliAmpere = action.paramValue(kebaSimpleMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toUInt() * 1000;
int milliAmpere = qRound(action.paramValue(kebaSimpleMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toDouble() * 1000);
requestId = keba->setMaxAmpereGeneral(milliAmpere);
} else if (action.actionTypeId() == kebaSimplePowerActionTypeId) {
requestId = keba->enableOutput(action.param(kebaSimplePowerActionTypeId).value().toBool());
@ -481,7 +481,7 @@ void IntegrationPluginKeba::onCommandExecuted(QUuid requestId, bool success)
if (thing->thingClassId() == kebaThingClassId) {
// Set the value to the state so we don't have to wait for the report 2 response
if (info->action().actionTypeId() == kebaMaxChargingCurrentActionTypeId) {
uint value = info->action().paramValue(kebaMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toUInt();
double value = info->action().paramValue(kebaMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toDouble();
info->thing()->setStateValue("maxChargingCurrent", value);
} else if (info->action().actionTypeId() == kebaPowerActionTypeId) {
info->thing()->setStateValue("power", info->action().paramValue(kebaPowerActionTypeId).toBool());
@ -489,7 +489,7 @@ void IntegrationPluginKeba::onCommandExecuted(QUuid requestId, bool success)
} else if (thing->thingClassId() == kebaSimpleThingClassId) {
// Set the value to the state so we don't have to wait for the report 2 response
if (info->action().actionTypeId() == kebaSimpleMaxChargingCurrentActionTypeId) {
uint value = info->action().paramValue(kebaSimpleMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toUInt();
double value = info->action().paramValue(kebaSimpleMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toDouble();
info->thing()->setStateValue("maxChargingCurrent", value);
} else if (info->action().actionTypeId() == kebaPowerActionTypeId) {
info->thing()->setStateValue("power", info->action().paramValue(kebaSimplePowerActionTypeId).toBool());
@ -598,7 +598,7 @@ void IntegrationPluginKeba::onReportTwoReceived(const KeContact::ReportTwo &repo
qCDebug(dcKeba()) << " - Output:" << reportTwo.output;
qCDebug(dcKeba()) << " - Input:" << reportTwo.input;
qCDebug(dcKeba()) << " - Serial number:" << reportTwo.serialNumber;
qCDebug(dcKeba()) << " - Uptime:" << reportTwo.seconds/60 << "[min]";
qCDebug(dcKeba()) << " - Uptime:" << reportTwo.seconds / 60 << "[min]";
if (reportTwo.serialNumber == thing->paramValue(m_serialNumberParamTypeIds.value(thing->thingClassId())).toString()) {
setDeviceState(thing, reportTwo.state);
@ -609,7 +609,7 @@ void IntegrationPluginKeba::onReportTwoReceived(const KeContact::ReportTwo &repo
thing->setStateValue("error2", reportTwo.error2);
thing->setStateValue("systemEnabled", reportTwo.enableSys);
thing->setStateValue("maxChargingCurrent", qRound(reportTwo.currentUser));
thing->setStateValue("maxChargingCurrent", reportTwo.currentUser);
thing->setStateValue("maxChargingCurrentPercent", reportTwo.maxCurrentPercentage);
thing->setStateValue("maxChargingCurrentHardware", reportTwo.currentHardwareLimitation);

View File

@ -136,11 +136,12 @@
"displayName": "Maximal charging current",
"displayNameEvent": "Maximal charging current changed",
"displayNameAction": "Set maximal charging current",
"type": "uint",
"type": "double",
"unit": "Ampere",
"defaultValue": 6,
"minValue": 6,
"maxValue": 32,
"stepSize": 0.001,
"writable": true,
"suggestLogging": true
},
@ -549,11 +550,12 @@
"displayName": "Maximal charging current",
"displayNameEvent": "Maximal charging current changed",
"displayNameAction": "Set maximal charging current",
"type": "uint",
"type": "double",
"unit": "Ampere",
"defaultValue": 6,
"minValue": 6,
"maxValue": 32,
"stepSize": 0.001,
"writable": true,
"suggestLogging": true
},

View File

@ -130,7 +130,7 @@ public:
double maxCurrent; //Current preset value via Control pilot in ampere.
double maxCurrentPercentage; //Current preset value via Control pilot in 0,1% of the PWM value
double currentHardwareLimitation; //Highest possible charging current of the charging connection. Contains device maximum, DIP-switch setting, cable coding and temperature reduction.
double currentUser; //Current preset value of the user via UDP; Default = 63000mA.
double currentUser; //Current preset value of the user via UDP; A.
double currentFailsafe; //Current preset value for the Failsafe function.
int timeoutFailsafe; //Communication timeout before triggering the Failsafe function.
int currTimer; //Shows the current preset value of currtime.