tuya-home-assistant icon indicating copy to clipboard operation
tuya-home-assistant copied to clipboard

[Feature request] Fractional scaling factors

Open AndySymons opened this issue 2 years ago • 1 comments

Describe the shortcoming

I have a (cheap Chinese) gas detector that works well with Local Tuya, except that it gives the gas and CO levels in parts per million with values like 0.002 ppm for gas and 0.03 ppm for CO. The interface sees these as integer values of 2 and 3 respectively. I therefore want to scale gas by 0.001 and CO by 0.01, but the UI does not accept fractional values. Why not? The best I can do at the moment is scale the CO by 10 and say is is in m.ppm (milli parts per million, parts per thousand million?)

Expected behaviour

The ability to put fractional values such as 0.01, 1/10, 0.001 or 1/1000 in the scaling factor field

Diagnostics for integrations and devices

Should not be needed; this is not a device-specific problem

Screenshots

N/a

Home Assistant Version 2022.12.1

Device info (please complete the following information, which can be found in log):

N/a

Additional context

N/a

AndySymons avatar Jan 16 '23 18:01 AndySymons

I understand we are expected to use "template" for unit conversion but allowing the scaling factor being a rational number like as an example "9/5" (for conversion of °C to "patriotic units") or (1/60 seconds --> minutes) would be nice!

martinvana avatar Dec 18 '23 04:12 martinvana