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.
I’ve seen two mentions of the underfloor temperature sensor not being available in HA but visible in smart_life and my smart thermostat apps.
Has anyone worked out how we might retrieve this ?
Also, the HVAC_MODE seems to only show ‘Off’ or nothing. Anyone know how it can be persuaded to show ‘Heat’ when it is heating and maybe even ‘Idle’ when it is switched on but at target temp and hence not using power.
Is there any way to intercept and see the dialog between the phone app and the cloud ?
Incidently, in my android apps, the underfloor temp it shows appears to be half the value it should be !!
Very well summarized. Just one addition. When I set the temperature from the thermostat Lovelace card, I can only choose whole degrees. Putting this in the customize.yaml solves that problem.
It’s not true , doesn’t solves problem. If you set 16.5 °C on Home Assistant , Climate on Tuya is setted as 16°C so you have a fake setting showing wrong temperature 16.5, since few minutes later on HA read the same Temperature on Tuya App and show 16C. Need more code to give a coma number during setting and not a N number.
Roger, is it possible to add an extra property to the climate component to allow for different dividers? Not everyone uses division by 2, some use by 10. Also, when things get ‘fixed’ on the side of the thermostat, it’s easy to remove the parameter.
Something like:
Hi guys,
I find so easy to add all TUYA devices just inserting the tuya account details… and most of many thermostats work correctly… just one model (by another company) has this issue.
How can I fix it without adding too much coding?
Thanks
Easiest solution is to get a new thermostat, like the ones you have.
The other solution is to create a custom component of the tuya component (copy the files from the tuya component is the custom_components folder, rename the folder to something like tuya-float, and make the modifications above. No coding, just editing the files).
Since you have thermostats that are working fine and one that has a problem, you need two different components. The modifications above don’t allow for two thermostats with different division options (I hope that @rogermiret will add that to his Pull Request).
Ciao Marcel, thanks for your reply.
well… the ones that work are valves’ component of heating… the one with the issue is the thermostat.
So, thermostat must work correctly… I cannot configure only the thermostat with a different profile? any help? Can I configure it within my LAN as component out of Tuya cloud? thanks for support
I have done and tried what the manual says but with no luck. I read most of your comments and tried everything with no luck. I added the HACS from the Github site. Put all the file structure that you are suggesting (https://bit.ly/2XR0SN1), but the problem is when i put the manifest.json file i get the following error.
So I just put my AC unit back in as the temps are rising, and I took the time to figure out what was going on. I mapped the results from HA/Tuya and what the AC was showing:
After a little algebra, I figured out that that my results reminded me of an equation I already knew:
(C × 9/5) + 32 = F
So, it looks like Tuya was returning the result in Fahrenheit, but assuming it was Celsius and converting that value to Fahrenheit.
My fix in tuya/climate.py was to change:
@property
def temperature_unit(self):
"""Return the unit of measurement used by the platform."""
unit = self.tuya.temperature_unit()
if unit == "FAHRENHEIT":
return TEMP_FAHRENHEIT
return TEMP_CELSIUS
To:
@property
def temperature_unit(self):
"""Return the unit of measurement used by the platform."""
unit = self.tuya.temperature_unit()
return TEMP_FAHRENHEIT
Mi thermostat was working fine up until a few updates before, now i have the target and current temperatures doubled again, and aplying the modifications in climate.py does nothing.
And i now see that there is new custom component files (https://github.com/home-assistant/core/tree/dev/homeassistant/components/tuya). Are these the ones i have to download and modify?. Any help would be appreciated!!.
Mi thermostat was working fine up until a few updates before, now i have the target and current temperatures doubled again, and aplying the modifications in climate.py does nothing.
And i now see that there is new custom component files (https://github.com/home-assistant/core/tree/dev/homeassistant/components/tuya ). Are these the ones i have to download and modify?. Any help would be appreciated!!.
Overwrite the tuya folder in custom components with the new tuya component from GitHub repo.
Then edit climate.py
from
@property
def current_temperature(self):
"""Return the current temperature."""
return self._tuya.current_temperature()
@property
def target_temperature(self):
"""Return the temperature we try to reach."""
return self._tuya.target_temperature()
to
@property
def current_temperature(self):
"""Return the current temperature."""
temp = float(self._tuya.current_temperature())/2
return temp
@property
def target_temperature(self):
"""Return the temperature we try to reach."""
temp = float(self._tuya.target_temperature())/2
return temp
Please note that Tuya configuration is now done via frontend (Configuration -> Integrations in the UI, click the button with + sign and from the list of integrations select Tuya)
So remove Tuya code from configuration.yaml
Many thanks for your work done on Tuya integration within HA. Now it displays the right temperature in HA and after modification of target_temperature_step I am able to set teperature to half degree C steps.