Closed elockman closed 1 year ago
They're not "virtually" the same , they are the same. Why they decided to do that I have no idea, I did not write the firmware for these things.
Depending on what firmware version you have, the thermostats use either DPs 18+19+20+26, or DPs 108+109+110+111. "high_resolution" is nothing but a flag which tells the program which DP set to use when sending 'set' commands. I named it that because degrees C changed from increments of 1 to increments of 0.01 (really 0.5 encoded as 0.01).
I also see that the dps table has multiple cooling_setpoint_f and heating_setpoint_f alternative naming keys.
Yes, I found the "official" name for those DPs ("upper_temp" and "lower_temp") really confusing, so I added those aliases.
Ok, I get it. My status does not come back with the 18,19,20,26 DPs. Would it be better to make the aliases different with different function calls to them?
I did it this way so the same code works no matter which firmware version you have. Giving them different names would mean your code would need to know about, detect, and use different calls for different firmware versions.
Ok, my code is working without changes to tinytuya. I had a variable that was a string instead of an int, and it looked like a scaling issue. Casting to int resolved my issue. Closing this issue.
I've seen an oddity with setting temp setpoints in a tuya thermostat, and I'm now trying to understand the difference between scale and high_resolution.
The thermostat dps table looks like this:
scale makes sense to me with this code:
I also see that the dps table has multiple cooling_setpoint_f and heating_setpoint_f alternative naming keys.
Is high_resolution supposed to be a flag to distinguish between the common naming keys and assign the correct dps as well as the proper scale? It appears to be that way with this code:
If that is indeed the case, I think dps 110 and dps 111 should have 'scale': 100 included. Otherwise dps 18 and 110 become virtually the same. Likewise, dps 19 and dps 108 become virtually the same.
Does that make sense to you @uzlonewolf?