Hello everyone, I am having the same issue of the current temperature showing 40°C instead of 20°C so I followed the guide and created custom_components\tuya in my config folder, then I copied the files and modified climate.py
The only problem is, what should I do now? Do I have to change something in my configuration.yaml? I really don’t know what I am missing because I don’t even know how to handle custom components with hassio. Thank you
I finally found some time to get to the bottom of this problem! Right now, on Home Assistant, I can see the correct room temperature with a 0.5 precision and I am able to set it. Also, min and max target temperatures are now available.
I changed the following:
In manifest.json, package tuyaha==0.0.5 becomes tuyaha-float==0.0.7.
In __init__.py, add tuyaha = __import__("tuyaha-float") before from tuyaha import TuyaApi.
In climate.py:
Changed the 2 occurrences of PRECISION_WHOLE to PRECISION_HALVES.
Hard-coded min_temp to return 5.0.
Hard-coded max_temp to return 35.0.
Hard-coded target_temperature_step to return 0.5.
Changed target_temperature to return self.tuya.target_temperature()/10.0.
Changed current_temperature to return self.tuya.current_temperature()/10.0.
The package tuyaha-float is a fork from the original one, making the needed changes to the API calls. I will make a Pull Request to the package and one to Home Assistant, but this way, anyone wanting to use it, won’t have to wait until this is merged and released.
Still, there’s no solution for the hard-coded min and max temperatures as well as the 2-times or 10-times differences from the current temperature readings from the API.
For example, for my thermostat, the API gives me this data:
Meaning that the target temperature is 20.5 C, the room temperature is 19.5 C, the min temp is 0.5 C (when it should be 5.0 C) and max temp is 122.0 C (when it should be 35.0 C).
Thanks for your post. Now temperature readings work fine even with 0,5 precision. What about modes? My thermostats are able to work in Manual, Program or Holiday mode in Tuya APP. I cant actually see their current status or set working mode in HA. I can only turn them ON/OFF right now.
And for the underfoor heating theres also floor temperatur available? Thank you.
There is a file to download and the right configuration for tuya thermostat with comma?
I was able to set tuya thermostat without comma only for int natural number , but last posts are confused for not English persons, can someone rewrite easy and clear the step by step guide?
It was so easy to switch from int numbers to float. Just edit custom_components/tuya/climate.py if you have this file already.
Many thanks to rogermiret!
Only if you want to fork default tuya component and to have two tuya components (default tuyaha and new tuyaha-float) in your system. I think, you don’t want/need this.
Ciao Antonello, credo di aver capito tu sia italiano. Premetto che ho hassio su raspberry, ho seguito i tuoi step, solo che al riavvio del server l’entità è scomparsa, nonostante nel log mi venga detto che il custom component tuya è stato caricato correttamente. Come posso risolvere?
I changed current temperature to be divided by 2 by copying and changing climate.py in custom_components/tuya . It worked well. My integration worked well until a few weeks ago target temperature also doubled.
Here are new calculations for current and target I have now made:
@property
def current_temperature(self):
"""Return the current temperature. FIXED TO SUPPORT DECIMALS """
temp = float(self.tuya.current_temperature())/2
return temp
@property
def target_temperature(self):
"""Return the temperature we try to reach. FIXED TO SUPPORT DECIMALS"""
temp2 = float(self.tuya.target_temperature())/2
return temp2
Anyone suggest this to be integrated to next version?
I am also interested to direct integration to device (without tuya). Has anyone done HA integration directly with thermostat devices?
I use MoesHouse BHT-002-GBLW(Wifi) ( aliexpress.com/item/32905181466.html?spm=a2g0s.9042311.0.0.27424c4dRsWynk
and I would like my house be working also if internet is down.