Mennekes: Update EV charger interface and add full charging current resolution
parent
9122fc5144
commit
c525b33d44
|
|
@ -320,8 +320,8 @@ void IntegrationPluginMennekes::executeAction(ThingActionInfo *info)
|
|||
|
||||
if (info->action().actionTypeId() == amtronECUPowerActionTypeId) {
|
||||
bool power = info->action().paramValue(amtronECUPowerActionPowerParamTypeId).toBool();
|
||||
int maxChargingCurrent = info->thing()->stateValue(amtronECUMaxChargingCurrentStateTypeId).toUInt();
|
||||
int effectiveCurrent = power ? maxChargingCurrent : 0;
|
||||
double maxChargingCurrent = info->thing()->stateValue(amtronECUMaxChargingCurrentStateTypeId).toDouble();
|
||||
int effectiveCurrent = power ? qRound(maxChargingCurrent) : 0;
|
||||
qCInfo(dcMennekes()) << "Executing power action:" << power << "max current:" << maxChargingCurrent << "-> effective current" << effectiveCurrent;
|
||||
QModbusReply *reply = amtronECUConnection->setHemsCurrentLimit(effectiveCurrent);
|
||||
if (!reply) {
|
||||
|
|
@ -344,7 +344,7 @@ void IntegrationPluginMennekes::executeAction(ThingActionInfo *info)
|
|||
|
||||
if (info->action().actionTypeId() == amtronECUMaxChargingCurrentActionTypeId) {
|
||||
bool power = info->thing()->stateValue(amtronECUPowerStateTypeId).toBool();
|
||||
int maxChargingCurrent = info->action().paramValue(amtronECUMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toInt();
|
||||
int maxChargingCurrent = qRound(info->action().paramValue(amtronECUMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toDouble());
|
||||
int effectiveCurrent = power ? maxChargingCurrent : 0;
|
||||
qCInfo(dcMennekes()) << "Executing max current action:" << maxChargingCurrent << "Power is" << power << "-> effective:" << effectiveCurrent;
|
||||
QModbusReply *reply = amtronECUConnection->setHemsCurrentLimit(effectiveCurrent);
|
||||
|
|
@ -443,8 +443,8 @@ void IntegrationPluginMennekes::executeAction(ThingActionInfo *info)
|
|||
});
|
||||
}
|
||||
if (info->action().actionTypeId() == amtronCompact20MaxChargingCurrentActionTypeId) {
|
||||
int maxChargingCurrent = info->action().paramValue(amtronCompact20MaxChargingCurrentActionMaxChargingCurrentParamTypeId).toInt();
|
||||
float value = maxChargingCurrent;
|
||||
double maxChargingCurrent = info->action().paramValue(amtronCompact20MaxChargingCurrentActionMaxChargingCurrentParamTypeId).toDouble();
|
||||
float value = static_cast<float>(maxChargingCurrent);
|
||||
|
||||
// Note: in firmwares up to 1.0.2 there's an issue that it cannot be exactly 6A, must be 6.01 or so
|
||||
if (maxChargingCurrent == 6) {
|
||||
|
|
|
|||
|
|
@ -107,10 +107,11 @@
|
|||
"name": "maxChargingCurrent",
|
||||
"displayName": "Maximum charging current",
|
||||
"displayNameAction": "Set maximum charging current",
|
||||
"type": "uint",
|
||||
"type": "double",
|
||||
"unit": "Ampere",
|
||||
"minValue": 6,
|
||||
"maxValue": 32,
|
||||
"stepSize": 1.0,
|
||||
"defaultValue": 6,
|
||||
"writable": true
|
||||
},
|
||||
|
|
@ -244,10 +245,11 @@
|
|||
"displayName": "Maximum charging current",
|
||||
"displayNameEvent": "Maximum charging current changed",
|
||||
"displayNameAction": "Set maximum charging current",
|
||||
"type": "uint",
|
||||
"type": "double",
|
||||
"unit": "Ampere",
|
||||
"minValue": 6,
|
||||
"maxValue": 32,
|
||||
"stepSize": 1.0,
|
||||
"defaultValue": 6,
|
||||
"writable": true
|
||||
}
|
||||
|
|
@ -360,10 +362,11 @@
|
|||
"name": "maxChargingCurrent",
|
||||
"displayName": "Maximum charging current",
|
||||
"displayNameAction": "Set maximum charging current",
|
||||
"type": "uint",
|
||||
"type": "double",
|
||||
"unit": "Ampere",
|
||||
"minValue": 6,
|
||||
"maxValue": 32,
|
||||
"stepSize": 0.01,
|
||||
"defaultValue": 6,
|
||||
"writable": true
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue