PhoenixConnect: Update EV charger interface and add full charging current resolution

master
Simon Stürz 2025-12-22 15:24:50 +01:00
parent 4bcfe7c029
commit 42f3e82c66
2 changed files with 15 additions and 8 deletions

View File

@ -186,7 +186,7 @@ void IntegrationPluginPhoenixConnect::setupThing(ThingSetupInfo *info)
connect(connection, &PhoenixModbusTcpConnection::maximumChargingCurrentChanged, thing, [thing](quint16 maxChargingCurrent) { connect(connection, &PhoenixModbusTcpConnection::maximumChargingCurrentChanged, thing, [thing](quint16 maxChargingCurrent) {
qCDebug(dcPhoenixConnect()) << "Max charging current changed" << maxChargingCurrent; qCDebug(dcPhoenixConnect()) << "Max charging current changed" << maxChargingCurrent;
thing->setStateValue("maxChargingCurrent", 1.0 * maxChargingCurrent / 10); // 100mA -> 1A thing->setStateValue("maxChargingCurrent", maxChargingCurrent / 10.0); // 100mA -> 1A
}); });
connect(connection, &PhoenixModbusTcpConnection::activePowerChanged, thing, [thing](quint32 activePower) { connect(connection, &PhoenixModbusTcpConnection::activePowerChanged, thing, [thing](quint32 activePower) {
@ -262,7 +262,8 @@ void IntegrationPluginPhoenixConnect::executeAction(ThingActionInfo *info)
}); });
} else if (actionType.name() == "maxChargingCurrent") { } else if (actionType.name() == "maxChargingCurrent") {
uint16_t current = action.param(actionType.id()).value().toUInt(); double current = qRound(action.param(actionType.id()).value().toDouble() * 10) / 10.0;
qCDebug(dcPhoenixConnect()) << "Charging power set to" << current; qCDebug(dcPhoenixConnect()) << "Charging power set to" << current;
QModbusReply *reply = connection->setMaximumChargingCurrent(current * 10); QModbusReply *reply = connection->setMaximumChargingCurrent(current * 10);
connect(reply, &QModbusReply::finished, info, [info, thing, reply, current](){ connect(reply, &QModbusReply::finished, info, [info, thing, reply, current](){

View File

@ -104,10 +104,11 @@
"displayName": "Charging current", "displayName": "Charging current",
"displayNameEvent": "Charging current changed", "displayNameEvent": "Charging current changed",
"displayNameAction": "Set charging current", "displayNameAction": "Set charging current",
"type": "uint", "type": "double",
"unit": "Ampere", "unit": "Ampere",
"minValue": 6, "minValue": 6,
"maxValue": 16, "maxValue": 16,
"stepSize": 0.1,
"defaultValue": 6, "defaultValue": 6,
"writable": true "writable": true
}, },
@ -217,10 +218,11 @@
"displayName": "Charging current", "displayName": "Charging current",
"displayNameEvent": "Charging current changed", "displayNameEvent": "Charging current changed",
"displayNameAction": "Set charging current", "displayNameAction": "Set charging current",
"type": "uint", "type": "double",
"unit": "Ampere", "unit": "Ampere",
"minValue": 6, "minValue": 6,
"maxValue": 32, "maxValue": 32,
"stepSize": 0.1,
"defaultValue": 6, "defaultValue": 6,
"writable": true "writable": true
}, },
@ -366,10 +368,11 @@
"displayName": "Charging current", "displayName": "Charging current",
"displayNameEvent": "Charging current changed", "displayNameEvent": "Charging current changed",
"displayNameAction": "Set charging current", "displayNameAction": "Set charging current",
"type": "uint", "type": "double",
"unit": "Ampere", "unit": "Ampere",
"minValue": 6, "minValue": 6,
"maxValue": 16, "maxValue": 16,
"stepSize": 0.1,
"defaultValue": 6, "defaultValue": 6,
"writable": true "writable": true
}, },
@ -479,10 +482,11 @@
"displayName": "Charging current", "displayName": "Charging current",
"displayNameEvent": "Charging current changed", "displayNameEvent": "Charging current changed",
"displayNameAction": "Set charging current", "displayNameAction": "Set charging current",
"type": "uint", "type": "double",
"unit": "Ampere", "unit": "Ampere",
"minValue": 6, "minValue": 6,
"maxValue": 32, "maxValue": 32,
"stepSize": 0.1,
"defaultValue": 6, "defaultValue": 6,
"writable": true "writable": true
}, },
@ -628,10 +632,11 @@
"displayName": "Charging current", "displayName": "Charging current",
"displayNameEvent": "Charging current changed", "displayNameEvent": "Charging current changed",
"displayNameAction": "Set charging current", "displayNameAction": "Set charging current",
"type": "uint", "type": "double",
"unit": "Ampere", "unit": "Ampere",
"minValue": 6, "minValue": 6,
"maxValue": 16, "maxValue": 16,
"stepSize": 0.1,
"defaultValue": 6, "defaultValue": 6,
"writable": true "writable": true
}, },
@ -731,10 +736,11 @@
"displayName": "Charging current", "displayName": "Charging current",
"displayNameEvent": "Charging current changed", "displayNameEvent": "Charging current changed",
"displayNameAction": "Set charging current", "displayNameAction": "Set charging current",
"type": "uint", "type": "double",
"unit": "Ampere", "unit": "Ampere",
"minValue": 6, "minValue": 6,
"maxValue": 32, "maxValue": 32,
"stepSize": 0.1,
"defaultValue": 6, "defaultValue": 6,
"writable": true "writable": true
}, },