From e9a7c7366f361151f938190f4cda3d68e8b3d73b Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sun, 6 Nov 2022 23:38:29 +0100 Subject: [PATCH] Shelly: Fix total energy consumed for 1 Plus PM --- shelly/integrationpluginshelly.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shelly/integrationpluginshelly.cpp b/shelly/integrationpluginshelly.cpp index d49741a7..f44d3a94 100644 --- a/shelly/integrationpluginshelly.cpp +++ b/shelly/integrationpluginshelly.cpp @@ -1621,7 +1621,7 @@ void IntegrationPluginShelly::setupGen2(ThingSetupInfo *info) thing->setStateValue("currentPower", switch0.value("apower").toDouble()); } if (switch0.contains("aenergy") && thing->hasState("totalEnergyConsumed")) { - thing->setStateValue("totalEnergyConsumed", notification.value("switch:0").toMap().value("aenergy").toMap().value("total").toDouble()); + thing->setStateValue("totalEnergyConsumed", notification.value("switch:0").toMap().value("aenergy").toMap().value("total").toDouble() / 1000); } if (switch0.contains("output") && thing->hasState("power")) { thing->setStateValue("power", switch0.value("output").toBool());