You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of problem:
When reading four 16-bit modbus registers as a sensor value,
slave output is stored first as 64-bit integer, but before returning
that value is converted to double precision floating point. This
causes loss of precision for integer values bigger than 2^53.
Conversion to floating point is done because of scale, offset
and precision support. Conversion is done even if scale and offset
are configured as integer values and precision set to zero.
Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):
Home Assistant release with the issue:
0.96.0
Last working Home Assistant release (if known):
Operating environment (Hass.io/Docker/Windows/etc.):
Docker
Component/platform:
https://www.home-assistant.io/components/sensor.modbus/
Description of problem:
When reading four 16-bit modbus registers as a sensor value,
slave output is stored first as 64-bit integer, but before returning
that value is converted to double precision floating point. This
causes loss of precision for integer values bigger than 2^53.
Conversion to floating point is done because of scale, offset
and precision support. Conversion is done even if scale and offset
are configured as integer values and precision set to zero.
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):Traceback (if applicable):
Additional information:
I'll make a PR for the fix.
The text was updated successfully, but these errors were encountered: