Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Rounding / Number conversion #79

Closed
NFis opened this issue Mar 22, 2019 · 6 comments
Closed

Rounding / Number conversion #79

NFis opened this issue Mar 22, 2019 · 6 comments
Labels
question Further information is requested

Comments

@NFis
Copy link

NFis commented Mar 22, 2019

I watched a roundig problems with temperatures: at certain temperatures there are steps up to the next integer. This behavior started when precision was changed to "2" with release 1.4.0

Histograms from Homeassistant:

grafik

grafik

As a quick fix I changed "precision" to "1" in function "_float_to_char" in ems-esp.ino. The smoother result is seen on the right side of the graphics.
Perhaps it would be better solution to avoid floating point calculations and use fixed point arithmetics. Values calculated from two bytes devided by 10 cannot have a higher precision then 0.1

My configuration: Buderus GB162 V3, UBA 3.5, BC10, RC35, RC20 RF

@NFis NFis added the question Further information is requested label Mar 22, 2019
@proddy
Copy link
Collaborator

proddy commented Mar 22, 2019

that's a really good idea. I'll think about removing floats completely. They're costly

@proddy
Copy link
Collaborator

proddy commented Mar 23, 2019

I changed this in 1.6.0 (in dev branch) and removed all float pre-processing

@SpaceTeddy
Copy link
Contributor

@proddy ,
may you double check the rounding / floating algorithm please, because since dev 1.6.0.b5 I get via telnet "info" and mqtt a wrong "Setpoint room temperature" value. Target is 19.5 but the ESP says 19.1

thx

@proddy
Copy link
Collaborator

proddy commented Mar 23, 2019

@SpaceTeddy yup, its a bug. well spotted. The way I calculate a / 2 is just balls. I need to fix that later tonight. thanks for reporting.

@proddy
Copy link
Collaborator

proddy commented Mar 24, 2019

think its fixed now

@SpaceTeddy
Copy link
Contributor

fixed!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants