Kane610/deconz

Sensor precision, number of decimals

Closed this issue · 7 comments

Hi

I just made a post on the HA forum about the sensor values of deCONZ being rounded to 1 decimal even though the deCONZ REST API contains 2 decimals: https://community.home-assistant.io/t/deconz-sensors-precision-rounded-to-1-decimal/318506
But now I found this repo and I assume this is where the rounding is taking place?

Would it be an option to include the two available decimals for temperature and humidity?

image
image

Why would you need two decimals of precision? The sensors aren't calibrated anyway so even one decimal is generous here :)

Mainly because it is there. It was made available in the device firmware and in the deCONZ REST API. Of course I acknowledge that precision<>accuracy and that this might be nitpicking and I am totally fine either way :)
It just seems more correct to provide the values that are actually there and let people round them in HA if they want to.

I am doing some testing atm and I can see that I get more readings and by that a smoother graph for some sensors.
Edit: This is a Tuya based sensor:
image

I have tried to "calibrate" by setting the offset value via the REST API.
image

Interesting. I could Probably change it in the lib but since it's been like this for a long time I should still limit the resolution on hass side as not to break possible automations.

The more I think about it trying to respond here I'm not certain changing it would affect anyone negatively. Could possibly be used together with significant change logic in hass to not trigger too many updates to the state machine.

This requires more thought

Sure thing. No rush about it. Let me know if I can assist with some testing if it gets to that.

Hi @Kane610
Have you given this any further thoughts?

Not yet, but I'm doing nearly a full rewrite of the library and those changes might affect this as well

This has been solved 🎉