homeassistant_ecowitt
homeassistant_ecowitt copied to clipboard
Decimals
Hello,
Is there a way to set how many decimals to show? In temperature i have 2 in humidity 0... i wold like to have 1 on both... Is it possible?
Thanks for the great work!
JS
For humidity the device only reports whole numbers.. I'm not sure offhand for the temp though, I'll have to look.. I thought there was a way in homeassistant yourself you could change what it displayed?
I agree, the temperate showing 2 decimals is meaningless, as most consumer IoT sensors are only accurate to 0.5°C (at best) so showing 21.45° is reporting insignificant/inaccurate precision. 1 decimal is also the "standard precision" for any (professional) weather service - I have 3 external weather services and none of them report more than 0.1° precision.
Humidity is actually correct (showing integer % values), as the sensor accuracy would be at best +/- 1%.
Similarly, the rain values appear as 4.09mm/h
but should only be showing whole mm values, not 2 decimal places, for the same reason was above (accuracy of device).
Yes, it is possible to fix this in HA by creating template entities (or using a LoveLace plugin to alter the entity state
via a template expression) but the user shouldn't have to do this, when the provided values are showing meaningless and inaccurate precision.
I think this line could fix the temperature values:
c = round((F - 32.0) * 5.0 / 9.0, 2)
# change to
c = round((F - 32.0) * 5.0 / 9.0, 1)