diff --git a/sma/integrationpluginsma.cpp b/sma/integrationpluginsma.cpp index d504725..cae327d 100644 --- a/sma/integrationpluginsma.cpp +++ b/sma/integrationpluginsma.cpp @@ -562,12 +562,11 @@ void IntegrationPluginSma::onConnectedChanged(bool connected) void IntegrationPluginSma::onPlantOverviewReceived(const QString &messageId, SunnyWebBox::Overview overview) { Q_UNUSED(messageId) - - qCDebug(dcSma()) << "Plant overview received" << overview.status; Thing *thing = m_sunnyWebBoxes.key(static_cast(sender())); if (!thing) return; + qCDebug(dcSma()) << "Plant overview received for" << thing; thing->setStateValue(sunnyWebBoxCurrentPowerStateTypeId, -overview.power); thing->setStateValue(sunnyWebBoxDayEnergyProducedStateTypeId, overview.dailyYield); thing->setStateValue(sunnyWebBoxTotalEnergyProducedStateTypeId, overview.totalYield); diff --git a/sma/sunnywebbox/sunnywebbox.cpp b/sma/sunnywebbox/sunnywebbox.cpp index b75f096..3f59d9a 100644 --- a/sma/sunnywebbox/sunnywebbox.cpp +++ b/sma/sunnywebbox/sunnywebbox.cpp @@ -199,7 +199,7 @@ void SunnyWebBox::parseMessage(const QString &messageId, const QString &messageT QVariantMap map = value.toMap(); if (map["meta"].toString() == "GriPwr") { - overview.power = map["value"].toString().toInt(); + overview.power = map["value"].toString().toDouble(); QString unit = map["unit"].toString(); qCDebug(dcSma()) << "SunnyWebBox: - Power" << overview.power << unit; } else if (map["meta"].toString() == "GriEgyTdy") { diff --git a/sma/sunnywebbox/sunnywebbox.h b/sma/sunnywebbox/sunnywebbox.h index 9446530..da28985 100644 --- a/sma/sunnywebbox/sunnywebbox.h +++ b/sma/sunnywebbox/sunnywebbox.h @@ -45,9 +45,9 @@ class SunnyWebBox : public QObject Q_OBJECT public: struct Overview { - int power; + double power; double dailyYield; - int totalYield; + double totalYield; QString status; QString error; };