From ecd2562b26638aba2d5cf968104576e88a1b6cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 26 Aug 2021 09:14:06 +0200 Subject: [PATCH 1/2] Add plugedIn interface state for goE-Charger --- goecharger/integrationplugingoecharger.cpp | 8 ++++++++ goecharger/integrationplugingoecharger.json | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/goecharger/integrationplugingoecharger.cpp b/goecharger/integrationplugingoecharger.cpp index 9a76348e..d8c278f3 100644 --- a/goecharger/integrationplugingoecharger.cpp +++ b/goecharger/integrationplugingoecharger.cpp @@ -266,15 +266,19 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status switch (carState) { case CarStateReadyNoCar: thing->setStateValue(goeHomeCarStatusStateTypeId, "Ready but no vehicle connected"); + thing->setStateValue(goeHomePluggedInStateTypeId, false); break; case CarStateCharging: thing->setStateValue(goeHomeCarStatusStateTypeId, "Vehicle loads"); + thing->setStateValue(goeHomePluggedInStateTypeId, true); break; case CarStateWaitForCar: thing->setStateValue(goeHomeCarStatusStateTypeId, "Waiting for vehicle"); + thing->setStateValue(goeHomePluggedInStateTypeId, false); break; case CarStateChargedCarConnected: thing->setStateValue(goeHomeCarStatusStateTypeId, "Charging finished and vehicle still connected"); + thing->setStateValue(goeHomePluggedInStateTypeId, true); break; } @@ -403,6 +407,7 @@ void IntegrationPluginGoECharger::setupMqttChannel(ThingSetupInfo *info, const Q qCDebug(dcGoECharger()) << "Configured successfully MQTT server" << thing << channel->serverAddress().toString(); } + // Configure the port QNetworkRequest request = buildConfigurationRequest(address, QString("mcp=%1").arg(channel->serverPort())); qCDebug(dcGoECharger()) << "Configure nymea mqtt server port on" << thing << request.url().toString(); QNetworkReply *reply = hardwareManager()->networkManager()->sendCustomRequest(request, "SET"); @@ -432,6 +437,7 @@ void IntegrationPluginGoECharger::setupMqttChannel(ThingSetupInfo *info, const Q qCDebug(dcGoECharger()) << "Configured successfully MQTT server" << thing << channel->serverPort(); } + // Username QNetworkRequest request = buildConfigurationRequest(address, QString("mcu=%1").arg(channel->username())); qCDebug(dcGoECharger()) << "Configure nymea mqtt server user name on" << thing << request.url().toString(); QNetworkReply *reply = hardwareManager()->networkManager()->sendCustomRequest(request, "SET"); @@ -461,6 +467,7 @@ void IntegrationPluginGoECharger::setupMqttChannel(ThingSetupInfo *info, const Q qCDebug(dcGoECharger()) << "Configured successfully MQTT server" << thing << channel->username(); } + // Password QNetworkRequest request = buildConfigurationRequest(address, QString("mck=%1").arg(channel->password())); qCDebug(dcGoECharger()) << "Configure nymea mqtt server password on" << thing << request.url().toString(); QNetworkReply *reply = hardwareManager()->networkManager()->sendCustomRequest(request, "SET"); @@ -490,6 +497,7 @@ void IntegrationPluginGoECharger::setupMqttChannel(ThingSetupInfo *info, const Q qCDebug(dcGoECharger()) << "Configured successfully MQTT server" << thing << channel->password(); } + // Enable MQTT QNetworkRequest request = buildConfigurationRequest(address, QString("mce=1")); qCDebug(dcGoECharger()) << "Enable custom mqtt server on" << thing << request.url().toString(); QNetworkReply *reply = hardwareManager()->networkManager()->sendCustomRequest(request, "SET"); diff --git a/goecharger/integrationplugingoecharger.json b/goecharger/integrationplugingoecharger.json index d27255dc..414e0c75 100644 --- a/goecharger/integrationplugingoecharger.json +++ b/goecharger/integrationplugingoecharger.json @@ -53,6 +53,14 @@ "defaultValue": "Ready but no vehicle connected", "suggestLogging": true }, + { + "id": "6cb155b1-0831-47bc-8657-17ca68716684", + "name": "pluggedIn", + "displayName": "Car plugged in", + "displayNameEvent": "Car plugged in changed", + "type": "bool", + "defaultValue": false + }, { "id": "d80e1ed8-c3ae-4b68-bf86-21b4d7b2b201", "name": "access", From a36782a088c641966c2e1c89b4a1aa71f586edcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 2 Sep 2021 15:35:36 +0200 Subject: [PATCH 2/2] Update translations --- ...fca21-3f41-4a67-bc8c-c8b333411bd9-en_US.ts | 315 +++++++++++++----- 1 file changed, 224 insertions(+), 91 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 ffd1a6b3..e393c0c7 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,57 +13,96 @@ 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 - - - Car state - The name of the ParamType (ThingClass: goeHome, EventType: carStatus, ID: {c69053bc-3a53-4e76-868b-ccf0958e9e44}) + + + Adapter connected + The name of the ParamType (ThingClass: goeHome, EventType: adapterConnected, ID: {d557e59e-ca22-4aff-bf80-dfee44db0f69}) ---------- -The name of the StateType ({c69053bc-3a53-4e76-868b-ccf0958e9e44}) of ThingClass goeHome +The name of the StateType ({d557e59e-ca22-4aff-bf80-dfee44db0f69}) of ThingClass goeHome - - Car status changed - The name of the EventType ({c69053bc-3a53-4e76-868b-ccf0958e9e44}) of ThingClass goeHome + + Adapter connected changed + The name of the EventType ({d557e59e-ca22-4aff-bf80-dfee44db0f69}) 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 + + + + + Allow charging The name of the ParamType (ThingClass: goeHome, ActionType: power, ID: {8a7ab9f1-0143-494c-98ee-69f94125fe42}) ---------- +The name of the ActionType ({8a7ab9f1-0143-494c-98ee-69f94125fe42}) of ThingClass goeHome +---------- The name of the ParamType (ThingClass: goeHome, EventType: power, ID: {8a7ab9f1-0143-494c-98ee-69f94125fe42}) ---------- The name of the StateType ({8a7ab9f1-0143-494c-98ee-69f94125fe42}) of ThingClass goeHome - - - + + Allow charging changed + The name of the EventType ({8a7ab9f1-0143-494c-98ee-69f94125fe42}) of ThingClass goeHome + + + + + + Car plugged in + The name of the ParamType (ThingClass: goeHome, EventType: pluggedIn, ID: {6cb155b1-0831-47bc-8657-17ca68716684}) +---------- +The name of the StateType ({6cb155b1-0831-47bc-8657-17ca68716684}) of ThingClass goeHome + + + + + 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}) +---------- +The name of the StateType ({c69053bc-3a53-4e76-868b-ccf0958e9e44}) of ThingClass goeHome + + + + + 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 current The name of the ParamType (ThingClass: goeHome, ActionType: maxChargingCurrent, ID: {446fb786-bfbe-4938-963c-73d02184573f}) ---------- @@ -73,21 +112,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 - - Charging status changed - The name of the EventType ({8a7ab9f1-0143-494c-98ee-69f94125fe42}) of ThingClass goeHome - - - - - - + + + Cloud enabled The name of the ParamType (ThingClass: goeHome, ActionType: cloud, ID: {ac849296-3f70-4b1b-aa30-127d774667bb}) ---------- @@ -97,14 +130,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}) ---------- @@ -112,14 +145,14 @@ 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 - - + + Firmware version The name of the ParamType (ThingClass: goeHome, EventType: firmwareVersion, ID: {5d18b48d-b886-409e-ab2e-336d9c94a55c}) ---------- @@ -127,35 +160,62 @@ 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, EventType: ledBrightness, ID: {b06479d5-7a38-4fbd-867e-e55bdb54651b}) + The name of the ParamType (ThingClass: goeHome, ActionType: ledBrightness, ID: {b06479d5-7a38-4fbd-867e-e55bdb54651b}) +---------- +The name of the ParamType (ThingClass: goeHome, EventType: ledBrightness, ID: {b06479d5-7a38-4fbd-867e-e55bdb54651b}) ---------- The name of the StateType ({b06479d5-7a38-4fbd-867e-e55bdb54651b}) of ThingClass goeHome - + 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}) +---------- +The name of the ParamType (ThingClass: goeHome, EventType: ledEnergySave, ID: {048a4c98-3ee4-4d02-ad48-6d70f31fce8c}) +---------- +The name of the StateType ({048a4c98-3ee4-4d02-ad48-6d70f31fce8c}) of ThingClass goeHome + + + + + 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}) + + + + + Serial number The name of the ParamType (ThingClass: goeHome, EventType: serialNumber, ID: {8ecdf24b-daca-4b7a-98b5-3236f1e6ad85}) ---------- @@ -163,47 +223,113 @@ 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 - - Start charging - The name of the ActionType ({8a7ab9f1-0143-494c-98ee-69f94125fe42}) 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 + + + + + + Temperature 1 + The name of the ParamType (ThingClass: goeHome, EventType: temperatureSensor1, ID: {2bf1ebf1-0d8c-4209-ad35-4114d9861832}) +---------- +The name of the StateType ({2bf1ebf1-0d8c-4209-ad35-4114d9861832}) of ThingClass goeHome + + + + + 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}) +---------- +The name of the StateType ({558e273a-4028-495a-902a-e4e932a0ae24}) of ThingClass goeHome + + + + + 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}) +---------- +The name of the StateType ({dbf8a5dc-b8f5-437a-ac0c-c4cf8a09aacb}) of ThingClass goeHome + + + + + 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}) +---------- +The name of the StateType ({1953e29f-fe28-4016-9b05-f4baf4c311ff}) of ThingClass goeHome + + + + + 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: totalEnergy, ID: {d8f5abb6-5db3-4040-8829-553b1d881ce4}) + The name of the ParamType (ThingClass: goeHome, EventType: totalEnergyConsumed, ID: {d8f5abb6-5db3-4040-8829-553b1d881ce4}) ---------- The name of the StateType ({d8f5abb6-5db3-4040-8829-553b1d881ce4}) of ThingClass goeHome - + 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}) ---------- @@ -211,25 +337,25 @@ 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 - + 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}) @@ -238,36 +364,43 @@ The name of the StateType ({08b107bc-1284-455d-9e5a-6a1c3adc389f}) of ThingClass IntegrationPluginGoECharger - - - - - - + + The network device discovery is not available. + + + + + + + + + + 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.