diff --git a/custom_components/fpl/fplapi.py b/custom_components/fpl/fplapi.py index 4c24f6a..a2c2a67 100644 --- a/custom_components/fpl/fplapi.py +++ b/custom_components/fpl/fplapi.py @@ -308,6 +308,8 @@ class FplApi(object): data["projectedKWH"] = r["CurrentUsage"]["projectedKWH"] data["dailyAverageKWH"] = r["CurrentUsage"]["dailyAverageKWH"] data["billToDateKWH"] = r["CurrentUsage"]["billToDateKWH"] + data["recMtrReading"] = r["CurrentUsage"]["recMtrReading"] + data["delMtrReading"] = r["CurrentUsage"]["delMtrReading"] return data async def __getDataFromApplianceUsage(self, account, lastBilledDate) -> dict: diff --git a/custom_components/fpl/sensor.py b/custom_components/fpl/sensor.py index ee64995..31e53ce 100644 --- a/custom_components/fpl/sensor.py +++ b/custom_components/fpl/sensor.py @@ -4,6 +4,8 @@ from .sensor_KWHSensor import ( ProjectedKWHSensor, DailyAverageKWHSensor, BillToDateKWHSensor, + NetReceivedKWHSensor, + NetDeliveredKWHSensor, ) from .sensor_DatesSensor import ( CurrentBillDateSensor, diff --git a/custom_components/fpl/sensor_KWHSensor.py b/custom_components/fpl/sensor_KWHSensor.py index 6b9ba6b..71abae2 100644 --- a/custom_components/fpl/sensor_KWHSensor.py +++ b/custom_components/fpl/sensor_KWHSensor.py @@ -32,4 +32,26 @@ class BillToDateKWHSensor(FplEnergyEntity): def state_class(self) -> str: """Return the state class of this entity, from STATE_CLASSES, if any.""" - return STATE_CLASS_TOTAL_INCREASING +class NetReceivedKWHSensor(FplEntity): + def __init__(self, coordinator, config, account): + super().__init__(coordinator, config, account, "Received Meter Reading KWH") + + @property + def state(self): + return self.getData("recMtrReading") + + @property + def icon(self): + return "mdi:flash" + +class NetDeliveredKWHSensor(FplEntity): + def __init__(self, coordinator, config, account): + super().__init__(coordinator, config, account, "Delivered Meter Reading KWH") + + @property + def state(self): + return self.getData("delMtrReading") + + @property + def icon(self): + return "mdi:flash"