Smart Life (tuya) show wrong temperature

in the last days, probably after one of the last updates, even the large temperature is seen double. So I also modified these lines:

from

#    @property
#    def target_temperature(self):
#        """Return the temperature we try to reach."""
#        return self.tuya.target_temperature()

to:

@property
def target_temperature(self):
    temp = float(self.tuya.target_temperature())/2
    return temp

Another problem is that the temperature precision is to 1 and not 0.5 so for fix this i added:
PRECISION_TENTHS,

to block

from homeassistant.const import (
ATTR_TEMPERATURE,
PRECISION_WHOLE,
PRECISION_TENTHS,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
)

and changed this:

@property
def precision(self):
    """Return the precision of the system."""
    return PRECISION_WHOLE

to

@property
def precision(self):
    """Return the precision of the system."""
    return PRECISION_TENTHS

and divide for 2 also:

@property
def target_temperature_step(self):
    """Return the supported step of target temperature."""
    return self.tuya.target_temperature_step()/2

@Alessandro_Figlioli ma tu hai hai collegato il termostatto con app tuya o smart life?

In English:
You are using tuya app or smart life app?

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 have the same issue

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 !!

1 Like

Here is mention of the localtuya custom component:

I have problems getting the id and key values from my MoesHouse BHT-002-GCLW (Wifi) but I hear that it’s working great.

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.

climate.thermostaat:
  target_temp_step: '0.5'

Just Reload Location & Customizations.

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.

Ah, you’re right, I did not see that. But all will be fixed in the next version of tuyaha, as per this pull request by @rogermiret:


I’m not in a hurry, or else I could apply this fix in my system.

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:

customize:
  climate.thermostaat:
    climate_divider: 2

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. :slight_smile:

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

Hello All,

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.

When i take it off i get the temperature doubled eg 40 C. I am using a thermostat (https://www.aliexpress.com/item/4000265648461.html?spm=a2g0s.9042311.0.0.292a4c4d0t8Pfc)

I am running the HA on VMware and i am at version 0.108.6
I am eager to any suggestions,
Thanks

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:

162 = 72’
160 = 71’
158 = 70’
156 = 69’
154 = 68’
153 = 67’
151 = 66’

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

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.

Thanks man!. Working just perfect!