arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
21.93k stars 4.76k forks source link

TuyaMCU driver relative humidity should behave as temperature WRT tempres #11384

Closed jaymemaurice closed 3 years ago

jaymemaurice commented 3 years ago

DO NOT DELETE ANY TEXT from this template! Otherwise the issue will be auto-closed. -->

PROBLEM DESCRIPTION

Relative humidity fnids are affected by tempres - value is padded with extra number of zeros. This results in inaccurate values if tempres is not 0. Before 9.3.0 we had similar issue with temperature - issue 10917

image

REQUESTED INFORMATION

- [ ] If using rules, provide the output of this command: `Backlog Rule1; Rule2; Rule3`:
```lua
  Rules output here:
na
- [ ] Set `weblog` to 4 and then, when you experience your issue, provide the output of the Console log:
```lua
  Console output here:
na

TO REPRODUCE

Get humidity reading with device using fnid 73/74 Note TuyaMCU always returns an integer

EXPECTED BEHAVIOUR

The value in the web interface should not be padded with extra zeros. Tempres puts the decimal in the correct place

SCREENSHOTS

ADDITIONAL CONTEXT

I think the fix is to route the humidity values through the same function as the temperature which divides the value based on the tempres value. I will submit a PR with this behaviour and update the docs as with the temperature

(Please, remember to close the issue when the problem has been addressed)

jaymemaurice commented 3 years ago

PR submitted. Sorry for the delay.