Shelly: Fix total energy consumed for 1 Plus PM

master
Michael Zanetti 2022-11-06 23:38:29 +01:00
parent f111b77bc0
commit e9a7c7366f
1 changed files with 1 additions and 1 deletions

View File

@ -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());