Convert celsius to fahrenheit using scale? #963
Replies: 2 comments 2 replies
-
There is no mechanism to shift the values, which is required in addition to a scale to convert between Fahrenheit and Celsius. On another device with this flaw, the solution was to not include current temperature in the climate entity, but make it a separate sensor instead. That way the units can be independent of the temperature unit for the set temperature control of the climate entity. For the UI, you need to either put up with the separate temperature display, or use a template entity to combine them back into one climate entity after conversion. |
Beta Was this translation helpful? Give feedback.
-
I totally understand not adding more features, it can get out of hand with all the requests for specific use cases. Since the unit only sends integer values for It really seems like manufacturers that use Tuya for device control are just hacking stuff together without any real effort at standardization. Anyway, |
Beta Was this translation helpful? Give feedback.
-
I have the Pioneer WYT mini-split that has been a bit of trouble.
The set point temperature is in Fahrenheit but the current temperature is in Celsius.
id 2 is the set point and id 3 is the current temperature.
I'd like to do math on id 3 to convert it to Fahrenheit:
I don't think this will work because
scale
seems to only multiply by a factor.After glancing at how
scale
works in the code, what if there was just amath:
mapping that was separate fromscale
andstep
andprecision
that just did arithmetic on a DPiD? This would probably only work for read-only DPiDs because trying to figure out how to invert the function to set a DPiD would be complicated.Probably not a good idea:
Would it be possible to change the logic for the
scale
so that it could do arbitrary arithmetic? Like interpretscale: 9/5 * x + 32
as set x to DPiD 3, evaluatescale
and return the result?Maybe useful:
Alternatively, would it be possible to add an
offset
mapping so that people could doand it would do the scale the DPiD and then add the value of offset?
Somebody besides me might like this:
Alternatively, alternatively, would it be possible to add a mapping
c-to-f:
that is just hard-coded to convert the DPiD from Celsius to Fahrenheit? This would be useful because it's easy to invert.I think there's at least one workable idea out of all of these options. For the time being I'm mapping for every Celsius value between 15 and 32 to a Fahrenheit value.
Thanks
Boo:
Beta Was this translation helpful? Give feedback.
All reactions