From b0398236949ef69b15a3effe59b5716098238e32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Wed, 6 Oct 2021 15:40:14 +0200 Subject: [PATCH 1/9] goECharger: set limit for charging current --- goecharger/integrationplugingoecharger.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/goecharger/integrationplugingoecharger.cpp b/goecharger/integrationplugingoecharger.cpp index 2d9c2cc4..c355db9c 100644 --- a/goecharger/integrationplugingoecharger.cpp +++ b/goecharger/integrationplugingoecharger.cpp @@ -360,8 +360,7 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status uint cableLimit = statusMap.value("cbl").toUInt(); // Set the limit for the max charging amps - // FIXME: set the max value for the state to limit - //thing->setStateMaxValue(goeHomeMaxChargingCurrentStateTypeId, qMin(amaLimit, cableLimit)); + thing->setStateMaxValue(goeHomeMaxChargingCurrentStateTypeId, qMin(amaLimit, cableLimit)); thing->setStateValue(goeHomeAbsoluteMaxAmpereStateTypeId, amaLimit); thing->setStateValue(goeHomeCableType2AmpereStateTypeId, cableLimit); From 312a9504e4f87c375187109663601d6137490e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Wed, 20 Oct 2021 15:55:10 +0200 Subject: [PATCH 2/9] Update interfaces and fix units --- goecharger/integrationplugingoecharger.cpp | 34 ++++++++++++++++----- goecharger/integrationplugingoecharger.json | 20 +++++++++++- 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/goecharger/integrationplugingoecharger.cpp b/goecharger/integrationplugingoecharger.cpp index c355db9c..e4d24cf1 100644 --- a/goecharger/integrationplugingoecharger.cpp +++ b/goecharger/integrationplugingoecharger.cpp @@ -208,6 +208,8 @@ void IntegrationPluginGoECharger::executeAction(ThingActionInfo *info) } else if (action.actionTypeId() == goeHomeMaxChargingCurrentActionTypeId) { uint maxChargingCurrent = action.paramValue(goeHomeMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toUInt(); qCDebug(dcGoECharger()) << "Setting max charging current to" << maxChargingCurrent << "A"; + // FIXME: check if we can use amx since it is better for pc charging, not all version seen implement amx + // Maybe check if the user sets it or a rule / hems logic // Set the allow value QString configuration = QString("amp=%1").arg(maxChargingCurrent); sendActionRequest(thing, info, configuration); @@ -318,6 +320,8 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status break; } + thing->setStateValue(goeHomeChargingStateTypeId, carState == CarStateCharging); + Access accessStatus = static_cast(statusMap.value("ast").toUInt()); switch (accessStatus) { case AccessOpen: @@ -350,6 +354,7 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status thing->setStateValue(goeHomeUpdateAvailableStateTypeId, (statusMap.value("upd").toUInt() == 0 ? false : true)); thing->setStateValue(goeHomeCloudStateTypeId, (statusMap.value("cdi").toUInt() == 0 ? false : true)); thing->setStateValue(goeHomeFirmwareVersionStateTypeId, statusMap.value("fwv").toString()); + // FIXME: check if we can use amx since it is better for pc charging, not all version seen implement this thing->setStateValue(goeHomeMaxChargingCurrentStateTypeId, statusMap.value("amp").toUInt()); thing->setStateValue(goeHomeLedBrightnessStateTypeId, statusMap.value("lbr").toUInt()); thing->setStateValue(goeHomeLedEnergySaveStateTypeId, statusMap.value("lse").toBool()); @@ -359,12 +364,12 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status uint amaLimit = statusMap.value("ama").toUInt(); uint cableLimit = statusMap.value("cbl").toUInt(); - // Set the limit for the max charging amps - thing->setStateMaxValue(goeHomeMaxChargingCurrentStateTypeId, qMin(amaLimit, cableLimit)); - thing->setStateValue(goeHomeAbsoluteMaxAmpereStateTypeId, amaLimit); thing->setStateValue(goeHomeCableType2AmpereStateTypeId, cableLimit); + // Set the limit for the max charging amps + thing->setStateMaxValue(goeHomeMaxChargingCurrentStateTypeId, qMin(amaLimit, cableLimit)); + // Parse nrg array QVariantList measurementList = statusMap.value("nrg").toList(); if (measurementList.count() >= 1) @@ -376,9 +381,9 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status if (measurementList.count() >= 3) thing->setStateValue(goeHomeVoltagePhaseCStateTypeId, measurementList.at(2).toUInt()); - if (measurementList.count() >= 5) + if (measurementList.count() >= 5) { thing->setStateValue(goeHomeCurrentPhaseAStateTypeId, measurementList.at(4).toUInt() / 10.0); - else { + } else { thing->setStateValue(goeHomeCurrentPhaseAStateTypeId, 0); thing->setStateValue(goeHomeCurrentPhaseBStateTypeId, 0); thing->setStateValue(goeHomeCurrentPhaseCStateTypeId, 0); @@ -386,6 +391,7 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, 0); thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, 0); thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerStateTypeId, 0); } if (measurementList.count() >= 6) { @@ -397,6 +403,7 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, 0); thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, 0); thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerStateTypeId, 0); } if (measurementList.count() >= 7) { @@ -407,26 +414,37 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, 0); thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, 0); thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerStateTypeId, 0); } if (measurementList.count() >= 8) { - thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, measurementList.at(7).toUInt() / 10.0); + thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, measurementList.at(7).toUInt() * 100.0); // 0.1kW -> W } else { thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, 0); thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, 0); thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerStateTypeId, 0); } if (measurementList.count() >= 9) { - thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, measurementList.at(8).toUInt() / 10.0); + thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, measurementList.at(8).toUInt() * 100.0); // 0.1kW -> W } else { thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, 0); thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerStateTypeId, 0); } + if (measurementList.count() >= 10) { - thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, measurementList.at(9).toUInt() / 10.0); + thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, measurementList.at(9).toUInt() * 100.0); // 0.1kW -> W } else { thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerStateTypeId, 0); + } + + if (measurementList.count() >= 11) { + thing->setStateValue(goeHomeCurrentPowerStateTypeId, measurementList.at(11).toUInt() * 10.0); // 0.01kW -> W + } else { + thing->setStateValue(goeHomeCurrentPowerStateTypeId, 0); } } } diff --git a/goecharger/integrationplugingoecharger.json b/goecharger/integrationplugingoecharger.json index c19126b2..406b1a99 100644 --- a/goecharger/integrationplugingoecharger.json +++ b/goecharger/integrationplugingoecharger.json @@ -13,7 +13,7 @@ "displayName": "go-eCharger Home", "id": "3b663d51-fdb5-4944-b409-c07f7933877e", "createMethods": ["Discovery", "User"], - "interfaces": ["evcharger", "smartmeterconsumer", "connectable"], + "interfaces": ["evcharger", "connectable"], "paramTypes": [ { "id": "4342b72c-99d0-41a5-abc6-ea6c1cc1352c", @@ -68,6 +68,14 @@ "type": "bool", "defaultValue": false }, + { + "id": "48c6cdb8-9fc1-4c14-95df-3e2c62e59361", + "name": "charging", + "displayName": "Charging", + "displayNameEvent": "Charging changed", + "type": "bool", + "defaultValue": false + }, { "id": "d80e1ed8-c3ae-4b68-bf86-21b4d7b2b201", "name": "access", @@ -175,6 +183,16 @@ "defaultValue": 0.0, "suggestLogging": true }, + { + "id": "4b909ca1-3f62-406a-adc6-9b312e014741", + "name": "currentPower", + "displayName": "Current power", + "displayNameEvent": "Current power changed", + "type": "double", + "unit": "Watt", + "defaultValue": 0.00, + "filter": "adaptive" + }, { "id": "c6f68517-c4cd-415d-9455-b1731f7d9a1a", "name": "currentPowerPhaseA", From 1e65edb2a0fe5122504a30909ff2badd4d651aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Fri, 22 Oct 2021 07:12:20 +0200 Subject: [PATCH 3/9] Update UUID of current power --- goecharger/integrationplugingoecharger.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goecharger/integrationplugingoecharger.json b/goecharger/integrationplugingoecharger.json index 406b1a99..09a09541 100644 --- a/goecharger/integrationplugingoecharger.json +++ b/goecharger/integrationplugingoecharger.json @@ -184,7 +184,7 @@ "suggestLogging": true }, { - "id": "4b909ca1-3f62-406a-adc6-9b312e014741", + "id": "f00cfcab-9271-48fa-b843-89244c9551ae", "name": "currentPower", "displayName": "Current power", "displayNameEvent": "Current power changed", From 0b57fb32e83fe991f92ae194832775195c5cf63b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Fri, 22 Oct 2021 14:45:47 +0200 Subject: [PATCH 4/9] Add phase count calculation and update sessionEnergy to interface --- goecharger/integrationplugingoecharger.cpp | 105 +++++++++----------- goecharger/integrationplugingoecharger.json | 16 ++- 2 files changed, 59 insertions(+), 62 deletions(-) diff --git a/goecharger/integrationplugingoecharger.cpp b/goecharger/integrationplugingoecharger.cpp index e4d24cf1..646206fa 100644 --- a/goecharger/integrationplugingoecharger.cpp +++ b/goecharger/integrationplugingoecharger.cpp @@ -349,7 +349,7 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status thing->setStateValue(goeHomeTemperatureSensor4StateTypeId, temperatureSensorList.at(3).toDouble()); thing->setStateValue(goeHomeTotalEnergyConsumedStateTypeId, statusMap.value("eto").toUInt() / 10.0); - thing->setStateValue(goeHomeChargeEnergyStateTypeId, statusMap.value("dws").toUInt() / 360000.0); + thing->setStateValue(goeHomeSessionEnergyStateTypeId, statusMap.value("dws").toUInt() / 360000.0); thing->setStateValue(goeHomePowerStateTypeId, (statusMap.value("alw").toUInt() == 0 ? false : true)); thing->setStateValue(goeHomeUpdateAvailableStateTypeId, (statusMap.value("upd").toUInt() == 0 ? false : true)); thing->setStateValue(goeHomeCloudStateTypeId, (statusMap.value("cdi").toUInt() == 0 ? false : true)); @@ -371,80 +371,67 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status thing->setStateMaxValue(goeHomeMaxChargingCurrentStateTypeId, qMin(amaLimit, cableLimit)); // Parse nrg array + uint voltagePhaseA = 0; uint voltagePhaseB = 0; uint voltagePhaseC = 0; + double amperePhaseA = 0; double amperePhaseB = 0; double amperePhaseC = 0; + double currentPower = 0; double powerPhaseA = 0; double powerPhaseB = 0; double powerPhaseC = 0; + QVariantList measurementList = statusMap.value("nrg").toList(); if (measurementList.count() >= 1) - thing->setStateValue(goeHomeVoltagePhaseAStateTypeId, measurementList.at(0).toUInt()); + voltagePhaseA = measurementList.at(0).toUInt(); if (measurementList.count() >= 2) - thing->setStateValue(goeHomeVoltagePhaseBStateTypeId, measurementList.at(1).toUInt()); + voltagePhaseB = measurementList.at(1).toUInt(); if (measurementList.count() >= 3) - thing->setStateValue(goeHomeVoltagePhaseCStateTypeId, measurementList.at(2).toUInt()); + voltagePhaseC = measurementList.at(2).toUInt(); - if (measurementList.count() >= 5) { - thing->setStateValue(goeHomeCurrentPhaseAStateTypeId, measurementList.at(4).toUInt() / 10.0); - } else { - thing->setStateValue(goeHomeCurrentPhaseAStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPhaseBStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPhaseCStateTypeId, 0); + if (measurementList.count() >= 5) + amperePhaseA = measurementList.at(4).toUInt() / 10.0; // 0,1 A value 123 -> 12,3 A - thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPowerStateTypeId, 0); - } + if (measurementList.count() >= 6) + amperePhaseB = measurementList.at(5).toUInt() / 10.0; // 0,1 A value 123 -> 12,3 A - if (measurementList.count() >= 6) { - thing->setStateValue(goeHomeCurrentPhaseBStateTypeId, measurementList.at(5).toUInt() / 10.0); - } else { - thing->setStateValue(goeHomeCurrentPhaseBStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPhaseCStateTypeId, 0); + if (measurementList.count() >= 7) + amperePhaseC = measurementList.at(6).toUInt() / 10.0; // 0,1 A value 123 -> 12,3 A - thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPowerStateTypeId, 0); - } + if (measurementList.count() >= 8) + powerPhaseA = measurementList.at(7).toUInt() * 100.0; // 0.1kW -> W - if (measurementList.count() >= 7) { - thing->setStateValue(goeHomeCurrentPhaseCStateTypeId, measurementList.at(6).toUInt() / 10.0); - } else { - thing->setStateValue(goeHomeCurrentPhaseCStateTypeId, 0); + if (measurementList.count() >= 9) + powerPhaseB = measurementList.at(8).toUInt() * 100.0; // 0.1kW -> W - thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPowerStateTypeId, 0); - } + if (measurementList.count() >= 10) + powerPhaseC = measurementList.at(9).toUInt() * 100.0; // 0.1kW -> W - if (measurementList.count() >= 8) { - thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, measurementList.at(7).toUInt() * 100.0); // 0.1kW -> W - } else { - thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPowerStateTypeId, 0); - } + if (measurementList.count() >= 12) + currentPower = measurementList.at(11).toUInt() * 10.0; // 0.01kW -> W - if (measurementList.count() >= 9) { - thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, measurementList.at(8).toUInt() * 100.0); // 0.1kW -> W - } else { - thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPowerStateTypeId, 0); - } + // Update all states + thing->setStateValue(goeHomeVoltagePhaseAStateTypeId, voltagePhaseA); + thing->setStateValue(goeHomeVoltagePhaseBStateTypeId, voltagePhaseB); + thing->setStateValue(goeHomeVoltagePhaseCStateTypeId, voltagePhaseC); + thing->setStateValue(goeHomeCurrentPhaseAStateTypeId, amperePhaseA); + thing->setStateValue(goeHomeCurrentPhaseBStateTypeId, amperePhaseB); + thing->setStateValue(goeHomeCurrentPhaseCStateTypeId, amperePhaseC); + thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, powerPhaseA); + thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, powerPhaseB); + thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, powerPhaseC); - if (measurementList.count() >= 10) { - thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, measurementList.at(9).toUInt() * 100.0); // 0.1kW -> W - } else { - thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); - thing->setStateValue(goeHomeCurrentPowerStateTypeId, 0); - } + thing->setStateValue(goeHomeCurrentPowerStateTypeId, currentPower); - if (measurementList.count() >= 11) { - thing->setStateValue(goeHomeCurrentPowerStateTypeId, measurementList.at(11).toUInt() * 10.0); // 0.01kW -> W - } else { - thing->setStateValue(goeHomeCurrentPowerStateTypeId, 0); + // Check how many phases are actually charging, and update the phase count only if something happens on the phases (current or power) + if (!(amperePhaseA == 0 && amperePhaseB == 0 && amperePhaseC == 0)) { + uint phaseCount = 0; + if (amperePhaseA != 0) + phaseCount += 1; + + if (amperePhaseB != 0) + phaseCount += 1; + + if (amperePhaseC != 0) + phaseCount += 1; + + thing->setStateValue(goeHomePhaseCountStateTypeId, phaseCount); } } } diff --git a/goecharger/integrationplugingoecharger.json b/goecharger/integrationplugingoecharger.json index 09a09541..7ac2d679 100644 --- a/goecharger/integrationplugingoecharger.json +++ b/goecharger/integrationplugingoecharger.json @@ -175,9 +175,9 @@ }, { "id": "e8258831-ad89-4d27-b295-e8c10dd42b76", - "name": "chargeEnergy", - "displayName": "Charge energy", - "displayNameEvent": "Charge energy changed", + "name": "sessionEnergy", + "displayName": "Session energy", + "displayNameEvent": "Session energy changed", "type": "double", "unit": "KiloWattHour", "defaultValue": 0.0, @@ -283,6 +283,16 @@ "defaultValue": 0.00, "filter": "adaptive" }, + { + "id": "b78d805a-f97c-4c9d-a647-5fc98f8d6dd1", + "name": "phaseCount", + "displayName": "Number of charging phases", + "displayNameEvent": "Number of charging phases changed", + "type": "uint", + "minValue": 1, + "maxValue": 3, + "defaultValue": 1 + }, { "id": "b06479d5-7a38-4fbd-867e-e55bdb54651b", "name": "ledBrightness", From ee30d86f944082c3024384a4ea5e04fb698a59bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 28 Oct 2021 08:09:21 +0200 Subject: [PATCH 5/9] Update max charging current data type to uint --- goecharger/integrationplugingoecharger.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goecharger/integrationplugingoecharger.json b/goecharger/integrationplugingoecharger.json index 7ac2d679..d71d4b9b 100644 --- a/goecharger/integrationplugingoecharger.json +++ b/goecharger/integrationplugingoecharger.json @@ -106,7 +106,7 @@ "displayName": "Charging current", "displayNameEvent": "Charging current changed", "displayNameAction": "Set charging current", - "type": "double", + "type": "uint", "unit": "Ampere", "minValue": 6, "maxValue": 32, From 7c4a21c006a2b3183e608ef3dde8ddac2d62d292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Fri, 3 Dec 2021 12:50:48 +0100 Subject: [PATCH 6/9] Fix max settings if no cable connected and improve discovery result texts --- goecharger/integrationplugingoecharger.cpp | 14 +++++++++----- goecharger/integrationplugingoecharger.json | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/goecharger/integrationplugingoecharger.cpp b/goecharger/integrationplugingoecharger.cpp index 646206fa..556ad26b 100644 --- a/goecharger/integrationplugingoecharger.cpp +++ b/goecharger/integrationplugingoecharger.cpp @@ -60,7 +60,7 @@ void IntegrationPluginGoECharger::discoverThings(ThingDiscoveryInfo *info) qCDebug(dcGoECharger()) << "Checking discovered" << networkDeviceInfo; // Filter by hostname - if (!networkDeviceInfo.hostName().contains("go-eCharger")) + if (!networkDeviceInfo.hostName().toLower().contains("go-echarger")) continue; // We need also the mac address @@ -71,14 +71,14 @@ void IntegrationPluginGoECharger::discoverThings(ThingDiscoveryInfo *info) if (networkDeviceInfo.hostName().isEmpty()) { title = networkDeviceInfo.address().toString(); } else { - title = "go-eCharger (" + networkDeviceInfo.address().toString() + ")"; + title = "go-eCharger"; } QString description; if (networkDeviceInfo.macAddressManufacturer().isEmpty()) { - description = networkDeviceInfo.macAddress(); + description = networkDeviceInfo.address().toString(); } else { - description = networkDeviceInfo.macAddress() + " (" + networkDeviceInfo.macAddressManufacturer() + ")"; + description = networkDeviceInfo.address().toString() + " (" + networkDeviceInfo.macAddressManufacturer() + ")"; } ThingDescriptor descriptor(goeHomeThingClassId, title, description); @@ -368,7 +368,11 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status thing->setStateValue(goeHomeCableType2AmpereStateTypeId, cableLimit); // Set the limit for the max charging amps - thing->setStateMaxValue(goeHomeMaxChargingCurrentStateTypeId, qMin(amaLimit, cableLimit)); + if (cableLimit != 0) { + thing->setStateMaxValue(goeHomeMaxChargingCurrentStateTypeId, qMin(amaLimit, cableLimit)); + } else { + thing->setStateMaxValue(goeHomeMaxChargingCurrentStateTypeId, amaLimit); + } // Parse nrg array uint voltagePhaseA = 0; uint voltagePhaseB = 0; uint voltagePhaseC = 0; diff --git a/goecharger/integrationplugingoecharger.json b/goecharger/integrationplugingoecharger.json index d71d4b9b..91d99714 100644 --- a/goecharger/integrationplugingoecharger.json +++ b/goecharger/integrationplugingoecharger.json @@ -122,8 +122,8 @@ "type": "uint", "unit": "Ampere", "minValue": 6, - "maxValue": 20, - "defaultValue": 0.00, + "maxValue": 32, + "defaultValue": 0, "writable": true }, { From 8814ced9dc33334a62c28a492f2d38a0e4f91836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 9 Dec 2021 07:17:40 +0100 Subject: [PATCH 7/9] Update states and clean up code --- goecharger/integrationplugingoecharger.cpp | 4 +- goecharger/integrationplugingoecharger.json | 62 +++++++++------------ 2 files changed, 28 insertions(+), 38 deletions(-) diff --git a/goecharger/integrationplugingoecharger.cpp b/goecharger/integrationplugingoecharger.cpp index 556ad26b..e4977700 100644 --- a/goecharger/integrationplugingoecharger.cpp +++ b/goecharger/integrationplugingoecharger.cpp @@ -208,7 +208,7 @@ void IntegrationPluginGoECharger::executeAction(ThingActionInfo *info) } else if (action.actionTypeId() == goeHomeMaxChargingCurrentActionTypeId) { uint maxChargingCurrent = action.paramValue(goeHomeMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toUInt(); qCDebug(dcGoECharger()) << "Setting max charging current to" << maxChargingCurrent << "A"; - // FIXME: check if we can use amx since it is better for pc charging, not all version seen implement amx + // FIXME: check if we can use amx since it is better for pv charging, not all version seen implement amx // Maybe check if the user sets it or a rule / hems logic // Set the allow value QString configuration = QString("amp=%1").arg(maxChargingCurrent); @@ -354,7 +354,7 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status thing->setStateValue(goeHomeUpdateAvailableStateTypeId, (statusMap.value("upd").toUInt() == 0 ? false : true)); thing->setStateValue(goeHomeCloudStateTypeId, (statusMap.value("cdi").toUInt() == 0 ? false : true)); thing->setStateValue(goeHomeFirmwareVersionStateTypeId, statusMap.value("fwv").toString()); - // FIXME: check if we can use amx since it is better for pc charging, not all version seen implement this + // FIXME: check if we can use amx since it is better for pv charging, not all version seen implement this thing->setStateValue(goeHomeMaxChargingCurrentStateTypeId, statusMap.value("amp").toUInt()); thing->setStateValue(goeHomeLedBrightnessStateTypeId, statusMap.value("lbr").toUInt()); thing->setStateValue(goeHomeLedEnergySaveStateTypeId, statusMap.value("lse").toBool()); diff --git a/goecharger/integrationplugingoecharger.json b/goecharger/integrationplugingoecharger.json index 91d99714..2fda2c65 100644 --- a/goecharger/integrationplugingoecharger.json +++ b/goecharger/integrationplugingoecharger.json @@ -66,7 +66,8 @@ "displayName": "Car plugged in", "displayNameEvent": "Car plugged in changed", "type": "bool", - "defaultValue": false + "defaultValue": false, + "suggestLogging": true }, { "id": "48c6cdb8-9fc1-4c14-95df-3e2c62e59361", @@ -74,7 +75,8 @@ "displayName": "Charging", "displayNameEvent": "Charging changed", "type": "bool", - "defaultValue": false + "defaultValue": false, + "suggestLogging": true }, { "id": "d80e1ed8-c3ae-4b68-bf86-21b4d7b2b201", @@ -98,7 +100,8 @@ "displayNameAction": "Allow charging", "displayNameEvent": "Allow charging changed", "defaultValue": false, - "writable": true + "writable": true, + "suggestLogging": true }, { "id": "446fb786-bfbe-4938-963c-73d02184573f", @@ -111,7 +114,8 @@ "minValue": 6, "maxValue": 32, "defaultValue": 16, - "writable": true + "writable": true, + "suggestLogging": true }, { "id": "58cd977d-22df-48c9-829a-81554130d607", @@ -123,8 +127,9 @@ "unit": "Ampere", "minValue": 6, "maxValue": 32, - "defaultValue": 0, - "writable": true + "defaultValue": 20, + "writable": true, + "suggestLogging": true }, { "id": "ac849296-3f70-4b1b-aa30-127d774667bb", @@ -134,8 +139,7 @@ "displayNameEvent": "Cloud enabled changed", "type": "bool", "defaultValue": true, - "writable": true, - "suggestLogging": true + "writable": true }, { "id": "08b107bc-1284-455d-9e5a-6a1c3adc389f", @@ -190,8 +194,7 @@ "displayNameEvent": "Current power changed", "type": "double", "unit": "Watt", - "defaultValue": 0.00, - "filter": "adaptive" + "defaultValue": 0.00 }, { "id": "c6f68517-c4cd-415d-9455-b1731f7d9a1a", @@ -200,8 +203,7 @@ "displayNameEvent": "Current power phase A changed", "type": "double", "unit": "Watt", - "defaultValue": 0.00, - "filter": "adaptive" + "defaultValue": 0.00 }, { "id": "92005049-9ab9-4d7d-a7b6-6ab1a36c5f5f", @@ -210,8 +212,7 @@ "displayNameEvent": "Current power phase B changed", "type": "double", "unit": "Watt", - "defaultValue": 0.00, - "filter": "adaptive" + "defaultValue": 0.00 }, { "id": "1076fbd0-f42b-46e3-adc9-004361d6cd51", @@ -220,8 +221,7 @@ "displayNameEvent": "Current power phase C changed", "type": "double", "unit": "Watt", - "defaultValue": 0.00, - "filter": "adaptive" + "defaultValue": 0.00 }, { "id": "c8aab9e2-ba53-43b9-95db-e2c3edc97e33", @@ -230,8 +230,7 @@ "displayNameEvent": "Phase A current changed", "type": "double", "unit": "Ampere", - "defaultValue": 0.00, - "filter": "adaptive" + "defaultValue": 0.00 }, { "id": "f11ac403-728d-48f3-8669-0e684faf9890", @@ -240,8 +239,7 @@ "displayNameEvent": "Phase B current changed", "type": "double", "unit": "Ampere", - "defaultValue": 0.00, - "filter": "adaptive" + "defaultValue": 0.00 }, { "id": "55295e1c-50b0-400b-82e4-b3417b5ed4d1", @@ -250,8 +248,7 @@ "displayNameEvent": "Phase C current changed", "type": "double", "unit": "Ampere", - "defaultValue": 0.00, - "filter": "adaptive" + "defaultValue": 0.00 }, { "id": "76da8f16-44a4-4242-b78b-09c9bb127623", @@ -260,8 +257,7 @@ "displayNameEvent": "Phase A volatage changed", "type": "double", "unit": "Volt", - "defaultValue": 0.00, - "filter": "adaptive" + "defaultValue": 0.00 }, { "id": "7df01eb4-0d4d-400c-b1bc-001ca83a6a3c", @@ -270,8 +266,7 @@ "displayNameEvent": "Phase B voltage changed", "type": "double", "unit": "Volt", - "defaultValue": 0.00, - "filter": "adaptive" + "defaultValue": 0.00 }, { "id": "31814cfe-626d-4168-802b-b7fc6592fc79", @@ -280,8 +275,7 @@ "displayNameEvent": "Phase C voltage changed", "type": "double", "unit": "Volt", - "defaultValue": 0.00, - "filter": "adaptive" + "defaultValue": 0.00 }, { "id": "b78d805a-f97c-4c9d-a647-5fc98f8d6dd1", @@ -322,8 +316,7 @@ "displayNameEvent": "Temperature 1 changed", "type": "double", "unit": "DegreeCelsius", - "defaultValue": 0.0, - "suggestLogging": true + "defaultValue": 0.0 }, { "id": "558e273a-4028-495a-902a-e4e932a0ae24", @@ -332,8 +325,7 @@ "displayNameEvent": "Temperature 2 changed", "type": "double", "unit": "DegreeCelsius", - "defaultValue": 0.0, - "suggestLogging": true + "defaultValue": 0.0 }, { "id": "dbf8a5dc-b8f5-437a-ac0c-c4cf8a09aacb", @@ -342,8 +334,7 @@ "displayNameEvent": "Temperature 3 changed", "type": "double", "unit": "DegreeCelsius", - "defaultValue": 0.0, - "suggestLogging": true + "defaultValue": 0.0 }, { "id": "1953e29f-fe28-4016-9b05-f4baf4c311ff", @@ -352,8 +343,7 @@ "displayNameEvent": "Temperature 4 changed", "type": "double", "unit": "DegreeCelsius", - "defaultValue": 0.0, - "suggestLogging": true + "defaultValue": 0.0 }, { "id": "5d18b48d-b886-409e-ab2e-336d9c94a55c", From b3e27a37b23aae7907b02879ed520d536863be39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 9 Dec 2021 07:18:45 +0100 Subject: [PATCH 8/9] Update translations --- ...fca21-3f41-4a67-bc8c-c8b333411bd9-en_US.ts | 313 ++++++++++-------- 1 file changed, 179 insertions(+), 134 deletions(-) diff --git a/goecharger/translations/a1dfca21-3f41-4a67-bc8c-c8b333411bd9-en_US.ts b/goecharger/translations/a1dfca21-3f41-4a67-bc8c-c8b333411bd9-en_US.ts index 8a25ecac..8aa774e4 100644 --- a/goecharger/translations/a1dfca21-3f41-4a67-bc8c-c8b333411bd9-en_US.ts +++ b/goecharger/translations/a1dfca21-3f41-4a67-bc8c-c8b333411bd9-en_US.ts @@ -4,8 +4,8 @@ GoECharger - - + + Access The name of the ParamType (ThingClass: goeHome, EventType: access, ID: {d80e1ed8-c3ae-4b68-bf86-21b4d7b2b201}) ---------- @@ -13,14 +13,14 @@ The name of the StateType ({d80e1ed8-c3ae-4b68-bf86-21b4d7b2b201}) of ThingClass - + Access changed The name of the EventType ({d80e1ed8-c3ae-4b68-bf86-21b4d7b2b201}) of ThingClass goeHome - - + + Adapter connected The name of the ParamType (ThingClass: goeHome, EventType: adapterConnected, ID: {d557e59e-ca22-4aff-bf80-dfee44db0f69}) ---------- @@ -28,16 +28,16 @@ The name of the StateType ({d557e59e-ca22-4aff-bf80-dfee44db0f69}) of ThingClass - + Adapter connected changed The name of the EventType ({d557e59e-ca22-4aff-bf80-dfee44db0f69}) of ThingClass goeHome - - - + + + Allow charging The name of the ParamType (ThingClass: goeHome, ActionType: power, ID: {8a7ab9f1-0143-494c-98ee-69f94125fe42}) ---------- @@ -49,14 +49,14 @@ The name of the StateType ({8a7ab9f1-0143-494c-98ee-69f94125fe42}) of ThingClass - + Allow charging changed The name of the EventType ({8a7ab9f1-0143-494c-98ee-69f94125fe42}) of ThingClass goeHome - - + + Cable ampere encoding The name of the ParamType (ThingClass: goeHome, EventType: cableType2Ampere, ID: {f9091651-1522-4387-b300-906abd907fb3}) ---------- @@ -64,14 +64,14 @@ The name of the StateType ({f9091651-1522-4387-b300-906abd907fb3}) of ThingClass - + Cable ampere encoding changed The name of the EventType ({f9091651-1522-4387-b300-906abd907fb3}) of ThingClass goeHome - - + + Car plugged in The name of the ParamType (ThingClass: goeHome, EventType: pluggedIn, ID: {6cb155b1-0831-47bc-8657-17ca68716684}) ---------- @@ -79,14 +79,14 @@ The name of the StateType ({6cb155b1-0831-47bc-8657-17ca68716684}) of ThingClass - + Car plugged in changed The name of the EventType ({6cb155b1-0831-47bc-8657-17ca68716684}) of ThingClass goeHome - - + + Car state The name of the ParamType (ThingClass: goeHome, EventType: carStatus, ID: {c69053bc-3a53-4e76-868b-ccf0958e9e44}) ---------- @@ -94,30 +94,30 @@ The name of the StateType ({c69053bc-3a53-4e76-868b-ccf0958e9e44}) of ThingClass - + Car status changed The name of the EventType ({c69053bc-3a53-4e76-868b-ccf0958e9e44}) of ThingClass goeHome - - - - Charge energy - The name of the ParamType (ThingClass: goeHome, EventType: chargeEnergy, ID: {e8258831-ad89-4d27-b295-e8c10dd42b76}) ----------- -The name of the StateType ({e8258831-ad89-4d27-b295-e8c10dd42b76}) of ThingClass goeHome - - - - - Charge energy changed - The name of the EventType ({e8258831-ad89-4d27-b295-e8c10dd42b76}) of ThingClass goeHome - - + Charging + The name of the ParamType (ThingClass: goeHome, EventType: charging, ID: {48c6cdb8-9fc1-4c14-95df-3e2c62e59361}) +---------- +The name of the StateType ({48c6cdb8-9fc1-4c14-95df-3e2c62e59361}) of ThingClass goeHome + + + + Charging changed + The name of the EventType ({48c6cdb8-9fc1-4c14-95df-3e2c62e59361}) of ThingClass goeHome + + + + + + Charging current The name of the ParamType (ThingClass: goeHome, ActionType: maxChargingCurrent, ID: {446fb786-bfbe-4938-963c-73d02184573f}) ---------- @@ -127,15 +127,15 @@ The name of the StateType ({446fb786-bfbe-4938-963c-73d02184573f}) of ThingClass - + Charging current changed The name of the EventType ({446fb786-bfbe-4938-963c-73d02184573f}) of ThingClass goeHome - - - + + + Cloud enabled The name of the ParamType (ThingClass: goeHome, ActionType: cloud, ID: {ac849296-3f70-4b1b-aa30-127d774667bb}) ---------- @@ -145,14 +145,14 @@ The name of the StateType ({ac849296-3f70-4b1b-aa30-127d774667bb}) of ThingClass - + Cloud enabled changed The name of the EventType ({ac849296-3f70-4b1b-aa30-127d774667bb}) of ThingClass goeHome - - + + Connected The name of the ParamType (ThingClass: goeHome, EventType: connected, ID: {a5afaad5-78bf-4cac-b98d-7eae31aac518}) ---------- @@ -160,14 +160,29 @@ The name of the StateType ({a5afaad5-78bf-4cac-b98d-7eae31aac518}) of ThingClass - + Connected changed The name of the EventType ({a5afaad5-78bf-4cac-b98d-7eae31aac518}) of ThingClass goeHome - - + + + Current power + The name of the ParamType (ThingClass: goeHome, EventType: currentPower, ID: {f00cfcab-9271-48fa-b843-89244c9551ae}) +---------- +The name of the StateType ({f00cfcab-9271-48fa-b843-89244c9551ae}) of ThingClass goeHome + + + + + Current power changed + The name of the EventType ({f00cfcab-9271-48fa-b843-89244c9551ae}) of ThingClass goeHome + + + + + Current power phase A The name of the ParamType (ThingClass: goeHome, EventType: currentPowerPhaseA, ID: {c6f68517-c4cd-415d-9455-b1731f7d9a1a}) ---------- @@ -175,14 +190,14 @@ The name of the StateType ({c6f68517-c4cd-415d-9455-b1731f7d9a1a}) of ThingClass - + Current power phase A changed The name of the EventType ({c6f68517-c4cd-415d-9455-b1731f7d9a1a}) of ThingClass goeHome - - + + Current power phase B The name of the ParamType (ThingClass: goeHome, EventType: currentPowerPhaseB, ID: {92005049-9ab9-4d7d-a7b6-6ab1a36c5f5f}) ---------- @@ -190,14 +205,14 @@ The name of the StateType ({92005049-9ab9-4d7d-a7b6-6ab1a36c5f5f}) of ThingClass - + Current power phase B changed The name of the EventType ({92005049-9ab9-4d7d-a7b6-6ab1a36c5f5f}) of ThingClass goeHome - - + + Current power phase C The name of the ParamType (ThingClass: goeHome, EventType: currentPowerPhaseC, ID: {1076fbd0-f42b-46e3-adc9-004361d6cd51}) ---------- @@ -205,14 +220,14 @@ The name of the StateType ({1076fbd0-f42b-46e3-adc9-004361d6cd51}) of ThingClass - + Current power phase C changed The name of the EventType ({1076fbd0-f42b-46e3-adc9-004361d6cd51}) of ThingClass goeHome - - + + Firmware version The name of the ParamType (ThingClass: goeHome, EventType: firmwareVersion, ID: {5d18b48d-b886-409e-ab2e-336d9c94a55c}) ---------- @@ -220,21 +235,21 @@ The name of the StateType ({5d18b48d-b886-409e-ab2e-336d9c94a55c}) of ThingClass - + Firmware version changed The name of the EventType ({5d18b48d-b886-409e-ab2e-336d9c94a55c}) of ThingClass goeHome - + IP address The name of the ParamType (ThingClass: goeHome, Type: thing, ID: {4342b72c-99d0-41a5-abc6-ea6c1cc1352c}) - - - + + + Led brightness The name of the ParamType (ThingClass: goeHome, ActionType: ledBrightness, ID: {b06479d5-7a38-4fbd-867e-e55bdb54651b}) ---------- @@ -244,15 +259,15 @@ The name of the StateType ({b06479d5-7a38-4fbd-867e-e55bdb54651b}) of ThingClass - + Led brightness changed The name of the EventType ({b06479d5-7a38-4fbd-867e-e55bdb54651b}) of ThingClass goeHome - - - + + + Led energy saving enabled The name of the ParamType (ThingClass: goeHome, ActionType: ledEnergySave, ID: {048a4c98-3ee4-4d02-ad48-6d70f31fce8c}) ---------- @@ -262,21 +277,21 @@ The name of the StateType ({048a4c98-3ee4-4d02-ad48-6d70f31fce8c}) of ThingClass - + Led energy saving enabled enabled changed The name of the EventType ({048a4c98-3ee4-4d02-ad48-6d70f31fce8c}) of ThingClass goeHome - + MAC address The name of the ParamType (ThingClass: goeHome, Type: thing, ID: {0e30e30f-ad96-417e-b739-cac85f75de39}) - - - + + + Maximal ampere The name of the ParamType (ThingClass: goeHome, ActionType: absoluteMaxAmpere, ID: {58cd977d-22df-48c9-829a-81554130d607}) ---------- @@ -286,14 +301,29 @@ The name of the StateType ({58cd977d-22df-48c9-829a-81554130d607}) of ThingClass - + Maximal ampere changed The name of the EventType ({58cd977d-22df-48c9-829a-81554130d607}) of ThingClass goeHome - - + + + Number of charging phases + The name of the ParamType (ThingClass: goeHome, EventType: phaseCount, ID: {b78d805a-f97c-4c9d-a647-5fc98f8d6dd1}) +---------- +The name of the StateType ({b78d805a-f97c-4c9d-a647-5fc98f8d6dd1}) of ThingClass goeHome + + + + + Number of charging phases changed + The name of the EventType ({b78d805a-f97c-4c9d-a647-5fc98f8d6dd1}) of ThingClass goeHome + + + + + Phase A current The name of the ParamType (ThingClass: goeHome, EventType: currentPhaseA, ID: {c8aab9e2-ba53-43b9-95db-e2c3edc97e33}) ---------- @@ -301,20 +331,20 @@ The name of the StateType ({c8aab9e2-ba53-43b9-95db-e2c3edc97e33}) of ThingClass - + Phase A current changed The name of the EventType ({c8aab9e2-ba53-43b9-95db-e2c3edc97e33}) of ThingClass goeHome - + Phase A volatage changed The name of the EventType ({76da8f16-44a4-4242-b78b-09c9bb127623}) of ThingClass goeHome - - + + Phase A voltage The name of the ParamType (ThingClass: goeHome, EventType: voltagePhaseA, ID: {76da8f16-44a4-4242-b78b-09c9bb127623}) ---------- @@ -322,8 +352,8 @@ The name of the StateType ({76da8f16-44a4-4242-b78b-09c9bb127623}) of ThingClass - - + + Phase B current The name of the ParamType (ThingClass: goeHome, EventType: currentPhaseB, ID: {f11ac403-728d-48f3-8669-0e684faf9890}) ---------- @@ -331,14 +361,14 @@ The name of the StateType ({f11ac403-728d-48f3-8669-0e684faf9890}) of ThingClass - + Phase B current changed The name of the EventType ({f11ac403-728d-48f3-8669-0e684faf9890}) of ThingClass goeHome - - + + Phase B voltage The name of the ParamType (ThingClass: goeHome, EventType: voltagePhaseB, ID: {7df01eb4-0d4d-400c-b1bc-001ca83a6a3c}) ---------- @@ -346,14 +376,14 @@ The name of the StateType ({7df01eb4-0d4d-400c-b1bc-001ca83a6a3c}) of ThingClass - + Phase B voltage changed The name of the EventType ({7df01eb4-0d4d-400c-b1bc-001ca83a6a3c}) of ThingClass goeHome - - + + Phase C current The name of the ParamType (ThingClass: goeHome, EventType: currentPhaseC, ID: {55295e1c-50b0-400b-82e4-b3417b5ed4d1}) ---------- @@ -361,14 +391,14 @@ The name of the StateType ({55295e1c-50b0-400b-82e4-b3417b5ed4d1}) of ThingClass - + Phase C current changed The name of the EventType ({55295e1c-50b0-400b-82e4-b3417b5ed4d1}) of ThingClass goeHome - - + + Phase C voltage The name of the ParamType (ThingClass: goeHome, EventType: voltagePhaseC, ID: {31814cfe-626d-4168-802b-b7fc6592fc79}) ---------- @@ -376,14 +406,14 @@ The name of the StateType ({31814cfe-626d-4168-802b-b7fc6592fc79}) of ThingClass - + Phase C voltage changed The name of the EventType ({31814cfe-626d-4168-802b-b7fc6592fc79}) of ThingClass goeHome - - + + Serial number The name of the ParamType (ThingClass: goeHome, EventType: serialNumber, ID: {8ecdf24b-daca-4b7a-98b5-3236f1e6ad85}) ---------- @@ -391,44 +421,59 @@ The name of the StateType ({8ecdf24b-daca-4b7a-98b5-3236f1e6ad85}) of ThingClass - + Serial number changed The name of the EventType ({8ecdf24b-daca-4b7a-98b5-3236f1e6ad85}) of ThingClass goeHome - + + + Session energy + The name of the ParamType (ThingClass: goeHome, EventType: sessionEnergy, ID: {e8258831-ad89-4d27-b295-e8c10dd42b76}) +---------- +The name of the StateType ({e8258831-ad89-4d27-b295-e8c10dd42b76}) of ThingClass goeHome + + + + + Session energy changed + The name of the EventType ({e8258831-ad89-4d27-b295-e8c10dd42b76}) of ThingClass goeHome + + + + Set charging current The name of the ActionType ({446fb786-bfbe-4938-963c-73d02184573f}) of ThingClass goeHome - + Set cloud enabled The name of the ActionType ({ac849296-3f70-4b1b-aa30-127d774667bb}) of ThingClass goeHome - + Set led brightness The name of the ActionType ({b06479d5-7a38-4fbd-867e-e55bdb54651b}) of ThingClass goeHome - + Set led energy saving enabled The name of the ActionType ({048a4c98-3ee4-4d02-ad48-6d70f31fce8c}) of ThingClass goeHome - + Set maximal ampere The name of the ActionType ({58cd977d-22df-48c9-829a-81554130d607}) of ThingClass goeHome - - + + Temperature 1 The name of the ParamType (ThingClass: goeHome, EventType: temperatureSensor1, ID: {2bf1ebf1-0d8c-4209-ad35-4114d9861832}) ---------- @@ -436,14 +481,14 @@ The name of the StateType ({2bf1ebf1-0d8c-4209-ad35-4114d9861832}) of ThingClass - + Temperature 1 changed The name of the EventType ({2bf1ebf1-0d8c-4209-ad35-4114d9861832}) of ThingClass goeHome - - + + Temperature 2 The name of the ParamType (ThingClass: goeHome, EventType: temperatureSensor2, ID: {558e273a-4028-495a-902a-e4e932a0ae24}) ---------- @@ -451,14 +496,14 @@ The name of the StateType ({558e273a-4028-495a-902a-e4e932a0ae24}) of ThingClass - + Temperature 2 changed The name of the EventType ({558e273a-4028-495a-902a-e4e932a0ae24}) of ThingClass goeHome - - + + Temperature 3 The name of the ParamType (ThingClass: goeHome, EventType: temperatureSensor3, ID: {dbf8a5dc-b8f5-437a-ac0c-c4cf8a09aacb}) ---------- @@ -466,14 +511,14 @@ The name of the StateType ({dbf8a5dc-b8f5-437a-ac0c-c4cf8a09aacb}) of ThingClass - + Temperature 3 changed The name of the EventType ({dbf8a5dc-b8f5-437a-ac0c-c4cf8a09aacb}) of ThingClass goeHome - - + + Temperature 4 The name of the ParamType (ThingClass: goeHome, EventType: temperatureSensor4, ID: {1953e29f-fe28-4016-9b05-f4baf4c311ff}) ---------- @@ -481,14 +526,14 @@ The name of the StateType ({1953e29f-fe28-4016-9b05-f4baf4c311ff}) of ThingClass - + Temperature 4 changed The name of the EventType ({1953e29f-fe28-4016-9b05-f4baf4c311ff}) of ThingClass goeHome - - + + Total energy The name of the ParamType (ThingClass: goeHome, EventType: totalEnergyConsumed, ID: {d8f5abb6-5db3-4040-8829-553b1d881ce4}) ---------- @@ -496,14 +541,14 @@ The name of the StateType ({d8f5abb6-5db3-4040-8829-553b1d881ce4}) of ThingClass - + Total energy changed The name of the EventType ({d8f5abb6-5db3-4040-8829-553b1d881ce4}) of ThingClass goeHome - - + + Update available The name of the ParamType (ThingClass: goeHome, EventType: updateAvailable, ID: {08b107bc-1284-455d-9e5a-6a1c3adc389f}) ---------- @@ -511,31 +556,31 @@ The name of the StateType ({08b107bc-1284-455d-9e5a-6a1c3adc389f}) of ThingClass - + Update available changed The name of the EventType ({08b107bc-1284-455d-9e5a-6a1c3adc389f}) of ThingClass goeHome - + Use MQTT interface The name of the ParamType (ThingClass: goeHome, Type: thing, ID: {848613a6-8a17-4082-ba77-3b4421170a4f}) - + go-e The name of the vendor ({c2cf9998-3584-489f-8d82-68a0baed2064}) - + go-eCharger The name of the plugin GoECharger ({a1dfca21-3f41-4a67-bc8c-c8b333411bd9}) - + go-eCharger Home The name of the ThingClass ({3b663d51-fdb5-4944-b409-c07f7933877e}) @@ -550,37 +595,37 @@ The name of the StateType ({08b107bc-1284-455d-9e5a-6a1c3adc389f}) of ThingClass - - - - - - + + + + + + The wallbox does not seem to be reachable. - - - - - - + + + + + + The wallbox returned invalid data. - + Error creating MQTT channel. Please check MQTT server settings. - - - - - + + + + + Error while configuring MQTT settings on the wallbox. From e9e8129f8091d290d521ac36dbc2d3dda609bd92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Fri, 10 Dec 2021 10:45:25 +0100 Subject: [PATCH 9/9] Make code more readable --- goecharger/integrationplugingoecharger.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/goecharger/integrationplugingoecharger.cpp b/goecharger/integrationplugingoecharger.cpp index e4977700..02d8c2b0 100644 --- a/goecharger/integrationplugingoecharger.cpp +++ b/goecharger/integrationplugingoecharger.cpp @@ -209,7 +209,7 @@ void IntegrationPluginGoECharger::executeAction(ThingActionInfo *info) uint maxChargingCurrent = action.paramValue(goeHomeMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toUInt(); qCDebug(dcGoECharger()) << "Setting max charging current to" << maxChargingCurrent << "A"; // FIXME: check if we can use amx since it is better for pv charging, not all version seen implement amx - // Maybe check if the user sets it or a rule / hems logic + // Maybe check if the user sets it or a automatism // Set the allow value QString configuration = QString("amp=%1").arg(maxChargingCurrent); sendActionRequest(thing, info, configuration); @@ -424,7 +424,7 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status thing->setStateValue(goeHomeCurrentPowerStateTypeId, currentPower); // Check how many phases are actually charging, and update the phase count only if something happens on the phases (current or power) - if (!(amperePhaseA == 0 && amperePhaseB == 0 && amperePhaseC == 0)) { + if (amperePhaseA != 0 || amperePhaseB != 0 || amperePhaseC != 0) { uint phaseCount = 0; if (amperePhaseA != 0) phaseCount += 1;