diff --git a/keba/integrationpluginkeba.cpp b/keba/integrationpluginkeba.cpp index 4afd45d0..d502b14d 100644 --- a/keba/integrationpluginkeba.cpp +++ b/keba/integrationpluginkeba.cpp @@ -195,6 +195,7 @@ void DevicePluginKeba::onCommandExecuted(QUuid requestId, bool success) void DevicePluginKeba::onReportOneReceived(const KeContact::ReportOne &reportOne) { + Q_UNUSED(reportOne); KeContact *keba = static_cast(sender()); if (m_asyncSetup.contains(keba)) { DeviceSetupInfo *info = m_asyncSetup.value(keba); @@ -202,13 +203,6 @@ void DevicePluginKeba::onReportOneReceived(const KeContact::ReportOne &reportOne } else { qCDebug(dcKebaKeContact()) << "Report one received without an associated async setup"; - - Device *device = myDevices().findById(m_kebaDevices.key(keba)); - if (!device) { - qCWarning(dcKebaKeContact()) << "Could not set serialnumber because of missing device object"; - return; - } - device->setParamValue(wallboxDeviceSerialnumberParamTypeId, reportOne.serialNumber); } } @@ -219,6 +213,8 @@ void DevicePluginKeba::onReportTwoReceived(const KeContact::ReportTwo &reportTwo if (!device) return; + device->setStateValue(wallboxPowerStateTypeId, reportTwo.enableUser); + switch (reportTwo.state) { case KeContact::State::Starting: device->setStateValue(wallboxActivityStateTypeId, QT_TR_NOOP("Starting")); @@ -272,7 +268,7 @@ void DevicePluginKeba::onReportThreeReceived(const KeContact::ReportThree &repor device->setStateValue(wallboxU1EventTypeId, reportThree.VoltagePhase1); device->setStateValue(wallboxU2EventTypeId, reportThree.VoltagePhase2); device->setStateValue(wallboxU3EventTypeId, reportThree.VoltagePhase3); - device->setStateValue(wallboxPStateTypeId, reportThree.Power); + device->setStateValue(wallboxPStateTypeId, reportThree.Power); device->setStateValue(wallboxEPStateTypeId, reportThree.EnergySession); device->setStateValue(wallboxTotalEnergyConsumedStateTypeId, reportThree.EnergyTotal); } diff --git a/keba/integrationpluginkeba.json b/keba/integrationpluginkeba.json index fc1b9a20..6a5f4d73 100644 --- a/keba/integrationpluginkeba.json +++ b/keba/integrationpluginkeba.json @@ -30,14 +30,6 @@ "type": "QString", "inputType": "TextLine", "defaultValue":"" - }, - { - "id": "1a600fb6-08b2-4155-a4ad-ceca1d4fa7e1", - "name": "serialnumber", - "displayName": "Serialnumber", - "type": "QString", - "inputType": "TextLine", - "defaultValue":"" } ], "stateTypes": [ diff --git a/keba/kecontact.cpp b/keba/kecontact.cpp index fe5a05c9..e7a981ec 100644 --- a/keba/kecontact.cpp +++ b/keba/kecontact.cpp @@ -43,9 +43,6 @@ KeContact::KeContact(QHostAddress address, QObject *parent) : connect(m_requestTimeoutTimer, &QTimer::timeout, this, [this] { //This timer will be started when a request is sent and stopped or resetted when a response has been received emit connectionChanged(false); - if (!m_pendingRequests.isEmpty()){ - m_pendingRequests.removeFirst(); - } //Try to send the next command handleNextCommandInQueue(); }); @@ -132,6 +129,12 @@ QUuid KeContact::enableOutput(bool state) } qCDebug(dcKebaKeContact()) << "Datagram : " << datagram; sendCommand(datagram); + QTimer::singleShot(5000, this, [requestId, this] { + if (m_pendingRequests.contains(requestId)) { + m_pendingRequests.removeOne(requestId); + emit commandExecuted(requestId, false); + } + }); return requestId; } @@ -145,6 +148,10 @@ QUuid KeContact::setMaxAmpere(int milliAmpere) data.append("curr " + QVariant(milliAmpere).toByteArray()); qCDebug(dcKebaKeContact()) << "send command: " << data; sendCommand(data); + if (m_pendingRequests.contains(requestId)) { + m_pendingRequests.removeOne(requestId); + emit commandExecuted(requestId, false); + } return requestId; } @@ -167,6 +174,10 @@ QUuid KeContact::displayMessage(const QByteArray &message) data.append("display 0 0 0 0 " + modifiedMessage); qCDebug(dcKebaKeContact()) << "send command: " << data; sendCommand(data); + if (m_pendingRequests.contains(requestId)) { + m_pendingRequests.removeOne(requestId); + emit commandExecuted(requestId, false); + } return requestId; } diff --git a/keba/translations/9142b09f-30a9-43d0-9ede-2f8debe075ac-en_US.ts b/keba/translations/9142b09f-30a9-43d0-9ede-2f8debe075ac-en_US.ts index 2614c172..1e6ec97b 100644 --- a/keba/translations/9142b09f-30a9-43d0-9ede-2f8debe075ac-en_US.ts +++ b/keba/translations/9142b09f-30a9-43d0-9ede-2f8debe075ac-en_US.ts @@ -4,171 +4,369 @@ IntegrationPluginKeba - + Error opening network port. - Error setting up thing - - The provided IP adress is not valid. - Error setting up thing + + Starting - - Device with IP adress %1 is already added in the system. - Error setting up thing + + Not ready for charging + + + + + Ready for charging + + + + + Charging + + + + + Erro + + + + + Authorization rejected + + + + + Unplugged + + + + + Plugged in charging station + + + + + Plugged in on EV + + + + + Plugged in and locked + + + + + Plugged in on EV and locked KebaKeContact - + + Keba KeContact - The name of the plugin KebaKeContact ({9142b09f-30a9-43d0-9ede-2f8debe075ac}) + The name of the DeviceClass ({900dacec-cae7-4a37-95ba-501846368ea2}) +---------- +The name of the plugin KebaKeContact ({9142b09f-30a9-43d0-9ede-2f8debe075ac}) - + Keba The name of the vendor ({f7cda40b-829a-4675-abaa-485697430f5f}) - - Keba KeContact P30 - The name of the ThingClass ({900dacec-cae7-4a37-95ba-501846368ea2}) - - - - - IP Address - The name of the ParamType (ThingClass: wallbox, Type: thing, ID: {730cd3d3-5f0e-4028-a8c2-ced7574f13f3}) - - - - + Activity changed - The name of the EventType ({539e5602-6dd9-465d-9705-3bb59bcf8982}) of ThingClass wallbox + The name of the EventType ({539e5602-6dd9-465d-9705-3bb59bcf8982}) of DeviceClass wallbox - - + + Activity - The name of the ParamType (ThingClass: wallbox, EventType: activity, ID: {539e5602-6dd9-465d-9705-3bb59bcf8982}) + The name of the ParamType (DeviceClass: wallbox, EventType: activity, ID: {539e5602-6dd9-465d-9705-3bb59bcf8982}) ---------- -The name of the StateType ({539e5602-6dd9-465d-9705-3bb59bcf8982}) of ThingClass wallbox +The name of the StateType ({539e5602-6dd9-465d-9705-3bb59bcf8982}) of DeviceClass wallbox - - - Plug State - The name of the ParamType (ThingClass: wallbox, EventType: plugState, ID: {3b4d29f3-3101-47ad-90fd-269b6348783b}) + + + Connected + The name of the ParamType (DeviceClass: wallbox, EventType: connected, ID: {ce813458-d7d8-4f40-9648-dba4c41e92f0}) ---------- -The name of the StateType ({3b4d29f3-3101-47ad-90fd-269b6348783b}) of ThingClass wallbox +The name of the StateType ({ce813458-d7d8-4f40-9648-dba4c41e92f0}) of DeviceClass wallbox - - - Current - The name of the ParamType (ThingClass: wallbox, EventType: current, ID: {a29c1748-fe97-4830-a56e-e1cc4e618385}) ----------- -The name of the StateType ({a29c1748-fe97-4830-a56e-e1cc4e618385}) of ThingClass wallbox + + Connection changed + The name of the EventType ({ce813458-d7d8-4f40-9648-dba4c41e92f0}) of DeviceClass wallbox - - - - maximal Current - The name of the ParamType (ThingClass: wallbox, ActionType: maxCurrent, ID: {593656f0-babf-4308-8767-68f34e10fb15}) + + + Current Phase 1 + The name of the ParamType (DeviceClass: wallbox, EventType: I1, ID: {31ec17b0-11e3-4332-92b0-fea821cf024f}) ---------- -The name of the ParamType (ThingClass: wallbox, EventType: maxCurrent, ID: {593656f0-babf-4308-8767-68f34e10fb15}) +The name of the StateType ({31ec17b0-11e3-4332-92b0-fea821cf024f}) of DeviceClass wallbox + + + + + + Current Phase 2 + The name of the ParamType (DeviceClass: wallbox, EventType: I2, ID: {cdc7e10a-0d0a-4e93-ad2c-d34ffca45c97}) +---------- +The name of the StateType ({cdc7e10a-0d0a-4e93-ad2c-d34ffca45c97}) of DeviceClass wallbox + + + + + + Current Phase 3 + The name of the ParamType (DeviceClass: wallbox, EventType: I3, ID: {da838dc8-85f0-4e55-b4b5-cb93a43b373d}) +---------- +The name of the StateType ({da838dc8-85f0-4e55-b4b5-cb93a43b373d}) of DeviceClass wallbox + + + + + Current phase 1 changed + The name of the EventType ({31ec17b0-11e3-4332-92b0-fea821cf024f}) of DeviceClass wallbox + + + + + Current phase 2 changed + The name of the EventType ({cdc7e10a-0d0a-4e93-ad2c-d34ffca45c97}) of DeviceClass wallbox + + + + + Current phase 3 changed + The name of the EventType ({da838dc8-85f0-4e55-b4b5-cb93a43b373d}) of DeviceClass wallbox + + + + + Display + The name of the ActionType ({158b1a8f-fde9-4191-bf42-4ece5fe582e6}) of DeviceClass wallbox + + + + + Display message + The name of the ParamType (DeviceClass: wallbox, ActionType: display, ID: {4e69a761-f4f1-42d0-83db-380894a86ebc}) + + + + + IPv4 Address + The name of the ParamType (DeviceClass: wallbox, Type: device, ID: {730cd3d3-5f0e-4028-a8c2-ced7574f13f3}) + + + + + MAC Address + The name of the ParamType (DeviceClass: wallbox, Type: device, ID: {c2df921d-ff8b-411c-9b1d-04a437d7dfa6}) + + + + + + + Maximal charging current + The name of the ParamType (DeviceClass: wallbox, ActionType: maxChargingCurrent, ID: {593656f0-babf-4308-8767-68f34e10fb15}) +---------- +The name of the ParamType (DeviceClass: wallbox, EventType: maxChargingCurrent, ID: {593656f0-babf-4308-8767-68f34e10fb15}) ---------- The name of the StateType ({593656f0-babf-4308-8767-68f34e10fb15}) of ThingClass wallbox - - + + Maximal charging current changed + The name of the EventType ({593656f0-babf-4308-8767-68f34e10fb15}) of DeviceClass wallbox + + + + + + Maximal charging current in Percent + The name of the ParamType (DeviceClass: wallbox, EventType: maxChargingCurrentPercent, ID: {3c7b83a0-0e42-47bf-9788-dde6aab5ceea}) +---------- +The name of the StateType ({3c7b83a0-0e42-47bf-9788-dde6aab5ceea}) of DeviceClass wallbox + + + + + Maximal charging current percentage changed + The name of the EventType ({3c7b83a0-0e42-47bf-9788-dde6aab5ceea}) of DeviceClass wallbox + + + + + + Plug State + The name of the ParamType (DeviceClass: wallbox, EventType: plugState, ID: {3b4d29f3-3101-47ad-90fd-269b6348783b}) +---------- +The name of the StateType ({3b4d29f3-3101-47ad-90fd-269b6348783b}) of DeviceClass wallbox + + + + + + Power consumption + The name of the ParamType (DeviceClass: wallbox, EventType: P, ID: {7af9e93b-099d-4d9d-a480-9c0f66aecd8b}) +---------- +The name of the StateType ({7af9e93b-099d-4d9d-a480-9c0f66aecd8b}) of DeviceClass wallbox + + + + + Power consumtion changed + The name of the EventType ({7af9e93b-099d-4d9d-a480-9c0f66aecd8b}) of DeviceClass wallbox + + + + + + Present energy + The name of the ParamType (DeviceClass: wallbox, EventType: EP, ID: {8e277efe-21ef-4536-bfc0-901b32d44d7c}) +---------- +The name of the StateType ({8e277efe-21ef-4536-bfc0-901b32d44d7c}) of DeviceClass wallbox + + + + + Present energy changed + The name of the EventType ({8e277efe-21ef-4536-bfc0-901b32d44d7c}) of DeviceClass wallbox + + + + + Serialnumber + The name of the ParamType (DeviceClass: wallbox, Type: device, ID: {1a600fb6-08b2-4155-a4ad-ceca1d4fa7e1}) + + + + + Set Power + The name of the ActionType ({83ed0774-2a91-434d-b03c-d920d02f2981}) of DeviceClass wallbox + + + + + Set maximal charging current + The name of the ActionType ({593656f0-babf-4308-8767-68f34e10fb15}) of DeviceClass wallbox + + + + + + Total energy consumed + The name of the ParamType (DeviceClass: wallbox, EventType: totalEnergyConsumed, ID: {41e179b3-29a2-43ec-b537-023a527081e8}) +---------- +The name of the StateType ({41e179b3-29a2-43ec-b537-023a527081e8}) of DeviceClass wallbox + + + + + Total energy consumption changed + The name of the EventType ({41e179b3-29a2-43ec-b537-023a527081e8}) of DeviceClass wallbox + + + + + + Voltage Phase 2 + The name of the ParamType (DeviceClass: wallbox, EventType: U2, ID: {c8344ca5-21ac-4cd1-8f4b-e5ed202c5862}) +---------- +The name of the StateType ({c8344ca5-21ac-4cd1-8f4b-e5ed202c5862}) of DeviceClass wallbox + + + + + + Voltage Phase 3 + The name of the ParamType (DeviceClass: wallbox, EventType: U3, ID: {5f01e86c-0943-4849-a01a-db441916ebd5}) +---------- +The name of the StateType ({5f01e86c-0943-4849-a01a-db441916ebd5}) of DeviceClass wallbox + + + + + + Voltage phase 1 + The name of the ParamType (DeviceClass: wallbox, EventType: U1, ID: {4a2d75d8-a3a0-4b40-9ca7-e8b6f11d0ef9}) +---------- +The name of the StateType ({4a2d75d8-a3a0-4b40-9ca7-e8b6f11d0ef9}) of DeviceClass wallbox + + + + + Voltage phase 1 changed + The name of the EventType ({4a2d75d8-a3a0-4b40-9ca7-e8b6f11d0ef9}) of DeviceClass wallbox + + + + + Voltage phase 2 changed + The name of the EventType ({c8344ca5-21ac-4cd1-8f4b-e5ed202c5862}) of DeviceClass wallbox + + + + + Voltage phase 3 changed + The name of the EventType ({5f01e86c-0943-4849-a01a-db441916ebd5}) of DeviceClass wallbox + + + + + + Current + The name of the ParamType (DeviceClass: wallbox, EventType: current, ID: {a29c1748-fe97-4830-a56e-e1cc4e618385}) +---------- +The name of the StateType ({a29c1748-fe97-4830-a56e-e1cc4e618385}) of DeviceClass wallbox + + + + + + Power - The name of the ParamType (ThingClass: wallbox, EventType: power, ID: {e8f069ca-7fa7-4568-8d4c-165f6d048720}) + The name of the ParamType (DeviceClass: wallbox, ActionType: power, ID: {83ed0774-2a91-434d-b03c-d920d02f2981}) ---------- -The name of the StateType ({e8f069ca-7fa7-4568-8d4c-165f6d048720}) of ThingClass wallbox +The name of the ParamType (DeviceClass: wallbox, EventType: power, ID: {83ed0774-2a91-434d-b03c-d920d02f2981}) +---------- +The name of the StateType ({83ed0774-2a91-434d-b03c-d920d02f2981}) of DeviceClass wallbox - - - - Output - The name of the ParamType (ThingClass: wallbox, ActionType: outEnable, ID: {0cd5396a-bc41-4c8f-b037-db10991a76c7}) ----------- -The name of the ParamType (ThingClass: wallbox, EventType: outEnable, ID: {0cd5396a-bc41-4c8f-b037-db10991a76c7}) ----------- -The name of the StateType ({0cd5396a-bc41-4c8f-b037-db10991a76c7}) of ThingClass wallbox - - - - + Plug State changed - The name of the EventType ({3b4d29f3-3101-47ad-90fd-269b6348783b}) of ThingClass wallbox + The name of the EventType ({3b4d29f3-3101-47ad-90fd-269b6348783b}) of DeviceClass wallbox - + Current changed - The name of the EventType ({a29c1748-fe97-4830-a56e-e1cc4e618385}) of ThingClass wallbox + The name of the EventType ({a29c1748-fe97-4830-a56e-e1cc4e618385}) of DeviceClass wallbox - - Maximal Current changed - The name of the EventType ({593656f0-babf-4308-8767-68f34e10fb15}) of ThingClass wallbox - - - - - Set maximal current - The name of the ActionType ({593656f0-babf-4308-8767-68f34e10fb15}) of ThingClass wallbox - - - - + Power changed - The name of the EventType ({e8f069ca-7fa7-4568-8d4c-165f6d048720}) of ThingClass wallbox - - - - - Output Enable changed - The name of the EventType ({0cd5396a-bc41-4c8f-b037-db10991a76c7}) of ThingClass wallbox - - - - - Set Output - The name of the ActionType ({0cd5396a-bc41-4c8f-b037-db10991a76c7}) of ThingClass wallbox - - - - - Device Reachable changed - The name of the EventType ({b1a574a6-46b6-44ea-a0bb-9b4de3198967}) of ThingClass wallbox - - - - - - reachable - The name of the ParamType (ThingClass: wallbox, EventType: reachable, ID: {b1a574a6-46b6-44ea-a0bb-9b4de3198967}) ----------- -The name of the StateType ({b1a574a6-46b6-44ea-a0bb-9b4de3198967}) of ThingClass wallbox + The name of the EventType ({83ed0774-2a91-434d-b03c-d920d02f2981}) of DeviceClass wallbox