From e78497789b5ec7f87dc1d956e2a873ed7c9f84f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B6rrle?= Date: Tue, 1 May 2018 20:13:35 +0200 Subject: [PATCH] Change the divisor for total consumption output (#14215) According to my observations, the "switch_energy" value displayed by Pyfritzhome is the sum of Wh over the last week since measurement. As a result, the correct divisor for representing output as kWh would be 1000 instead of 10000. --- homeassistant/components/switch/fritzbox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/switch/fritzbox.py b/homeassistant/components/switch/fritzbox.py index c8313b0dfef..65a1aa6aabc 100755 --- a/homeassistant/components/switch/fritzbox.py +++ b/homeassistant/components/switch/fritzbox.py @@ -87,7 +87,7 @@ class FritzboxSwitch(SwitchDevice): if self._device.has_powermeter: attrs[ATTR_TOTAL_CONSUMPTION] = "{:.3f}".format( - (self._device.energy or 0.0) / 100000) + (self._device.energy or 0.0) / 1000) attrs[ATTR_TOTAL_CONSUMPTION_UNIT] = \ ATTR_TOTAL_CONSUMPTION_UNIT_VALUE if self._device.has_temperature_sensor: