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
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
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 :
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 !
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,…”
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.
for current temperature, you would want to use this:
@property
def current_temperature(self):
“”“Return the current temperature.”""
temp = float(self.tuya.current_temperature() or 0)/2
return temp
The issue here is that null is being read as the current temperature, and trying to divide null (which is not the same as 0) by two causes the failure and for the device to not be created when using the custom component.
Current temperature isn’t really what we want here. I have the same costco TCL air conditioner, and the 158 you see is target temperature. It can be halved as well like this:
@property
def target_temperature(self):
“”“Return the temperature we try to reach.”""
“”“temp2 = float(self.tuya.target_temperature() or 0)/2
return temp2"”"
return self.tuya.target_temperature()
However, the issue I’m having, is that mine showed 153 before… and halved is 76.5. But, my AC is set to 68. So maybe someone else knows where those 8.5’ are coming from and/or how to correct them?
Hi Im new here, just set the Tuya access, it found my thermostat just right, but it shows bad temperature. For example 23,5 Celsius shows as 235 Celsius. How to solve it, divided by 10?