ZHA patch for more precision display of data for all Zigbee devices.
Find the file components/zha/sensor.py (base path ~/.lib64/python3.xx/site-packages/homeassistant) and fix it:
class Sensor(ZhaEntity, SensorEntity):
"""Base ZHA sensor."""
_attribute_name: int | str | None = None
_decimals: int = 2
_divisor: int = 1
_multiplier: int | float = 1
"""Return the state of the entity."""
# per zcl specs battery percent is reported at 200% ¯\_(ツ)_/¯
if not isinstance(value, numbers.Number) or value == -1:
return None
value = round(value / 2, 1)
return value
ZHA patch for more precision display of data for all Zigbee devices.
Find the file
components/zha/sensor.py
(base path~/.lib64/python3.xx/site-packages/homeassistant
) and fix it:site-packages/homeassistant/components/zha/core/cluster_handlers/general.py :
site-packages/homeassistant/components/zha/core/cluster_handlers/measurement.py :
site-packages/homeassistant/components/zha/core/const.py :
https://community.home-assistant.io/t/provide-higher-precision-temperature-value-unrounded-values/502245