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) {
|
if (info->action().actionTypeId() == amtronECUPowerActionTypeId) {
|
||||||
bool power = info->action().paramValue(amtronECUPowerActionPowerParamTypeId).toBool();
|
bool power = info->action().paramValue(amtronECUPowerActionPowerParamTypeId).toBool();
|
||||||
int maxChargingCurrent = info->thing()->stateValue(amtronECUMaxChargingCurrentStateTypeId).toUInt();
|
double maxChargingCurrent = info->thing()->stateValue(amtronECUMaxChargingCurrentStateTypeId).toDouble();
|
||||||
int effectiveCurrent = power ? maxChargingCurrent : 0;
|
int effectiveCurrent = power ? qRound(maxChargingCurrent) : 0;
|
||||||
qCInfo(dcMennekes()) << "Executing power action:" << power << "max current:" << maxChargingCurrent << "-> effective current" << effectiveCurrent;
|
qCInfo(dcMennekes()) << "Executing power action:" << power << "max current:" << maxChargingCurrent << "-> effective current" << effectiveCurrent;
|
||||||
QModbusReply *reply = amtronECUConnection->setHemsCurrentLimit(effectiveCurrent);
|
QModbusReply *reply = amtronECUConnection->setHemsCurrentLimit(effectiveCurrent);
|
||||||
if (!reply) {
|
if (!reply) {
|
||||||
|
|
@ -344,7 +344,7 @@ void IntegrationPluginMennekes::executeAction(ThingActionInfo *info)
|
||||||
|
|
||||||
if (info->action().actionTypeId() == amtronECUMaxChargingCurrentActionTypeId) {
|
if (info->action().actionTypeId() == amtronECUMaxChargingCurrentActionTypeId) {
|
||||||
bool power = info->thing()->stateValue(amtronECUPowerStateTypeId).toBool();
|
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;
|
int effectiveCurrent = power ? maxChargingCurrent : 0;
|
||||||
qCInfo(dcMennekes()) << "Executing max current action:" << maxChargingCurrent << "Power is" << power << "-> effective:" << effectiveCurrent;
|
qCInfo(dcMennekes()) << "Executing max current action:" << maxChargingCurrent << "Power is" << power << "-> effective:" << effectiveCurrent;
|
||||||
QModbusReply *reply = amtronECUConnection->setHemsCurrentLimit(effectiveCurrent);
|
QModbusReply *reply = amtronECUConnection->setHemsCurrentLimit(effectiveCurrent);
|
||||||
|
|
@ -443,8 +443,8 @@ void IntegrationPluginMennekes::executeAction(ThingActionInfo *info)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (info->action().actionTypeId() == amtronCompact20MaxChargingCurrentActionTypeId) {
|
if (info->action().actionTypeId() == amtronCompact20MaxChargingCurrentActionTypeId) {
|
||||||
int maxChargingCurrent = info->action().paramValue(amtronCompact20MaxChargingCurrentActionMaxChargingCurrentParamTypeId).toInt();
|
double maxChargingCurrent = info->action().paramValue(amtronCompact20MaxChargingCurrentActionMaxChargingCurrentParamTypeId).toDouble();
|
||||||
float value = maxChargingCurrent;
|
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
|
// 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) {
|
if (maxChargingCurrent == 6) {
|
||||||
|
|
|
||||||
|
|
@ -107,10 +107,11 @@
|
||||||
"name": "maxChargingCurrent",
|
"name": "maxChargingCurrent",
|
||||||
"displayName": "Maximum charging current",
|
"displayName": "Maximum charging current",
|
||||||
"displayNameAction": "Set maximum charging current",
|
"displayNameAction": "Set maximum charging current",
|
||||||
"type": "uint",
|
"type": "double",
|
||||||
"unit": "Ampere",
|
"unit": "Ampere",
|
||||||
"minValue": 6,
|
"minValue": 6,
|
||||||
"maxValue": 32,
|
"maxValue": 32,
|
||||||
|
"stepSize": 1.0,
|
||||||
"defaultValue": 6,
|
"defaultValue": 6,
|
||||||
"writable": true
|
"writable": true
|
||||||
},
|
},
|
||||||
|
|
@ -244,10 +245,11 @@
|
||||||
"displayName": "Maximum charging current",
|
"displayName": "Maximum charging current",
|
||||||
"displayNameEvent": "Maximum charging current changed",
|
"displayNameEvent": "Maximum charging current changed",
|
||||||
"displayNameAction": "Set maximum charging current",
|
"displayNameAction": "Set maximum charging current",
|
||||||
"type": "uint",
|
"type": "double",
|
||||||
"unit": "Ampere",
|
"unit": "Ampere",
|
||||||
"minValue": 6,
|
"minValue": 6,
|
||||||
"maxValue": 32,
|
"maxValue": 32,
|
||||||
|
"stepSize": 1.0,
|
||||||
"defaultValue": 6,
|
"defaultValue": 6,
|
||||||
"writable": true
|
"writable": true
|
||||||
}
|
}
|
||||||
|
|
@ -360,10 +362,11 @@
|
||||||
"name": "maxChargingCurrent",
|
"name": "maxChargingCurrent",
|
||||||
"displayName": "Maximum charging current",
|
"displayName": "Maximum charging current",
|
||||||
"displayNameAction": "Set maximum charging current",
|
"displayNameAction": "Set maximum charging current",
|
||||||
"type": "uint",
|
"type": "double",
|
||||||
"unit": "Ampere",
|
"unit": "Ampere",
|
||||||
"minValue": 6,
|
"minValue": 6,
|
||||||
"maxValue": 32,
|
"maxValue": 32,
|
||||||
|
"stepSize": 0.01,
|
||||||
"defaultValue": 6,
|
"defaultValue": 6,
|
||||||
"writable": true
|
"writable": true
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue