Smart Life (tuya) show wrong temperature

Hello,
i’m new in home assistant and i’m enjoying this beautiful system.
So, i have a little issue with this type of Thermostat that show the wrong “current temp” , i’m using metric unit system.
image
As you can see, i don’t have 40° but 20. It seems to be increased always of 20°.

Thanks

Same here, i’ve “solved” by modify the climate tuya py in custom components and then edited it:

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

Full steps:

  1. in homeassistant custom_components folder create a folder named climate

  2. then homeassistant custom_components/climate folder:
    wget https://raw.githubusercontent.com/home-assistant/home-assistant/master/homeassistant/components/climate/tuya.py

  3. edit the custom_component as described above

Note:

  • That’s a rough fix (probably shows only int vaues) i’ve made it only to make a try.
  • The reason is in the way tuya shares temperatures, to ha a resolution of 0.5 all the temperatures are transmitted doubled. So “40” is 20° and “41” is 20,5°
  • Making a custom_components named exactly as the original components will override that, so that way overrides the original /climate/tuya.py.
  • To revert back to official support just remove the tuya.py file from custom_components
2 Likes

Hello, thanks for your help.
When i try to add the “tuya.py” file into the folder “custom_components” and then restart the service, the Thermostat stop to works on HA and then i have some problem with google cast too…

image

For google cast i’ve made some try but without success BHT-6000 Thermostat (tuya) support

Sorry, i’ve made a mistake on previous post (now corrected)… In custom_components must be created a folder called “climate” and then the file must be placed in it

1 Like

Ok, thanks now it works!

Hi Guys,

My thermostat has two sensors (temperature and UFH temperature)

self.tuya.current_temperature() is the temperature sensor

Is there another call where I can get the secondary sensor?

Thanks.

Check what states are exposed in homeassistant --> dev-tool -->states

@Fraschi Thanks for the help. Sorry I’ve been away.

The output in the states is below, I do not think it picks up the UFH sensor as I couldn’t find a second temperature variable in tuya.py.

Cheers.

current_temperature: 13
min_temp: 5
max_temp: 35
temperature: 8
target_temp_step: 1
friendly_name: Loft Bathroom
supported_features: 4097

Try to query if it’s supported in the generic tuya topic. As I remember the official tuya support has not full device support, but there was something related to supported_feature code that i din’t fully understand. Anyway, I’ve made a local support for, tuya based, bht-6000 thermostat BHT-6000 Thermostat (tuya) support , there are some hints on how to retrieve locally the device dps (data exposed by the device). The localtuya.py can be a good base, the code is pretty simple, probably You have to find the dps that reports the seconds temperature and then add a specific function to the py

Thanks Fraschi, I will read up on your notes on the BHT-6000 and have a poke around with the code.

1 Like
  1. in homeassistant custom_components folder create a folder named climate
  2. then homeassistant custom_components/climate folder:
    wget https://raw.githubusercontent.com/home-assistant/home-assistant/master/homeassistant/components/climate/tuya.py
  3. edit the custom_component as described above

Great way around this problem, but after update 0.88 is not working any more ???

Problem solved since update 0.88 the HA structure is change https://github.com/home-assistant/architecture/issues/141
to solved this change config to /custom_components/tuya/climate.py to overwrite tuya.
You still ned to change :

def current_temperature(self):
temp = float(self.tuya.current_temperature())/2
return temp

In the update 0.89 of HA it doesn’t work anymore… Did somebody solve it?

1 Like

Same kind of problem for me… The devices ( AIXI-SHS Wireless Wi-Fi thermostat plug sold by Amazon) are discovered 100% automatically but the temperature in HA is 10 times what it should be (I am using Smart_Life)… Solved it before (including 0.88) by a custom_component but is not working anymore with HA 0.89.1 … Any solution to fix this ?

with the new update, all the tuya files must be in homeassistant config /custom_component/tuya/, which means climate.py, cover.py, fan.py. light.py scene.py switch.py and a empty init file. With 0.89 you are no longer allow custom components to be partial overlays.
You still ned to change climate.py :
def current_temperature(self):
temp = float(self.tuya.current_temperature())/2
return temp

So I copied all native elements from tuya including the “init.py” file to config/custom_components/tuya (I tried an empty file for the init file but I got an error message and tuya was not loading anymore). Now it is working again with the right temperature displayed as I modified the climate.py file in the custom_components to get the correct temperature… Thanks !

Maybe someone can give insight… I have added all the TUYA files in the config folders and made the edits… but still showing double temp readings.

If the init.py file is empty the system does not see the A/C at all… this is the Costco TCL Window A/C

image

Hello… Can you confirm that you added all the TUYA files in the <config/custom_components/tuya> folder (because you are mentioning config folder)… You should have in the home-assistant.log when HA starts some warnings saying that “You are using a custom component for tuya which has not been tested by Home Assistant. This component might cause stability problems,…”

Yes I do believe I have all the files and have modified the climate.py as mentioned.

image
image

Hello… You should have strictly the same number of python files with the same names… In your list you have two init files one with underscore that you need to keep as is and another one init.py that should not exist for me (I know my post is maybe confusing)… Compare the <components/tuya/.py> with the <config/custom_components/tuya/.py>… than it should show the right temperature.