Keba: Update EV charger interface and add full charging current resolution

This commit is contained in:
Simon Stürz 2025-12-22 16:54:26 +01:00
parent 9fd389002d
commit 178c16c967
3 changed files with 11 additions and 9 deletions

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.