Hi, does anyone know how to download the tuya climate.py file from Hassio? Or any other reliable source? I’m running round in circles here, my thermostat is showing 255 degrees instead of 25.5.
Yes, this is where I originally downloaded it from. The strange thing is, if I click on the file,it opens in another page and it shows the correct code. If I right click and save it, it saves with a completely different code inside and I cannot find the right code to edit. I did a copy paste and saved the new file with the name climate.py, will try to edit and upload to my Home Assistant, and see if it has any effect.
Anyway, it didn’t work. It’s still showing 240 degrees instead of 24. I changed the code like this: @property
def current_temperature(self):
temp = float(self.tuya.current_temperature())/10
return temp
Hi,
i’m trying to migrate from hassbian to hass.io. In Hassbian (home assistant virtualenv) is enough to edit the file /srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/tuya/climate.py to see the correct temperature. But in hassio there is not any folder in /srv. So for fix the temperature in hassio follow these steps:
or copy all the files that are in /srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/tuya/ if you have hassbian (virtualenv)
Inside the Hassio samba share named “config” create a folder “custom_components” and inside this folder another named “tuya”. So paste all above file in tuya folder
Fix climate.py as follow:
from
@property
def current_temperature(self):
"""Return the current temperature."""
return self.tuya.current_temperature()
Got it to work in the end, I copied the files all over again into the custom components/tuya folder, edited the climate.py as follows:
@property
def current_temperature(self):
temp = float(self.tuya.current_temperature())/10
return temp
@property
def target_temperature(self):
"""Return the temperature we try to reach."""
temp = float(self.tuya.target_temperature())/10
return temp
This is what it looks like now:
There are two places where I modified the code:
Current temperature
Target temperature
With only one modification, the target temperature was still showing 240 degrees.
As other people stated, it only displays temperature in 1 degree steps.
I finally got this to work too! Ended up pasting the RAW code from the Github page into the .PY files. I only had to modify the current temperature /2 as the target temperature was working for me.
Having the decimals working as well would be nice but I think 0.5 degrees C wouldn’t be noticeable anyway.
There is a bit of a delay but so far these thermostats seem to be the easiest way to integrate an electric underfloor heating into Home Assistant.
Now I need to come up with some clever automation before I install more of these throughout. I was thinking about a combination of presence detection, time, outside and inside temperature.
68 F is 20 C. I think that 20 C is default temperature value for tuya service when it receive some incorrect value from us.
Initially my thermostat shows doubled value in HA for current temperature. I have edited both functions to divide values and HA shows right current temperature but for any target temperature thermostat show on it’s display “set 20 C”. Then i restored target_temperature function and now both values are right.
So we need to edit only current_temperature function and all be fine.