Smart Life (tuya) show wrong temperature

Hi, where can i get the file tuya.py?

anyone’s how fix double temperature ? there is a fix also to show if heater is on or off?

Hi there,i have 2 problems:

  1. First of all, i don´t see where to get de Tuya.py file mentioned in this post, so i can fix de doubled temperature issue.

  2. Another problem is i can´t see what the thermostat is doing (eating, idle, etc…). Mi thermostat is a Beca BAC-002.

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.

1 Like

Have you tried this link?:

Copy the files a then modify them.

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:

  1. Download full tuya folder from official github repo: https://github.com/home-assistant/home-assistant/tree/dev/homeassistant/components/tuya

or copy all the files that are in /srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/tuya/ if you have hassbian (virtualenv)

  1. 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

  2. Fix climate.py as follow:

from

    @property
    def current_temperature(self):
        """Return the current temperature."""
        return self.tuya.current_temperature()

to

    @property
    def current_temperature(self):
        temp = float(self.tuya.current_temperature())/2
        return temp   
  1. Restart Hassio or just server from gui
4 Likes

Thank you much antoweb76, your code suggestion made it for me. Now Im able to see right temperatures!

You know if the temperature target can be adjusted in 0.5 Cº steps, I have tried it but I only get 1 Cº steps.

In the smart life app, if you allow me to adjust the temperature in steps of 0.5 Cº …
20.00 Cº → 20.50 Cº → 21.00 Cº

Thanks

Do i have to fix “climate.py” or “tuya.py”? i can´t find the following lines in climate.py, but i do find it in tuya.py:

@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:smartrm

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.

1 Like

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.

Wich .py files? i only found the code in tuya.py, and nothing changed.

if you have hassio Fix climate.py as in custom_components/tuya/

Thank you, this solved the issue for me.

The problem is i can´t find the lines below indicated in climate.py, i only found them in tuya.py

   def current_temperature(self):
       """Return the current temperature."""
       return self.tuya.current_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.

I just can´t find “current temperature” in climate.py, but i do find it in tuya.py, modifiyng it there does nothing.

It is there. Check the source here: https://github.com/home-assistant/home-assistant/blob/db0baab692a2e4fbe7ba1f378cda3f6cd9fe42e2/homeassistant/components/tuya/climate.py#L101

Maybe you’re not looking in the correct place.