Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temperatures showing many digits after the decimal #45

Open
exeljb opened this issue Feb 5, 2023 · 4 comments
Open

Temperatures showing many digits after the decimal #45

exeljb opened this issue Feb 5, 2023 · 4 comments

Comments

@exeljb
Copy link

exeljb commented Feb 5, 2023

Sometimes the temperatures displayed in HA will be shown with an obnoxious amount of numbers after the decimal.

Screenshot 2023-02-04 at 8 46 44 PM

Has anyone else seen this behavior?

I know I can create template sensors in HA where I can round these values but it would be nice if the add-on handled this. Maybe adding some |round(1)'s to the script would do the trick?

@exeljb
Copy link
Author

exeljb commented Feb 8, 2023

Found it! The units setting in the config was set to si instead of customary.

@exeljb exeljb closed this as completed Feb 8, 2023
@exeljb
Copy link
Author

exeljb commented Feb 26, 2023

So I guess this wasn't the problem since the temps have still been showing many digits. This is from the log...

Received key time for Acurite-Tower
Received key channel for Acurite-Tower
Received key battery_ok for Acurite-Tower
Received key temperature_F for Acurite-Tower
Received key humidity for Acurite-Tower
Received key freq for Acurite-Tower
Received key rssi for Acurite-Tower
Received key snr for Acurite-Tower
Received key noise for Acurite-Tower
Received message: rtl_433/events : {"time": "2023-02-25 18:10:25-0600", "protocol": 40, "model": "Acurite-Tower", "id": 460, "channel": "B", "battery_ok": 1, "temperature_F": 73.03999, "humidity": 30, "mic": "CHECKSUM", "mod": "ASK", "freq": 433.98854, "rssi": -0.111153, "snr": 19.26843, "noise": -19.3796}

@exeljb exeljb reopened this Feb 26, 2023
@thejeffreystone
Copy link
Owner

I can have the add-on round the temp. I'm testing to see if using the suggested display precision attribute can handle this.

I'm a little worried about using round in the device mapping since that will remove the precision. Not that we need 4 decimals of precision for smart home use cases. It's more of if I do it, it removes it for everyone.

So let me test some things. If I can force HA to respect my authority as Cartman says, then I'll will round it.

@exeljb
Copy link
Author

exeljb commented May 21, 2023

lol yes, Cartman's authoritay! I don't know how much you'd want to change, you make a good point about it removing the digits for everyone. That might be undesirable for some. In my experience, anything past the 2nd digit of the decimal is junk anyways but I don't know if there's sensors out there that would give that accurate of a resolution.

In the time since I wrote this issue, HA was updated to easily set the display precision for each sensor. I have been using that feature and noticed no more multiple digits. This might be the ideal way to handle it since it can be done on a per sensor basis at the desire of each individual user whereas if we stuck to the rounding in the add-on, then all sensors would be bound to it for everybody. Maybe it's best to keep it the way it currently is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants