Smart Life (tuya) show wrong temperature

In mine hassio is missing the options button/link

This integration is configurable via UI

image
no options

I had a problem with the temperature - bad readings.
I removed Tuya, restarted the HA and added again, Now it works great

Options are available from 0.118.1 so i must update…now works good

Hello all,
Good news for bht-6000 tuta/Beca thermostat.
With last update of home assistant 0.118.1 is possible to configure temperature type (centigrade or farenheit) and most important the divided factor for correct the problem like doubled temperature or 10x. Also is possible to set the polling time of update states. So finally is not necessary anymore to edit any line of climate.py.
All info there https://www.home-assistant.io/integrations/tuya

Hello,

when I change climat.py file line:
@property
def current_temperature(self):
temp = float(self.tuya.current_temperature())/10
return temp
“”“Return the current temperature.”""

The sensor have a status unavailabe in HA and wen I click on it I have an error " Faild to call service climate/set_havac_mode.‘TuyaClimateEntity’ object has no attribute "tuya’

What is wrong?

SOLVED, by changing a options in intergation

6 Likes

There is not this settings panel in my HA

go to Settings, then Integrations then Options in TUYA… once inside, select the menu of last line and choose your device… then you will see the view posted by Jakub

2 Likes

Still can’t figure out how to use halves precision with Moes BHT-002-GBLW

The divider settings do not affect which temperatures are displayed.
Device Moes BHT-002-GBLW. HASS 0.118.3.

Unfortunately this is still wrong when the device uses a divider of 2.0 as float values won’t be considered.

So I proposed this tiny PR for tuyaha https://github.com/PaulAnnekov/tuyaha/pull/54/

Yes!

Not now though, latest version works as is, but you need to set a divider.
However it’s still buggy, so I may do something like that again:

diff --git a/climate.py b/climate.py
index 6da15b0..6e93868 100644
--- a/climate.py
+++ b/climate.py
@@ -23,8 +23,7 @@ from homeassistant.const import (
     ATTR_TEMPERATURE,
     CONF_PLATFORM,
     CONF_UNIT_OF_MEASUREMENT,
-    PRECISION_TENTHS,
-    PRECISION_WHOLE,
+    PRECISION_HALVES,
     TEMP_CELSIUS,
     TEMP_FAHRENHEIT,
 )
@@ -157,9 +156,7 @@ class TuyaClimateEntity(TuyaDevice, ClimateEntity):
     @property
     def precision(self):
         """Return the precision of the system."""
-        if self._tuya.has_decimal():
-            return PRECISION_TENTHS
-        return PRECISION_WHOLE
+        return PRECISION_HALVES
 
     @property
     def temperature_unit(self):
@@ -201,7 +198,7 @@ class TuyaClimateEntity(TuyaDevice, ClimateEntity):
     @property
     def target_temperature_step(self):
         """Return the supported step of target temperature."""
-        return self._tuya.target_temperature_step()
+        return 0.5
 
     @property
     def fan_mode(self):
@@ -213,10 +210,24 @@ class TuyaClimateEntity(TuyaDevice, ClimateEntity):
         """Return the list of available fan modes."""
         return self._tuya.fan_list()
 
+    def tuya_set_temperature(self, temperature):
+        """Set new target temperature."""
+
+        # the value used to set temperature is scaled based on the configured divider
+        divider = self._tuya._divider or 1
+        temp_val = round(float(temperature) * 20.0) / 20.0
+        set_val = temp_val * divider
+
+        _LOGGER.info("Setting temperature to {} ({})".format(temp_val, set_val))
+        if self._tuya._control_device("temperatureSet", {"value": temp_val}):
+            self._tuya._update_data("temperature", set_val)
+        else:
+            _LOGGER.error("Temperature not set")
+
     def set_temperature(self, **kwargs):
         """Set new target temperature."""
         if ATTR_TEMPERATURE in kwargs:
-            self._tuya.set_temperature(kwargs[ATTR_TEMPERATURE])
+            self.tuya_set_temperature(kwargs[ATTR_TEMPERATURE])
 
     def set_fan_mode(self, fan_mode):
         """Set new target fan mode."""

Impossible to change target temp through HomeKit and HA as “bridge”

Thanks for this info.
Originally I had double values displayed (42C instead of 21C), but after changing the Temperature values divider from 0 (default) to 2 it started to show the correct value!

Yeah, even using Google Home it doesn’t seem possible.

See Smart Life (tuya) show wrong temperature it is still not correct, as it loses precision.

I created a pull request that let us override the temperature precision.
I hope it will be merged soon :slight_smile:

1 Like

Szia Csabi,

sikerült megoldani ezt a thermosztát problémát? megosztanád velem? napok óta küzdök…
Köszi
farkas.istvan.leo(kukac)gmail.com