From 283756cf30f673e9b395b695aeeb6acb589b5e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 30 Sep 2021 09:42:29 +0200 Subject: [PATCH 1/7] goecharger: extend states and make mqtt optional --- goecharger/integrationplugingoecharger.cpp | 123 +++++- goecharger/integrationplugingoecharger.h | 6 +- goecharger/integrationplugingoecharger.json | 119 ++++++ ...fca21-3f41-4a67-bc8c-c8b333411bd9-en_US.ts | 364 +++++++++++++----- 4 files changed, 506 insertions(+), 106 deletions(-) diff --git a/goecharger/integrationplugingoecharger.cpp b/goecharger/integrationplugingoecharger.cpp index d8c278f3..3967c233 100644 --- a/goecharger/integrationplugingoecharger.cpp +++ b/goecharger/integrationplugingoecharger.cpp @@ -105,14 +105,10 @@ void IntegrationPluginGoECharger::setupThing(ThingSetupInfo *info) { Thing *thing = info->thing(); if (thing->thingClassId() == goeHomeThingClassId) { - QHostAddress address = QHostAddress(thing->paramValue(goeHomeThingIpAddressParamTypeId).toString()); - QUrl requestUrl; - requestUrl.setScheme("http"); - requestUrl.setHost(address.toString()); - requestUrl.setPath("/status"); - QNetworkRequest request(requestUrl); - QNetworkReply *reply = hardwareManager()->networkManager()->get(request); + // TODO: handle reconfigure + + QNetworkReply *reply = hardwareManager()->networkManager()->get(buildStatusRequest(thing)); connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater); connect(reply, &QNetworkReply::finished, info, [=](){ if (reply->error() != QNetworkReply::NoError) { @@ -131,8 +127,16 @@ void IntegrationPluginGoECharger::setupThing(ThingSetupInfo *info) } qCDebug(dcGoECharger()) << "Received" << qUtf8Printable(jsonDoc.toJson()); - // Verify mqtt client and set it up - setupMqttChannel(info, address, jsonDoc.toVariant().toMap()); + QVariantMap statusMap = jsonDoc.toVariant().toMap(); + if (thing->paramValue(goeHomeThingUseMqttParamTypeId).toBool()) { + // Verify mqtt client and set it up + QHostAddress address = QHostAddress(thing->paramValue(goeHomeThingIpAddressParamTypeId).toString()); + setupMqttChannel(info, address, statusMap); + } else { + // Since we are not using mqtt, we are done with the setup, the refresh timer will be configured in post setup + info->finish(Thing::ThingErrorNoError); + update(thing, statusMap); + } }); return; } @@ -140,12 +144,32 @@ void IntegrationPluginGoECharger::setupThing(ThingSetupInfo *info) Q_ASSERT_X(false, "setupThing", QString("Unhandled thingClassId: %1").arg(thing->thingClassId().toString()).toUtf8()); } +void IntegrationPluginGoECharger::postSetupThing(Thing *thing) +{ + if (thing->thingClassId() == goeHomeThingClassId) { + // Set up refresh timer if needed and if we are not using mqtt + if (thing->paramValue(goeHomeThingUseMqttParamTypeId).toBool()) { + if (!m_refreshTimer) { + m_refreshTimer = hardwareManager()->pluginTimerManager()->registerTimer(4); + connect(m_refreshTimer, &PluginTimer::timeout, this, &IntegrationPluginGoECharger::refreshHttp); + m_refreshTimer->start(); + } + } + } +} void IntegrationPluginGoECharger::thingRemoved(Thing *thing) { + // Cleanup mqtt channels if set up if (m_channels.contains(thing)) { hardwareManager()->mqttProvider()->releaseChannel(m_channels.take(thing)); } + + // Clean up refresh timer if set up + if (m_refreshTimer && myThings().isEmpty()) { + hardwareManager()->pluginTimerManager()->unregisterTimer(m_refreshTimer); + m_refreshTimer = nullptr; + } } void IntegrationPluginGoECharger::executeAction(ThingActionInfo *info) @@ -178,10 +202,17 @@ void IntegrationPluginGoECharger::executeAction(ThingActionInfo *info) sendActionRequest(thing, info, configuration); return; } else if (action.actionTypeId() == goeHomeMaxChargingCurrentActionTypeId) { - int maxChargingCurrent = action.paramValue(goeHomeMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toUInt(); + uint maxChargingCurrent = action.paramValue(goeHomeMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toUInt(); qCDebug(dcGoECharger()) << "Setting max charging current to" << maxChargingCurrent << "A"; // Set the allow value - QString configuration = QString("ama=%1").arg(maxChargingCurrent); + QString configuration = QString("amx=%1").arg(maxChargingCurrent); + sendActionRequest(thing, info, configuration); + return; + } else if (action.actionTypeId() == goeHomeAbsoluteMaxAmpereActionTypeId) { + uint maxAmpere = action.paramValue(goeHomeAbsoluteMaxAmpereActionAbsoluteMaxAmpereParamTypeId).toUInt(); + qCDebug(dcGoECharger()) << "Setting absolute maximal charging amperes to" << maxAmpere << "A"; + // Set the allow value + QString configuration = QString("ama=%1").arg(maxAmpere); sendActionRequest(thing, info, configuration); return; } else if (action.actionTypeId() == goeHomeCloudActionTypeId) { @@ -307,16 +338,47 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status thing->setStateValue(goeHomeChargeEnergyStateTypeId, 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(goeHomeAdapterConnectedStateTypeId, (statusMap.value("adi").toUInt() == 0 ? false : true)); thing->setStateValue(goeHomeCloudStateTypeId, (statusMap.value("cdi").toUInt() == 0 ? false : true)); thing->setStateValue(goeHomeFirmwareVersionStateTypeId, statusMap.value("fwv").toString()); - thing->setStateValue(goeHomeMaxChargingCurrentStateTypeId, statusMap.value("ama").toUInt()); + thing->setStateValue(goeHomeMaxChargingCurrentStateTypeId, statusMap.value("amx").toUInt()); thing->setStateValue(goeHomeLedBrightnessStateTypeId, statusMap.value("lbr").toUInt()); thing->setStateValue(goeHomeLedEnergySaveStateTypeId, statusMap.value("lse").toBool()); thing->setStateValue(goeHomeSerialNumberStateTypeId, statusMap.value("sse").toString()); + + // TODO: set min max for charging current according to these states + thing->setStateValue(goeHomeAbsoluteMaxAmpereStateTypeId, statusMap.value("ama").toUInt()); + thing->setStateValue(goeHomeAdapterConnectedStateTypeId, (statusMap.value("adi").toUInt() == 0 ? false : true)); + thing->setStateValue(goeHomeCableType2AmpereStateTypeId, statusMap.value("cbl").toUInt()); + + // Parse nrg array + QVariantList measurementList = statusMap.value("nrg").toList(); + if (measurementList.count() == 16) { + thing->setStateValue(goeHomeVoltagePhaseAStateTypeId, measurementList.at(0).toUInt()); + thing->setStateValue(goeHomeVoltagePhaseBStateTypeId, measurementList.at(1).toUInt()); + thing->setStateValue(goeHomeVoltagePhaseCStateTypeId, measurementList.at(2).toUInt()); + + thing->setStateValue(goeHomeCurrentPhaseAStateTypeId, measurementList.at(4).toUInt() / 10.0); + thing->setStateValue(goeHomeCurrentPhaseBStateTypeId, measurementList.at(5).toUInt() / 10.0); + thing->setStateValue(goeHomeCurrentPhaseCStateTypeId, measurementList.at(6).toUInt() / 10.0); + + thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, measurementList.at(7).toUInt() / 10.0); + thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, measurementList.at(8).toUInt() / 10.0); + thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, measurementList.at(9).toUInt() / 10.0); + } } } +QNetworkRequest IntegrationPluginGoECharger::buildStatusRequest(Thing *thing) +{ + QHostAddress address = QHostAddress(thing->paramValue(goeHomeThingIpAddressParamTypeId).toString()); + QUrl requestUrl; + requestUrl.setScheme("http"); + requestUrl.setHost(address.toString()); + requestUrl.setPath("/status"); + + return QNetworkRequest(requestUrl); +} + QNetworkRequest IntegrationPluginGoECharger::buildConfigurationRequest(const QHostAddress &address, const QString &configuration) { QUrl requestUrl; @@ -539,4 +601,39 @@ void IntegrationPluginGoECharger::setupMqttChannel(ThingSetupInfo *info, const Q }); } +void IntegrationPluginGoECharger::refreshHttp() +{ + // Update all things which don't use mqtt + foreach (Thing *thing, myThings()) { + if (thing->paramValue(goeHomeThingUseMqttParamTypeId).toBool()) { + qCDebug(dcGoECharger()) << "Refresh HTTP status from" << thing; + QNetworkReply *reply = hardwareManager()->networkManager()->get(buildStatusRequest(thing)); + connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater); + connect(reply, &QNetworkReply::finished, thing, [=](){ + if (reply->error() != QNetworkReply::NoError) { + qCWarning(dcGoECharger()) << "HTTP status reply returned error:" << reply->errorString(); + thing->setStateValue(goeHomeConnectedStateTypeId, false); + return; + } + + QByteArray data = reply->readAll(); + QJsonParseError error; + QJsonDocument jsonDoc = QJsonDocument::fromJson(data, &error); + if (error.error != QJsonParseError::NoError) { + qCWarning(dcGoECharger()) << "Failed to parse status data for thing " << thing->name() << qUtf8Printable(data) << error.errorString(); + thing->setStateValue(goeHomeConnectedStateTypeId, false); + return; + } + + // Valid json data received, connected true + thing->setStateValue(goeHomeConnectedStateTypeId, true); + + qCDebug(dcGoECharger()) << "Received" << qUtf8Printable(jsonDoc.toJson()); + QVariantMap statusMap = jsonDoc.toVariant().toMap(); + update(thing, statusMap); + }); + } + } +} + diff --git a/goecharger/integrationplugingoecharger.h b/goecharger/integrationplugingoecharger.h index f5cc8dff..ab9b3a07 100644 --- a/goecharger/integrationplugingoecharger.h +++ b/goecharger/integrationplugingoecharger.h @@ -81,19 +81,23 @@ public: void discoverThings(ThingDiscoveryInfo *info) override; void setupThing(ThingSetupInfo *info) override; + void postSetupThing(Thing *thing) override; void thingRemoved(Thing *thing) override; void executeAction(ThingActionInfo *info) override; private: + PluginTimer *m_refreshTimer = nullptr; QHash m_channels; void update(Thing *thing, const QVariantMap &statusMap); + QNetworkRequest buildStatusRequest(Thing *thing); QNetworkRequest buildConfigurationRequest(const QHostAddress &address, const QString &configuration); void sendActionRequest(Thing *thing, ThingActionInfo *info, const QString &configuration); void setupMqttChannel(ThingSetupInfo *info, const QHostAddress &address, const QVariantMap &statusMap); - private slots: + void refreshHttp(); + void onClientConnected(MqttChannel* channel); void onClientDisconnected(MqttChannel* channel); void onPublishReceived(MqttChannel* channel, const QString &topic, const QByteArray &payload); diff --git a/goecharger/integrationplugingoecharger.json b/goecharger/integrationplugingoecharger.json index 414e0c75..c19126b2 100644 --- a/goecharger/integrationplugingoecharger.json +++ b/goecharger/integrationplugingoecharger.json @@ -26,6 +26,13 @@ "name":"macAddress", "displayName": "MAC address", "type": "QString" + }, + { + "id": "848613a6-8a17-4082-ba77-3b4421170a4f", + "name":"useMqtt", + "displayName": "Use MQTT interface", + "type": "bool", + "defaultValue": false } ], "stateTypes":[ @@ -98,6 +105,19 @@ "defaultValue": 16, "writable": true }, + { + "id": "58cd977d-22df-48c9-829a-81554130d607", + "name": "absoluteMaxAmpere", + "displayName": "Maximal ampere", + "displayNameEvent": "Maximal ampere changed", + "displayNameAction": "Set maximal ampere", + "type": "uint", + "unit": "Ampere", + "minValue": 6, + "maxValue": 20, + "defaultValue": 0.00, + "writable": true + }, { "id": "ac849296-3f70-4b1b-aa30-127d774667bb", "name": "cloud", @@ -127,6 +147,15 @@ "defaultValue": false, "suggestLogging": true }, + { + "id": "f9091651-1522-4387-b300-906abd907fb3", + "name": "cableType2Ampere", + "displayName": "Cable ampere encoding", + "displayNameEvent": "Cable ampere encoding changed", + "type": "uint", + "unit": "Ampere", + "defaultValue": 0 + }, { "id": "d8f5abb6-5db3-4040-8829-553b1d881ce4", "name": "totalEnergyConsumed", @@ -146,6 +175,96 @@ "defaultValue": 0.0, "suggestLogging": true }, + { + "id": "c6f68517-c4cd-415d-9455-b1731f7d9a1a", + "name": "currentPowerPhaseA", + "displayName": "Current power phase A", + "displayNameEvent": "Current power phase A changed", + "type": "double", + "unit": "Watt", + "defaultValue": 0.00, + "filter": "adaptive" + }, + { + "id": "92005049-9ab9-4d7d-a7b6-6ab1a36c5f5f", + "name": "currentPowerPhaseB", + "displayName": "Current power phase B", + "displayNameEvent": "Current power phase B changed", + "type": "double", + "unit": "Watt", + "defaultValue": 0.00, + "filter": "adaptive" + }, + { + "id": "1076fbd0-f42b-46e3-adc9-004361d6cd51", + "name": "currentPowerPhaseC", + "displayName": "Current power phase C", + "displayNameEvent": "Current power phase C changed", + "type": "double", + "unit": "Watt", + "defaultValue": 0.00, + "filter": "adaptive" + }, + { + "id": "c8aab9e2-ba53-43b9-95db-e2c3edc97e33", + "name": "currentPhaseA", + "displayName": "Phase A current", + "displayNameEvent": "Phase A current changed", + "type": "double", + "unit": "Ampere", + "defaultValue": 0.00, + "filter": "adaptive" + }, + { + "id": "f11ac403-728d-48f3-8669-0e684faf9890", + "name": "currentPhaseB", + "displayName": "Phase B current", + "displayNameEvent": "Phase B current changed", + "type": "double", + "unit": "Ampere", + "defaultValue": 0.00, + "filter": "adaptive" + }, + { + "id": "55295e1c-50b0-400b-82e4-b3417b5ed4d1", + "name": "currentPhaseC", + "displayName": "Phase C current", + "displayNameEvent": "Phase C current changed", + "type": "double", + "unit": "Ampere", + "defaultValue": 0.00, + "filter": "adaptive" + }, + { + "id": "76da8f16-44a4-4242-b78b-09c9bb127623", + "name": "voltagePhaseA", + "displayName": "Phase A voltage", + "displayNameEvent": "Phase A volatage changed", + "type": "double", + "unit": "Volt", + "defaultValue": 0.00, + "filter": "adaptive" + }, + { + "id": "7df01eb4-0d4d-400c-b1bc-001ca83a6a3c", + "name": "voltagePhaseB", + "displayName": "Phase B voltage", + "displayNameEvent": "Phase B voltage changed", + "type": "double", + "unit": "Volt", + "defaultValue": 0.00, + "filter": "adaptive" + }, + { + "id": "31814cfe-626d-4168-802b-b7fc6592fc79", + "name": "voltagePhaseC", + "displayName": "Phase C voltage", + "displayNameEvent": "Phase C voltage changed", + "type": "double", + "unit": "Volt", + "defaultValue": 0.00, + "filter": "adaptive" + }, { "id": "b06479d5-7a38-4fbd-867e-e55bdb54651b", "name": "ledBrightness", 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 e393c0c7..8a25ecac 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,29 @@ 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}) +---------- +The name of the StateType ({f9091651-1522-4387-b300-906abd907fb3}) of ThingClass goeHome + + + + + 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}) ---------- @@ -64,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}) ---------- @@ -79,14 +94,14 @@ 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}) ---------- @@ -94,15 +109,15 @@ The name of the StateType ({e8258831-ad89-4d27-b295-e8c10dd42b76}) of ThingClass - + Charge energy changed The name of the EventType ({e8258831-ad89-4d27-b295-e8c10dd42b76}) of ThingClass goeHome - - - + + + Charging current The name of the ParamType (ThingClass: goeHome, ActionType: maxChargingCurrent, ID: {446fb786-bfbe-4938-963c-73d02184573f}) ---------- @@ -112,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}) ---------- @@ -130,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}) ---------- @@ -145,14 +160,59 @@ 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 phase A + The name of the ParamType (ThingClass: goeHome, EventType: currentPowerPhaseA, ID: {c6f68517-c4cd-415d-9455-b1731f7d9a1a}) +---------- +The name of the StateType ({c6f68517-c4cd-415d-9455-b1731f7d9a1a}) of ThingClass goeHome + + + + + 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}) +---------- +The name of the StateType ({92005049-9ab9-4d7d-a7b6-6ab1a36c5f5f}) of ThingClass goeHome + + + + + 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}) +---------- +The name of the StateType ({1076fbd0-f42b-46e3-adc9-004361d6cd51}) of ThingClass goeHome + + + + + 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}) ---------- @@ -160,21 +220,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}) ---------- @@ -184,15 +244,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}) ---------- @@ -202,20 +262,128 @@ 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}) +---------- +The name of the ParamType (ThingClass: goeHome, EventType: absoluteMaxAmpere, ID: {58cd977d-22df-48c9-829a-81554130d607}) +---------- +The name of the StateType ({58cd977d-22df-48c9-829a-81554130d607}) of ThingClass goeHome + + + + + Maximal ampere changed + The name of the EventType ({58cd977d-22df-48c9-829a-81554130d607}) of ThingClass goeHome + + + + + + Phase A current + The name of the ParamType (ThingClass: goeHome, EventType: currentPhaseA, ID: {c8aab9e2-ba53-43b9-95db-e2c3edc97e33}) +---------- +The name of the StateType ({c8aab9e2-ba53-43b9-95db-e2c3edc97e33}) of ThingClass goeHome + + + + + 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}) +---------- +The name of the StateType ({76da8f16-44a4-4242-b78b-09c9bb127623}) of ThingClass goeHome + + + + + + Phase B current + The name of the ParamType (ThingClass: goeHome, EventType: currentPhaseB, ID: {f11ac403-728d-48f3-8669-0e684faf9890}) +---------- +The name of the StateType ({f11ac403-728d-48f3-8669-0e684faf9890}) of ThingClass goeHome + + + + + 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}) +---------- +The name of the StateType ({7df01eb4-0d4d-400c-b1bc-001ca83a6a3c}) of ThingClass goeHome + + + + + 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}) +---------- +The name of the StateType ({55295e1c-50b0-400b-82e4-b3417b5ed4d1}) of ThingClass goeHome + + + + + 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}) +---------- +The name of the StateType ({31814cfe-626d-4168-802b-b7fc6592fc79}) of ThingClass goeHome + + + + + 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}) ---------- @@ -223,38 +391,44 @@ 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 - + 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}) ---------- @@ -262,14 +436,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}) ---------- @@ -277,14 +451,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}) ---------- @@ -292,14 +466,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}) ---------- @@ -307,14 +481,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}) ---------- @@ -322,14 +496,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}) ---------- @@ -337,25 +511,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}) @@ -369,38 +549,38 @@ 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 c4150a4d7b78804162fd43ad6d38b6c4b2f3270e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 30 Sep 2021 11:47:22 +0200 Subject: [PATCH 2/7] Fix http refresh and measuments update --- goecharger/integrationplugingoecharger.cpp | 70 ++++++++++++++++++++-- 1 file changed, 64 insertions(+), 6 deletions(-) diff --git a/goecharger/integrationplugingoecharger.cpp b/goecharger/integrationplugingoecharger.cpp index 3967c233..f300c458 100644 --- a/goecharger/integrationplugingoecharger.cpp +++ b/goecharger/integrationplugingoecharger.cpp @@ -327,12 +327,18 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status } QVariantList temperatureSensorList = statusMap.value("tma").toList(); - if (temperatureSensorList.count() == 4) { + if (temperatureSensorList.count() >= 1) thing->setStateValue(goeHomeTemperatureSensor1StateTypeId, temperatureSensorList.at(0).toDouble()); + + if (temperatureSensorList.count() >= 2) thing->setStateValue(goeHomeTemperatureSensor2StateTypeId, temperatureSensorList.at(1).toDouble()); + + if (temperatureSensorList.count() >= 3) thing->setStateValue(goeHomeTemperatureSensor3StateTypeId, temperatureSensorList.at(2).toDouble()); + + if (temperatureSensorList.count() >= 4) 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); @@ -352,18 +358,66 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status // Parse nrg array QVariantList measurementList = statusMap.value("nrg").toList(); - if (measurementList.count() == 16) { + if (measurementList.count() >= 1) thing->setStateValue(goeHomeVoltagePhaseAStateTypeId, measurementList.at(0).toUInt()); + + if (measurementList.count() >= 2) thing->setStateValue(goeHomeVoltagePhaseBStateTypeId, measurementList.at(1).toUInt()); + + if (measurementList.count() >= 3) thing->setStateValue(goeHomeVoltagePhaseCStateTypeId, measurementList.at(2).toUInt()); + if (measurementList.count() >= 5) thing->setStateValue(goeHomeCurrentPhaseAStateTypeId, measurementList.at(4).toUInt() / 10.0); - thing->setStateValue(goeHomeCurrentPhaseBStateTypeId, measurementList.at(5).toUInt() / 10.0); - thing->setStateValue(goeHomeCurrentPhaseCStateTypeId, measurementList.at(6).toUInt() / 10.0); + else { + thing->setStateValue(goeHomeCurrentPhaseAStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPhaseBStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPhaseCStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); + } + + if (measurementList.count() >= 6) { + thing->setStateValue(goeHomeCurrentPhaseBStateTypeId, measurementList.at(5).toUInt() / 10.0); + } else { + thing->setStateValue(goeHomeCurrentPhaseBStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPhaseCStateTypeId, 0); + + thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); + } + + if (measurementList.count() >= 7) { + thing->setStateValue(goeHomeCurrentPhaseCStateTypeId, measurementList.at(6).toUInt() / 10.0); + } else { + thing->setStateValue(goeHomeCurrentPhaseCStateTypeId, 0); + + thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); + } + + if (measurementList.count() >= 8) { thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, measurementList.at(7).toUInt() / 10.0); + } else { + thing->setStateValue(goeHomeCurrentPowerPhaseAStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); + } + + if (measurementList.count() >= 9) { thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, measurementList.at(8).toUInt() / 10.0); + } else { + thing->setStateValue(goeHomeCurrentPowerPhaseBStateTypeId, 0); + thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); + } + if (measurementList.count() >= 10) { thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, measurementList.at(9).toUInt() / 10.0); + } else { + thing->setStateValue(goeHomeCurrentPowerPhaseCStateTypeId, 0); } } } @@ -605,7 +659,11 @@ void IntegrationPluginGoECharger::refreshHttp() { // Update all things which don't use mqtt foreach (Thing *thing, myThings()) { - if (thing->paramValue(goeHomeThingUseMqttParamTypeId).toBool()) { + if (thing->thingClassId() != goeHomeThingClassId) + continue; + + // Poll thing which is not using mqtt + if (!thing->paramValue(goeHomeThingUseMqttParamTypeId).toBool()) { qCDebug(dcGoECharger()) << "Refresh HTTP status from" << thing; QNetworkReply *reply = hardwareManager()->networkManager()->get(buildStatusRequest(thing)); connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater); From 53fe4739131f31d7c64e560ac616c5578c718b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 30 Sep 2021 11:53:21 +0200 Subject: [PATCH 3/7] Use ama for backwards compatibility --- goecharger/integrationplugingoecharger.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/goecharger/integrationplugingoecharger.cpp b/goecharger/integrationplugingoecharger.cpp index f300c458..14daa350 100644 --- a/goecharger/integrationplugingoecharger.cpp +++ b/goecharger/integrationplugingoecharger.cpp @@ -205,7 +205,7 @@ void IntegrationPluginGoECharger::executeAction(ThingActionInfo *info) uint maxChargingCurrent = action.paramValue(goeHomeMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toUInt(); qCDebug(dcGoECharger()) << "Setting max charging current to" << maxChargingCurrent << "A"; // Set the allow value - QString configuration = QString("amx=%1").arg(maxChargingCurrent); + QString configuration = QString("amp=%1").arg(maxChargingCurrent); sendActionRequest(thing, info, configuration); return; } else if (action.actionTypeId() == goeHomeAbsoluteMaxAmpereActionTypeId) { @@ -346,7 +346,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()); - thing->setStateValue(goeHomeMaxChargingCurrentStateTypeId, statusMap.value("amx").toUInt()); + thing->setStateValue(goeHomeMaxChargingCurrentStateTypeId, statusMap.value("amp").toUInt()); thing->setStateValue(goeHomeLedBrightnessStateTypeId, statusMap.value("lbr").toUInt()); thing->setStateValue(goeHomeLedEnergySaveStateTypeId, statusMap.value("lse").toBool()); thing->setStateValue(goeHomeSerialNumberStateTypeId, statusMap.value("sse").toString()); From 588e754f1f1c218e38fe8b31abbde50820d9fc64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 30 Sep 2021 12:10:26 +0200 Subject: [PATCH 4/7] Add todo in code for later implementation --- goecharger/integrationplugingoecharger.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/goecharger/integrationplugingoecharger.cpp b/goecharger/integrationplugingoecharger.cpp index 14daa350..3cd2fa47 100644 --- a/goecharger/integrationplugingoecharger.cpp +++ b/goecharger/integrationplugingoecharger.cpp @@ -211,6 +211,7 @@ void IntegrationPluginGoECharger::executeAction(ThingActionInfo *info) } else if (action.actionTypeId() == goeHomeAbsoluteMaxAmpereActionTypeId) { uint maxAmpere = action.paramValue(goeHomeAbsoluteMaxAmpereActionAbsoluteMaxAmpereParamTypeId).toUInt(); qCDebug(dcGoECharger()) << "Setting absolute maximal charging amperes to" << maxAmpere << "A"; + // TODO: use amx if available // Set the allow value QString configuration = QString("ama=%1").arg(maxAmpere); sendActionRequest(thing, info, configuration); From 508f1f4be80dc8cffa7d5c9c0424403685849a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 30 Sep 2021 16:03:33 +0200 Subject: [PATCH 5/7] Set charging limits according to maximal limit of the hardware or settings --- goecharger/integrationplugingoecharger.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/goecharger/integrationplugingoecharger.cpp b/goecharger/integrationplugingoecharger.cpp index 3cd2fa47..49eaf240 100644 --- a/goecharger/integrationplugingoecharger.cpp +++ b/goecharger/integrationplugingoecharger.cpp @@ -340,7 +340,6 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status if (temperatureSensorList.count() >= 4) 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(goeHomePowerStateTypeId, (statusMap.value("alw").toUInt() == 0 ? false : true)); @@ -351,11 +350,16 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status thing->setStateValue(goeHomeLedBrightnessStateTypeId, statusMap.value("lbr").toUInt()); thing->setStateValue(goeHomeLedEnergySaveStateTypeId, statusMap.value("lse").toBool()); thing->setStateValue(goeHomeSerialNumberStateTypeId, statusMap.value("sse").toString()); - - // TODO: set min max for charging current according to these states - thing->setStateValue(goeHomeAbsoluteMaxAmpereStateTypeId, statusMap.value("ama").toUInt()); thing->setStateValue(goeHomeAdapterConnectedStateTypeId, (statusMap.value("adi").toUInt() == 0 ? false : true)); - thing->setStateValue(goeHomeCableType2AmpereStateTypeId, statusMap.value("cbl").toUInt()); + + 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); // Parse nrg array QVariantList measurementList = statusMap.value("nrg").toList(); From 2807cd970f8854f31f3828d20d1b0072fc40b0a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 30 Sep 2021 18:08:25 +0200 Subject: [PATCH 6/7] Fix http updating for goe --- goecharger/integrationplugingoecharger.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/goecharger/integrationplugingoecharger.cpp b/goecharger/integrationplugingoecharger.cpp index 49eaf240..c355db9c 100644 --- a/goecharger/integrationplugingoecharger.cpp +++ b/goecharger/integrationplugingoecharger.cpp @@ -130,12 +130,15 @@ void IntegrationPluginGoECharger::setupThing(ThingSetupInfo *info) QVariantMap statusMap = jsonDoc.toVariant().toMap(); if (thing->paramValue(goeHomeThingUseMqttParamTypeId).toBool()) { // Verify mqtt client and set it up + qCDebug(dcGoECharger()) << "Setup using MQTT connection for" << thing; QHostAddress address = QHostAddress(thing->paramValue(goeHomeThingIpAddressParamTypeId).toString()); setupMqttChannel(info, address, statusMap); } else { // Since we are not using mqtt, we are done with the setup, the refresh timer will be configured in post setup info->finish(Thing::ThingErrorNoError); + qCDebug(dcGoECharger()) << "Setup using HTTP finished successfully"; update(thing, statusMap); + thing->setStateValue(goeHomeConnectedStateTypeId, true); } }); return; @@ -148,11 +151,12 @@ void IntegrationPluginGoECharger::postSetupThing(Thing *thing) { if (thing->thingClassId() == goeHomeThingClassId) { // Set up refresh timer if needed and if we are not using mqtt - if (thing->paramValue(goeHomeThingUseMqttParamTypeId).toBool()) { + if (!thing->paramValue(goeHomeThingUseMqttParamTypeId).toBool()) { if (!m_refreshTimer) { m_refreshTimer = hardwareManager()->pluginTimerManager()->registerTimer(4); connect(m_refreshTimer, &PluginTimer::timeout, this, &IntegrationPluginGoECharger::refreshHttp); m_refreshTimer->start(); + qCDebug(dcGoECharger()) << "Enable HTTP refresh timer..."; } } } @@ -667,7 +671,7 @@ void IntegrationPluginGoECharger::refreshHttp() if (thing->thingClassId() != goeHomeThingClassId) continue; - // Poll thing which is not using mqtt + // Poll thing which if not using mqtt if (!thing->paramValue(goeHomeThingUseMqttParamTypeId).toBool()) { qCDebug(dcGoECharger()) << "Refresh HTTP status from" << thing; QNetworkReply *reply = hardwareManager()->networkManager()->get(buildStatusRequest(thing)); From 7bc1d802d4a2cc5b3a71e48af8228069450439da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Mon, 4 Oct 2021 14:36:25 +0200 Subject: [PATCH 7/7] Disable unlanded min max state value setting --- goecharger/integrationplugingoecharger.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/goecharger/integrationplugingoecharger.cpp b/goecharger/integrationplugingoecharger.cpp index c355db9c..2d9c2cc4 100644 --- a/goecharger/integrationplugingoecharger.cpp +++ b/goecharger/integrationplugingoecharger.cpp @@ -360,7 +360,8 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status uint cableLimit = statusMap.value("cbl").toUInt(); // Set the limit for the max charging amps - thing->setStateMaxValue(goeHomeMaxChargingCurrentStateTypeId, qMin(amaLimit, cableLimit)); + // FIXME: set the max value for the state to limit + //thing->setStateMaxValue(goeHomeMaxChargingCurrentStateTypeId, qMin(amaLimit, cableLimit)); thing->setStateValue(goeHomeAbsoluteMaxAmpereStateTypeId, amaLimit); thing->setStateValue(goeHomeCableType2AmpereStateTypeId, cableLimit);