From 74b33b2d2cbca6a6ba30188c333266cf59d552f0 Mon Sep 17 00:00:00 2001 From: Boernsman Date: Wed, 24 Feb 2021 15:35:41 +0100 Subject: [PATCH] fixed getplantoverview conversion --- sma/integrationpluginsma.cpp | 1 - sma/sunnywebbox.cpp | 11 ++++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sma/integrationpluginsma.cpp b/sma/integrationpluginsma.cpp index 59b1a863..19688e45 100644 --- a/sma/integrationpluginsma.cpp +++ b/sma/integrationpluginsma.cpp @@ -108,7 +108,6 @@ void IntegrationPluginSma::setupThing(ThingSetupInfo *info) connect(sunnyWebBox, &SunnyWebBox::parameterChannelsReceived, this, &IntegrationPluginSma::onParameterChannelsReceived); m_sunnyWebBoxes.insert(info->thing(), sunnyWebBox); }); - return info->finish(Thing::ThingErrorNoError); } else if (thing->thingClassId() == inverterThingClassId) { Thing *parentThing = myThings().findById(thing->parentId()); diff --git a/sma/sunnywebbox.cpp b/sma/sunnywebbox.cpp index 7d120684..250f9378 100644 --- a/sma/sunnywebbox.cpp +++ b/sma/sunnywebbox.cpp @@ -133,13 +133,14 @@ void SunnyWebBox::parseMessage(const QString &messageId, const QString &messageT Q_FOREACH(QVariant value, overviewList) { QVariantMap map = value.toMap(); if (map["meta"].toString() == "GriPwr") { - overview.power = map["value"].toInt(); - qCDebug(dcSma()) << "SunnyWebBox: - Power" << overview.power; + overview.power = map["value"].toString().toInt(); + QString unit = map["unit"].toString(); + qCDebug(dcSma()) << "SunnyWebBox: - Power" << overview.power << unit; } else if (map["meta"].toString() == "GriEgyTdy") { - overview.dailyYield = map["value"].toInt(); + overview.dailyYield = map["value"].toString().toInt(); qCDebug(dcSma()) << "SunnyWebBox: - Daily yield" << overview.dailyYield; } else if (map["meta"].toString() == "GriEgyTot") { - overview.totalYield = map["value"].toInt(); + overview.totalYield = map["value"].toString().toInt(); qCDebug(dcSma()) << "SunnyWebBox: - Total yield" << overview.totalYield; } else if (map["meta"].toString() == "OpStt") { overview.status = map["value"].toString(); @@ -154,7 +155,7 @@ void SunnyWebBox::parseMessage(const QString &messageId, const QString &messageT } else if (messageType == "GetDevices") { QList devices; QVariantList deviceList = result.value("devices").toList(); - qCDebug(dcSma()) << "SunnyWebBox: GetDevices"; + qCDebug(dcSma()) << "SunnyWebBox: GetDevices" << result.value("totalDevicesReturned").toInt(); Q_FOREACH(QVariant value, deviceList) { Device device; QVariantMap map = value.toMap();