diff --git a/custom_components/fpl/sensor_DailyUsageSensor.py b/custom_components/fpl/sensor_DailyUsageSensor.py index 594b686..cb36367 100644 --- a/custom_components/fpl/sensor_DailyUsageSensor.py +++ b/custom_components/fpl/sensor_DailyUsageSensor.py @@ -110,7 +110,10 @@ class FplDailyDeliveredKWHSensor(FplEntity): @property def state(self): data = self.getData("daily_usage") - return data[-1]["netDeliveredKwh"] + try: + return data[-1]["netDeliveredKwh"] + except: + return 0 def defineAttributes(self): """Return the state attributes."""