From e7775e46efad101df39d9d4b62c5abebc36ed21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Wed, 6 Oct 2021 15:38:50 +0200 Subject: [PATCH 1/8] Keba: set limit for charging current --- keba/integrationpluginkeba.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/keba/integrationpluginkeba.cpp b/keba/integrationpluginkeba.cpp index b9700134..837f3bbf 100644 --- a/keba/integrationpluginkeba.cpp +++ b/keba/integrationpluginkeba.cpp @@ -426,9 +426,8 @@ void IntegrationPluginKeba::onReportTwoReceived(const KeContact::ReportTwo &repo thing->setStateValue(wallboxMaxChargingCurrentPercentStateTypeId, reportTwo.maxCurrentPercentage); // Set the state limits according to the hardware limits - // FIXME: enable limits once landed - //thing->setStateMaxValue(wallboxMaxChargingCurrentStateTypeId, reportTwo.currentHardwareLimitation); - //thing->setStateMaxValue(wallboxMaxChargingCurrentGeneralStateTypeId, reportTwo.currentHardwareLimitation); + thing->setStateMaxValue(wallboxMaxChargingCurrentStateTypeId, reportTwo.currentHardwareLimitation); + thing->setStateMaxValue(wallboxMaxChargingCurrentGeneralStateTypeId, reportTwo.currentHardwareLimitation); thing->setStateValue(wallboxOutputX2StateTypeId, reportTwo.output); thing->setStateValue(wallboxInputStateTypeId, reportTwo.input); From 175143c2ff625b09cade9a4145ce37e5b574b3e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Wed, 20 Oct 2021 15:22:07 +0200 Subject: [PATCH 2/8] Update state, use curr and update to latest interface --- keba/integrationpluginkeba.cpp | 10 +++------- keba/integrationpluginkeba.json | 28 ++++++---------------------- 2 files changed, 9 insertions(+), 29 deletions(-) diff --git a/keba/integrationpluginkeba.cpp b/keba/integrationpluginkeba.cpp index 837f3bbf..355c4203 100644 --- a/keba/integrationpluginkeba.cpp +++ b/keba/integrationpluginkeba.cpp @@ -280,6 +280,8 @@ void IntegrationPluginKeba::setDeviceState(Thing *thing, KeContact::State state) thing->setStateValue(wallboxActivityStateTypeId, "Authorization rejected"); break; } + + thing->setStateValue(wallboxChargingStateTypeId, state == KeContact::StateCharging); } void IntegrationPluginKeba::setDevicePlugState(Thing *thing, KeContact::PlugState plugState) @@ -421,13 +423,11 @@ void IntegrationPluginKeba::onReportTwoReceived(const KeContact::ReportTwo &repo thing->setStateValue(wallboxError2StateTypeId, reportTwo.error2); thing->setStateValue(wallboxSystemEnabledStateTypeId, reportTwo.enableSys); - thing->setStateValue(wallboxMaxChargingCurrentStateTypeId, reportTwo.currTimer); - thing->setStateValue(wallboxMaxChargingCurrentGeneralStateTypeId, reportTwo.currentUser); + thing->setStateValue(wallboxMaxChargingCurrentStateTypeId, reportTwo.currentUser); thing->setStateValue(wallboxMaxChargingCurrentPercentStateTypeId, reportTwo.maxCurrentPercentage); // Set the state limits according to the hardware limits thing->setStateMaxValue(wallboxMaxChargingCurrentStateTypeId, reportTwo.currentHardwareLimitation); - thing->setStateMaxValue(wallboxMaxChargingCurrentGeneralStateTypeId, reportTwo.currentHardwareLimitation); thing->setStateValue(wallboxOutputX2StateTypeId, reportTwo.output); thing->setStateValue(wallboxInputStateTypeId, reportTwo.input); @@ -462,7 +462,6 @@ void IntegrationPluginKeba::onReportThreeReceived(const KeContact::ReportThree & thing->setStateValue(wallboxCurrentPhase1EventTypeId, reportThree.currentPhase1); thing->setStateValue(wallboxCurrentPhase2EventTypeId, reportThree.currentPhase2); thing->setStateValue(wallboxCurrentPhase3EventTypeId, reportThree.currentPhase3); - thing->setStateValue(wallboxCurrentStateTypeId, reportThree.currentPhase1 + reportThree.currentPhase2 + reportThree.currentPhase3); thing->setStateValue(wallboxVoltagePhase1EventTypeId, reportThree.voltagePhase1); thing->setStateValue(wallboxVoltagePhase2EventTypeId, reportThree.voltagePhase2); thing->setStateValue(wallboxVoltagePhase3EventTypeId, reportThree.voltagePhase3); @@ -579,9 +578,6 @@ void IntegrationPluginKeba::executeAction(ThingActionInfo *info) QUuid requestId; if (action.actionTypeId() == wallboxMaxChargingCurrentActionTypeId) { int milliAmpere = action.param(wallboxMaxChargingCurrentActionMaxChargingCurrentParamTypeId).value().toDouble() * 1000; - requestId = keba->setMaxAmpere(milliAmpere); - } else if(action.actionTypeId() == wallboxMaxChargingCurrentGeneralActionTypeId) { - int milliAmpere = action.param(wallboxMaxChargingCurrentGeneralActionMaxChargingCurrentGeneralParamTypeId).value().toDouble() * 1000; requestId = keba->setMaxAmpereGeneral(milliAmpere); } else if(action.actionTypeId() == wallboxPowerActionTypeId) { requestId = keba->enableOutput(action.param(wallboxPowerActionTypeId).value().toBool()); diff --git a/keba/integrationpluginkeba.json b/keba/integrationpluginkeba.json index 4caaccca..fe55cd2a 100644 --- a/keba/integrationpluginkeba.json +++ b/keba/integrationpluginkeba.json @@ -128,14 +128,12 @@ "defaultValue": false }, { - "id": "a29c1748-fe97-4830-a56e-e1cc4e618385", - "name": "current", - "displayName": "Current", - "displayNameEvent": "Current changed", - "type": "double", - "unit": "Ampere", - "defaultValue": 0.00, - "suggestLogging": true + "id": "c9785626-2501-478d-8c18-c42ad5d9a269", + "name": "charging", + "displayName": "Charging", + "displayNameEvent": "Charging changed", + "type": "bool", + "defaultValue": false }, { "id": "593656f0-babf-4308-8767-68f34e10fb15", @@ -151,20 +149,6 @@ "writable": true, "suggestLogging": true }, - { - "id": "da0cfb97-0b27-4d8f-bdf7-45b1ca727038", - "name": "maxChargingCurrentGeneral", - "displayName": "Maximal general charging current", - "displayNameEvent": "Maximal general charging current changed", - "displayNameAction": "Set maximal general charging current", - "type": "double", - "unit": "Ampere", - "defaultValue": 6.0, - "minValue": 6.0, - "maxValue": 32.0, - "writable": true, - "suggestLogging": true - }, { "id": "3c7b83a0-0e42-47bf-9788-dde6aab5ceea", "name": "maxChargingCurrentPercent", From 94be751d248a95091e4adfeb34e7bb23eeff5af7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 21 Oct 2021 09:18:43 +0200 Subject: [PATCH 3/8] Update phase states to common ABC definition --- keba/integrationpluginkeba.cpp | 12 +++++------ keba/integrationpluginkeba.json | 36 ++++++++++++++++----------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/keba/integrationpluginkeba.cpp b/keba/integrationpluginkeba.cpp index 355c4203..b1e492ae 100644 --- a/keba/integrationpluginkeba.cpp +++ b/keba/integrationpluginkeba.cpp @@ -459,12 +459,12 @@ void IntegrationPluginKeba::onReportThreeReceived(const KeContact::ReportThree & qCDebug(dcKeba()) << " - Uptime" << reportThree.seconds/60 << "[min]"; if (reportThree.serialNumber == thing->stateValue(wallboxSerialnumberStateTypeId).toString()) { - thing->setStateValue(wallboxCurrentPhase1EventTypeId, reportThree.currentPhase1); - thing->setStateValue(wallboxCurrentPhase2EventTypeId, reportThree.currentPhase2); - thing->setStateValue(wallboxCurrentPhase3EventTypeId, reportThree.currentPhase3); - thing->setStateValue(wallboxVoltagePhase1EventTypeId, reportThree.voltagePhase1); - thing->setStateValue(wallboxVoltagePhase2EventTypeId, reportThree.voltagePhase2); - thing->setStateValue(wallboxVoltagePhase3EventTypeId, reportThree.voltagePhase3); + thing->setStateValue(wallboxCurrentPhaseAEventTypeId, reportThree.currentPhase1); + thing->setStateValue(wallboxCurrentPhaseBEventTypeId, reportThree.currentPhase2); + thing->setStateValue(wallboxCurrentPhaseCEventTypeId, reportThree.currentPhase3); + thing->setStateValue(wallboxVoltagePhaseAEventTypeId, reportThree.voltagePhase1); + thing->setStateValue(wallboxVoltagePhaseBEventTypeId, reportThree.voltagePhase2); + thing->setStateValue(wallboxVoltagePhaseCEventTypeId, reportThree.voltagePhase3); thing->setStateValue(wallboxCurrentPowerStateTypeId, reportThree.power); thing->setStateValue(wallboxSessionEnergyStateTypeId, reportThree.energySession); thing->setStateValue(wallboxPowerFactorStateTypeId, reportThree.powerFactor); diff --git a/keba/integrationpluginkeba.json b/keba/integrationpluginkeba.json index fe55cd2a..08058dbb 100644 --- a/keba/integrationpluginkeba.json +++ b/keba/integrationpluginkeba.json @@ -163,36 +163,36 @@ }, { "id": "4a2d75d8-a3a0-4b40-9ca7-e8b6f11d0ef9", - "name": "voltagePhase1", - "displayName": "Voltage phase 1", - "displayNameEvent": "Voltage phase 1 changed", + "name": "voltagePhaseA", + "displayName": "Voltage phase A", + "displayNameEvent": "Voltage phase A changed", "type": "int", "unit": "Volt", "defaultValue": 0 }, { "id": "c8344ca5-21ac-4cd1-8f4b-e5ed202c5862", - "name": "voltagePhase2", - "displayName": "Voltage phase 2", - "displayNameEvent": "Voltage phase 2 changed", + "name": "voltagePhaseB", + "displayName": "Voltage phase B", + "displayNameEvent": "Voltage phase B changed", "type": "int", "unit": "Volt", "defaultValue": 0 }, { "id": "5f01e86c-0943-4849-a01a-db441916ebd5", - "name": "voltagePhase3", - "displayName": "Voltage phase 3", - "displayNameEvent": "Voltage phase 3 changed", + "name": "voltagePhaseC", + "displayName": "Voltage phase C", + "displayNameEvent": "Voltage phase C changed", "type": "int", "unit": "Volt", "defaultValue": 0 }, { "id": "31ec17b0-11e3-4332-92b0-fea821cf024f", - "name": "currentPhase1", - "displayName": "Current phase 1", - "displayNameEvent": "Current phase 1 changed", + "name": "currentPhaseA", + "displayName": "Current phase A", + "displayNameEvent": "Current phase A changed", "type": "double", "unit": "Ampere", "defaultValue": 0.00, @@ -200,9 +200,9 @@ }, { "id": "cdc7e10a-0d0a-4e93-ad2c-d34ffca45c97", - "name": "currentPhase2", - "displayName": "Current phase 2", - "displayNameEvent": "Current phase 2 changed", + "name": "currentPhaseB", + "displayName": "Current phase B", + "displayNameEvent": "Current phase B changed", "type": "double", "unit": "Ampere", "defaultValue": 0.00, @@ -210,9 +210,9 @@ }, { "id": "da838dc8-85f0-4e55-b4b5-cb93a43b373d", - "name": "currentPhase3", - "displayName": "Current phase 3", - "displayNameEvent": "Current phase 3 changed", + "name": "currentPhaseC", + "displayName": "Current phase C", + "displayNameEvent": "Current phase C changed", "type": "double", "unit": "Ampere", "defaultValue": 0.00, From f7fde95e7679e282d67971a84dbeeedac32db8d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Fri, 22 Oct 2021 12:34:53 +0200 Subject: [PATCH 4/8] Add phase count state according to updated evcharger interface --- keba/integrationpluginkeba.cpp | 20 ++++++++++++++++++++ keba/integrationpluginkeba.json | 11 ++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/keba/integrationpluginkeba.cpp b/keba/integrationpluginkeba.cpp index b1e492ae..978d9332 100644 --- a/keba/integrationpluginkeba.cpp +++ b/keba/integrationpluginkeba.cpp @@ -458,6 +458,26 @@ void IntegrationPluginKeba::onReportThreeReceived(const KeContact::ReportThree & qCDebug(dcKeba()) << " - Serial number" << reportThree.serialNumber; qCDebug(dcKeba()) << " - Uptime" << reportThree.seconds/60 << "[min]"; + // Check how many phases are connected + if (reportThree.voltagePhase1 == 0 && reportThree.voltagePhase2 == 0 && reportThree.voltagePhase3 == 0) { + // Note: if not charging, all voltage values are 0, only set the phase count if any voltage gets reported. + } else { + uint phaseCount = 0; + if (reportThree.voltagePhase1 > 0) { + phaseCount += 1; + } + + if (reportThree.voltagePhase2 > 0) { + phaseCount += 1; + } + + if (reportThree.voltagePhase3 > 0) { + phaseCount += 1; + } + + thing->setStateValue(wallboxPhaseCountStateTypeId, phaseCount); + } + if (reportThree.serialNumber == thing->stateValue(wallboxSerialnumberStateTypeId).toString()) { thing->setStateValue(wallboxCurrentPhaseAEventTypeId, reportThree.currentPhase1); thing->setStateValue(wallboxCurrentPhaseBEventTypeId, reportThree.currentPhase2); diff --git a/keba/integrationpluginkeba.json b/keba/integrationpluginkeba.json index 08058dbb..987ad649 100644 --- a/keba/integrationpluginkeba.json +++ b/keba/integrationpluginkeba.json @@ -83,7 +83,6 @@ "type": "QString", "defaultValue": "" }, - { "id": "83ed0774-2a91-434d-b03c-d920d02f2981", "name": "power", @@ -103,6 +102,16 @@ "type": "bool", "defaultValue": false }, + { + "id": "6713b2e7-41b3-4596-a304-3065726bdbe4", + "name": "phaseCount", + "displayName": "Number of connected phases", + "displayNameEvent": "Number of connected phases changed", + "type": "uint", + "minValue": 1, + "maxValue": 3, + "defaultValue": 1 + }, { "id": "539e5602-6dd9-465d-9705-3bb59bcf8982", "name": "activity", From 3e5c6796a1b8784be3e27b608b1f9b02002047b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Fri, 22 Oct 2021 14:51:47 +0200 Subject: [PATCH 5/8] Update keba phase counting --- keba/integrationpluginkeba.cpp | 37 +++++++++++++++------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/keba/integrationpluginkeba.cpp b/keba/integrationpluginkeba.cpp index 978d9332..28ce173a 100644 --- a/keba/integrationpluginkeba.cpp +++ b/keba/integrationpluginkeba.cpp @@ -456,27 +456,7 @@ void IntegrationPluginKeba::onReportThreeReceived(const KeContact::ReportThree & qCDebug(dcKeba()) << " - Energy session" << reportThree.energySession << "[kWh]"; qCDebug(dcKeba()) << " - Energy total" << reportThree.energyTotal << "[kWh]"; qCDebug(dcKeba()) << " - Serial number" << reportThree.serialNumber; - qCDebug(dcKeba()) << " - Uptime" << reportThree.seconds/60 << "[min]"; - - // Check how many phases are connected - if (reportThree.voltagePhase1 == 0 && reportThree.voltagePhase2 == 0 && reportThree.voltagePhase3 == 0) { - // Note: if not charging, all voltage values are 0, only set the phase count if any voltage gets reported. - } else { - uint phaseCount = 0; - if (reportThree.voltagePhase1 > 0) { - phaseCount += 1; - } - - if (reportThree.voltagePhase2 > 0) { - phaseCount += 1; - } - - if (reportThree.voltagePhase3 > 0) { - phaseCount += 1; - } - - thing->setStateValue(wallboxPhaseCountStateTypeId, phaseCount); - } + qCDebug(dcKeba()) << " - Uptime" << reportThree.seconds / 60 << "[min]"; if (reportThree.serialNumber == thing->stateValue(wallboxSerialnumberStateTypeId).toString()) { thing->setStateValue(wallboxCurrentPhaseAEventTypeId, reportThree.currentPhase1); @@ -489,6 +469,21 @@ void IntegrationPluginKeba::onReportThreeReceived(const KeContact::ReportThree & thing->setStateValue(wallboxSessionEnergyStateTypeId, reportThree.energySession); thing->setStateValue(wallboxPowerFactorStateTypeId, reportThree.powerFactor); thing->setStateValue(wallboxTotalEnergyConsumedStateTypeId, reportThree.energyTotal); + + // Check how many phases are actually charging, and update the phase count only if something happens on the phases (current or power) + if (!(reportThree.currentPhase1 == 0 && reportThree.currentPhase2 == 0 && reportThree.currentPhase3 == 0)) { + uint phaseCount = 0; + if (reportThree.currentPhase1 != 0) + phaseCount += 1; + + if (reportThree.currentPhase2 != 0) + phaseCount += 1; + + if (reportThree.currentPhase3 != 0) + phaseCount += 1; + + thing->setStateValue(wallboxPhaseCountStateTypeId, phaseCount); + } } else { qCWarning(dcKeba()) << "Received report but the serial number didn't match"; } From 49e55afefceb0348184ed9b53b9be9c16e451119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 28 Oct 2021 08:29:17 +0200 Subject: [PATCH 6/8] Update charging current to uint and add duplicated ip check --- keba/integrationpluginkeba.cpp | 12 ++++++++++-- keba/integrationpluginkeba.json | 8 ++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/keba/integrationpluginkeba.cpp b/keba/integrationpluginkeba.cpp index 28ce173a..64fdebae 100644 --- a/keba/integrationpluginkeba.cpp +++ b/keba/integrationpluginkeba.cpp @@ -127,6 +127,14 @@ void IntegrationPluginKeba::setupThing(ThingSetupInfo *info) QHostAddress address = QHostAddress(thing->paramValue(wallboxThingIpAddressParamTypeId).toString()); + // Check if we have a keba with this ip, if reconfigure the object would already been removed from the hash + foreach (KeContact *kebaConnect, m_kebaDevices.values()) { + if (kebaConnect->address() == address) { + qCWarning(dcKeba()) << "Failed to set up keba for host address" << address.toString() << "because there has already been configured a keba for this ip."; + return info->finish(Thing::ThingErrorThingInUse, QT_TR_NOOP("Already configured for this IP address.")); + } + } + KeContact *keba = new KeContact(address, m_kebaDataLayer, this); connect(keba, &KeContact::reachableChanged, this, &IntegrationPluginKeba::onConnectionChanged); connect(keba, &KeContact::commandExecuted, this, &IntegrationPluginKeba::onCommandExecuted); @@ -423,7 +431,7 @@ void IntegrationPluginKeba::onReportTwoReceived(const KeContact::ReportTwo &repo thing->setStateValue(wallboxError2StateTypeId, reportTwo.error2); thing->setStateValue(wallboxSystemEnabledStateTypeId, reportTwo.enableSys); - thing->setStateValue(wallboxMaxChargingCurrentStateTypeId, reportTwo.currentUser); + thing->setStateValue(wallboxMaxChargingCurrentStateTypeId, qRound(reportTwo.currentUser)); thing->setStateValue(wallboxMaxChargingCurrentPercentStateTypeId, reportTwo.maxCurrentPercentage); // Set the state limits according to the hardware limits @@ -592,7 +600,7 @@ void IntegrationPluginKeba::executeAction(ThingActionInfo *info) QUuid requestId; if (action.actionTypeId() == wallboxMaxChargingCurrentActionTypeId) { - int milliAmpere = action.param(wallboxMaxChargingCurrentActionMaxChargingCurrentParamTypeId).value().toDouble() * 1000; + int milliAmpere = action.param(wallboxMaxChargingCurrentActionMaxChargingCurrentParamTypeId).value().toUInt() * 1000; requestId = keba->setMaxAmpereGeneral(milliAmpere); } else if(action.actionTypeId() == wallboxPowerActionTypeId) { requestId = keba->enableOutput(action.param(wallboxPowerActionTypeId).value().toBool()); diff --git a/keba/integrationpluginkeba.json b/keba/integrationpluginkeba.json index 987ad649..1b6f86e0 100644 --- a/keba/integrationpluginkeba.json +++ b/keba/integrationpluginkeba.json @@ -150,11 +150,11 @@ "displayName": "Maximal charging current", "displayNameEvent": "Maximal charging current changed", "displayNameAction": "Set maximal charging current", - "type": "double", + "type": "uint", "unit": "Ampere", - "defaultValue": 6.0, - "minValue": 6.0, - "maxValue": 32.0, + "defaultValue": 6, + "minValue": 6, + "maxValue": 32, "writable": true, "suggestLogging": true }, From cd79bb517f5653ca89f1fa6d71ae3ada59e32a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 4 Nov 2021 13:18:01 +0100 Subject: [PATCH 7/8] Fix max charging current if keba retuns 0 for hardware limit --- keba/integrationpluginkeba.cpp | 10 +++++++--- keba/integrationpluginkeba.json | 35 ++++++++++++++++----------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/keba/integrationpluginkeba.cpp b/keba/integrationpluginkeba.cpp index 64fdebae..370e9728 100644 --- a/keba/integrationpluginkeba.cpp +++ b/keba/integrationpluginkeba.cpp @@ -157,7 +157,7 @@ void IntegrationPluginKeba::setupThing(ThingSetupInfo *info) thing->setStateValue(wallboxFirmwareStateTypeId, report.firmware); thing->setStateValue(wallboxSerialnumberStateTypeId, report.serialNumber); thing->setStateValue(wallboxModelStateTypeId, report.product); - thing->setStateValue(wallboxUptimeStateTypeId, report.seconds/60); + thing->setStateValue(wallboxUptimeStateTypeId, report.seconds / 60); m_kebaDevices.insert(thing->id(), keba); info->finish(Thing::ThingErrorNoError); @@ -435,8 +435,12 @@ void IntegrationPluginKeba::onReportTwoReceived(const KeContact::ReportTwo &repo thing->setStateValue(wallboxMaxChargingCurrentPercentStateTypeId, reportTwo.maxCurrentPercentage); // Set the state limits according to the hardware limits - thing->setStateMaxValue(wallboxMaxChargingCurrentStateTypeId, reportTwo.currentHardwareLimitation); - + if (reportTwo.currentHardwareLimitation > 0) { + thing->setStateMaxValue(wallboxMaxChargingCurrentStateTypeId, reportTwo.currentHardwareLimitation); + } else { + // If we have no limit given, reset to the statetype limit + thing->setStateMaxValue(wallboxMaxChargingCurrentStateTypeId, thing->thingClass().getStateType(wallboxMaxChargingCurrentStateTypeId).maxValue()); + } thing->setStateValue(wallboxOutputX2StateTypeId, reportTwo.output); thing->setStateValue(wallboxInputStateTypeId, reportTwo.input); diff --git a/keba/integrationpluginkeba.json b/keba/integrationpluginkeba.json index 1b6f86e0..0b35bff6 100644 --- a/keba/integrationpluginkeba.json +++ b/keba/integrationpluginkeba.json @@ -43,22 +43,6 @@ "defaultValue": false, "cached": false }, - { - "id": "b44bc948-1234-4f87-9a22-bfb6de09df4d", - "name": "error1", - "displayName": "Error 1", - "displayNameEvent": "Error 1 changed", - "type": "int", - "defaultValue": 0 - }, - { - "id": "afca201a-5213-43fe-bfec-cae6ce7509d2", - "name": "error2", - "displayName": "Error 2", - "displayNameEvent": "Error 2 changed", - "type": "int", - "defaultValue": 0 - }, { "id": "c3fca233-95b9-4948-88c6-4c0f13cf53b1", "name": "model", @@ -167,8 +151,7 @@ "unit": "Percentage", "defaultValue": 100, "minValue": 0, - "maxValue": 100, - "suggestLogging": true + "maxValue": 100 }, { "id": "4a2d75d8-a3a0-4b40-9ca7-e8b6f11d0ef9", @@ -310,6 +293,22 @@ "unit": "Minutes", "defaultValue": 0 }, + { + "id": "b44bc948-1234-4f87-9a22-bfb6de09df4d", + "name": "error1", + "displayName": "Error 1", + "displayNameEvent": "Error 1 changed", + "type": "int", + "defaultValue": 0 + }, + { + "id": "afca201a-5213-43fe-bfec-cae6ce7509d2", + "name": "error2", + "displayName": "Error 2", + "displayNameEvent": "Error 2 changed", + "type": "int", + "defaultValue": 0 + }, { "id": "f1758c5c-2c02-41cb-93ec-b778a3c78d28", "name": "failsafeMode", From 9e1780c5c40fb0f17d28edb4ef1ea68bfd969225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 4 Nov 2021 13:22:43 +0100 Subject: [PATCH 8/8] Show theoretical hardware limit for the charging current --- keba/integrationpluginkeba.cpp | 1 + keba/integrationpluginkeba.json | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/keba/integrationpluginkeba.cpp b/keba/integrationpluginkeba.cpp index 370e9728..80209bb8 100644 --- a/keba/integrationpluginkeba.cpp +++ b/keba/integrationpluginkeba.cpp @@ -433,6 +433,7 @@ void IntegrationPluginKeba::onReportTwoReceived(const KeContact::ReportTwo &repo thing->setStateValue(wallboxMaxChargingCurrentStateTypeId, qRound(reportTwo.currentUser)); thing->setStateValue(wallboxMaxChargingCurrentPercentStateTypeId, reportTwo.maxCurrentPercentage); + thing->setStateValue(wallboxMaxChargingCurrentHardwareStateTypeId, reportTwo.currentHardwareLimitation); // Set the state limits according to the hardware limits if (reportTwo.currentHardwareLimitation > 0) { diff --git a/keba/integrationpluginkeba.json b/keba/integrationpluginkeba.json index 0b35bff6..9cf84009 100644 --- a/keba/integrationpluginkeba.json +++ b/keba/integrationpluginkeba.json @@ -153,6 +153,16 @@ "minValue": 0, "maxValue": 100 }, + { + "id": "33e2ed95-f01e-44db-8156-34d124a8ecc8", + "name": "maxChargingCurrentHardware", + "displayName": "Maximal hardware charging current", + "displayNameEvent": "Maximal hardware charging current changed", + "type": "uint", + "unit": "Ampere", + "defaultValue": 32, + "suggestLogging": true + }, { "id": "4a2d75d8-a3a0-4b40-9ca7-e8b6f11d0ef9", "name": "voltagePhaseA",