From 2aed3d0f613ee5fd501fb820cc16ab7ba916fe69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Mon, 22 Dec 2025 16:01:12 +0100 Subject: [PATCH] Webasto: Update EV charger interface and add full charging current resolution --- webasto/integrationpluginwebasto.cpp | 6 +++--- webasto/integrationpluginwebasto.json | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/webasto/integrationpluginwebasto.cpp b/webasto/integrationpluginwebasto.cpp index 33b8879..4c7d389 100644 --- a/webasto/integrationpluginwebasto.cpp +++ b/webasto/integrationpluginwebasto.cpp @@ -513,7 +513,7 @@ void IntegrationPluginWebasto::executeAction(ThingActionInfo *info) m_asyncActions.insert(requestId, info); } } else if (action.actionTypeId() == webastoLiveMaxChargingCurrentActionTypeId) { - int ampere = action.paramValue(webastoLiveMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toUInt(); + quint16 ampere = static_cast(qRound(action.paramValue(webastoLiveMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toDouble())); thing->setStateValue(webastoLiveMaxChargingCurrentStateTypeId, ampere); QUuid requestId = connection->setChargeCurrent(ampere); if (requestId.isNull()) { @@ -571,7 +571,7 @@ void IntegrationPluginWebasto::executeAction(ThingActionInfo *info) executeWebastoNextPowerAction(info, power); } } else if (action.actionTypeId() == webastoNextMaxChargingCurrentActionTypeId) { - quint16 chargingCurrent = action.paramValue(webastoNextMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toUInt(); + quint16 chargingCurrent = static_cast(qRound(action.paramValue(webastoNextMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toDouble())); qCDebug(dcWebasto()) << "Set max charging current of" << thing << "to" << chargingCurrent << "ampere"; QModbusReply *reply = connection->setChargeCurrent(chargingCurrent); connect(reply, &QModbusReply::finished, reply, &QModbusReply::deleteLater); @@ -620,7 +620,7 @@ void IntegrationPluginWebasto::executeAction(ThingActionInfo *info) }); } if (info->action().actionTypeId() == webastoUniteMaxChargingCurrentActionTypeId) { - int maxChargingCurrent = info->action().paramValue(webastoUniteMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toInt(); + quint16 maxChargingCurrent = static_cast(qRound(info->action().paramValue(webastoUniteMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toDouble())); QModbusReply *reply = evc04Connection->setChargingCurrent(maxChargingCurrent); connect(reply, &QModbusReply::finished, info, [info, reply, maxChargingCurrent](){ if (reply->error() == QModbusDevice::NoError) { diff --git a/webasto/integrationpluginwebasto.json b/webasto/integrationpluginwebasto.json index 571f4b5..15cab92 100644 --- a/webasto/integrationpluginwebasto.json +++ b/webasto/integrationpluginwebasto.json @@ -96,10 +96,11 @@ "name": "maxChargingCurrent", "displayName": "Charging current", "displayNameAction": "Set charging current", - "type": "uint", + "type": "double", "unit": "Ampere", "minValue": 6, "maxValue": 80, + "stepSize": 1.0, "defaultValue": 6, "writable": true }, @@ -297,10 +298,11 @@ "name": "maxChargingCurrent", "displayName": "Charging current", "displayNameAction": "Set charging current", - "type": "uint", + "type": "double", "unit": "Ampere", "minValue": 6, "maxValue": 32, + "stepSize": 1.0, "defaultValue": 6, "writable": true }, @@ -569,10 +571,11 @@ "name": "maxChargingCurrent", "displayName": "Maximum charging current", "displayNameAction": "Set maximum charging current", - "type": "uint", + "type": "double", "unit": "Ampere", "minValue": 6, "maxValue": 32, + "stepSize": 1.0, "defaultValue": 6, "writable": true },