From 6da23c80d6149919ec2d147bc586e4195c511e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Wed, 25 Oct 2023 16:00:40 +0200 Subject: [PATCH] Update inverter and battery values --- solax/integrationpluginsolax.cpp | 10 +++++++--- solax/solax-registers.json | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/solax/integrationpluginsolax.cpp b/solax/integrationpluginsolax.cpp index 8da3687..953db99 100644 --- a/solax/integrationpluginsolax.cpp +++ b/solax/integrationpluginsolax.cpp @@ -251,9 +251,13 @@ void IntegrationPluginSolax::setupThing(ThingSetupInfo *info) } // Update inverter states - thing->setStateValue(solaxInverterTcpCurrentPowerStateTypeId, -solaxConnection->inverterPower()); - thing->setStateValue(solaxInverterTcpCurrentStateTypeId, -solaxConnection->inverterCurrent()); - thing->setStateValue(solaxInverterTcpCurrentVoltageStateTypeId, solaxConnection->inverterVoltage()); + + int inverterPower = solaxConnection->powerDc1() + solaxConnection->powerDc1(); + int inverterVoltage = solaxConnection->pvVoltage1() + solaxConnection->pvVoltage2(); + int inverterCurrent = solaxConnection->pvCurrent1() + solaxConnection->pvCurrent2(); + thing->setStateValue(solaxInverterTcpCurrentPowerStateTypeId, -inverterPower); + thing->setStateValue(solaxInverterTcpCurrentStateTypeId, -inverterCurrent); + thing->setStateValue(solaxInverterTcpCurrentVoltageStateTypeId, inverterVoltage); thing->setStateValue(solaxInverterTcpTemperatureStateTypeId, solaxConnection->temperature()); thing->setStateValue(solaxInverterTcpFrequencyStateTypeId, solaxConnection->inverterFrequency()); thing->setStateValue(solaxInverterTcpTotalEnergyProducedStateTypeId, solaxConnection->totalEnergyProduced()); diff --git a/solax/solax-registers.json b/solax/solax-registers.json index a53a158..36a7699 100644 --- a/solax/solax-registers.json +++ b/solax/solax-registers.json @@ -305,7 +305,6 @@ "description": "Battery power (Charge 1)", "unit": "W", "defaultValue": "0", - "staticScaleFactor": -1, "access": "RO" }, {