Filter out zero readings for DSMR enery sensors (#104843)
This commit is contained in:
parent
00e57ab9a4
commit
7767bb328d
2 changed files with 20 additions and 3 deletions
|
@ -799,6 +799,10 @@ class DSMREntity(SensorEntity):
|
|||
float(value), self._entry.data.get(CONF_PRECISION, DEFAULT_PRECISION)
|
||||
)
|
||||
|
||||
# Make sure we do not return a zero value for an energy sensor
|
||||
if not value and self.state_class == SensorStateClass.TOTAL_INCREASING:
|
||||
return None
|
||||
|
||||
return value
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue