From f5daf98896eb7084d4d25921e21e090bad0899ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 2 Feb 2023 00:44:50 +0100 Subject: [PATCH] Keba: Set energy live states to 0 if not connected --- keba/integrationpluginkeba.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/keba/integrationpluginkeba.cpp b/keba/integrationpluginkeba.cpp index 5f421ed3..52b2922b 100644 --- a/keba/integrationpluginkeba.cpp +++ b/keba/integrationpluginkeba.cpp @@ -333,6 +333,16 @@ void IntegrationPluginKeba::setupKeba(ThingSetupInfo *info, const QHostAddress & KeContact *keba = new KeContact(address, m_kebaDataLayer, this); connect(keba, &KeContact::reachableChanged, thing, [=](bool reachable){ thing->setStateValue("connected", reachable); + if (!reachable) { + thing->setStateValue("voltagePhaseA", 0); + thing->setStateValue("voltagePhaseB", 0); + thing->setStateValue("voltagePhaseC", 0); + thing->setStateValue("currentPhaseA", 0); + thing->setStateValue("currentPhaseB", 0); + thing->setStateValue("currentPhaseC", 0); + thing->setStateValue("currentPower", 0); + thing->setStateValue("powerFactor", 0); + } }); connect(keba, &KeContact::commandExecuted, this, &IntegrationPluginKeba::onCommandExecuted);