Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuya showing wrong temperature #73612

Closed
nizmot opened this issue Jun 16, 2022 · 21 comments
Closed

Tuya showing wrong temperature #73612

nizmot opened this issue Jun 16, 2022 · 21 comments

Comments

@nizmot
Copy link

nizmot commented Jun 16, 2022

The problem

Official Tuya integration is showing wrong temperature. It shows the right temperature divided by 5. It shows 5.2 instead of 26.
Screenshot_2022-06-16-21-46-25-957_io homeassistant companion android
Thank you
P.S. Let me know how to help to fix the bug or if it is just a hardware problem not complying with Tuya

What version of Home Assistant Core has the issue?

Latest

What was the last working version of Home Assistant Core?

February

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tuya

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@nizmot
Copy link
Author

nizmot commented Jun 16, 2022

Device Information
Product Name 柏益温控器(采暖)
Device ID 13101012d8bfc00b4233
Product Category wk

[
{
"code": "switch",
"value": true
},
{
"code": "child_lock",
"value": false
},
{
"code": "temp_set",
"value": 48
},
{
"code": "eco",
"value": false
},
{
"code": "upper_temp",
"value": 52
}
]

@probot-home-assistant
Copy link

tuya documentation
tuya source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @tuya, @zlinoliver, @frenck, mind taking a look at this issue as it has been labeled with an integration (tuya) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@peckma
Copy link

peckma commented Jun 23, 2022

I have the same problem.

@xmatro
Copy link

xmatro commented Jul 7, 2022

The same situation with Moes BHT-002-GBLW(Wifi) smart Thermostat Temperature Controller for Electric floor.

@posean
Copy link

posean commented Jul 13, 2022

Have same issue on one of my tuya thermostat.
I can send info about twice(good and bad) devices, if it needed
i modify usr/src/homeassistant/homeassistant/components/tuya/climate.py, but not all places, trouble in scaling:

--- bad	2022-07-13 18:06:15.408386186 +0300
+++ good	2022-07-13 18:06:14.516386164 +0300
@@ -194,7 +194,7 @@
         # it to define min, max & step temperatures
         if self._set_temperature:
             self._attr_supported_features |= ClimateEntityFeature.TARGET_TEMPERATURE
-            self._attr_max_temp = self._set_temperature.max_scaled
+            self._attr_max_temp = self._set_temperature.max_scaled * 5
             self._attr_min_temp = self._set_temperature.min_scaled
             self._attr_target_temperature_step = self._set_temperature.step_scaled
 
@@ -357,12 +357,14 @@
         if temperature is None:
             return None
 
-        if self._current_temperature.scale == 0 and self._current_temperature.step != 1:
+        if self._current_temperature.scale != 0 and self._current_temperature.step != 1:
             # The current temperature can have a scale of 0 or 1 and is used for
             # rounding, Home Assistant doesn't need to round but we will always
             # need to divide the value by 10^1 in case of 0 as scale.
             # https://developer.tuya.com/en/docs/iot/shift-temperature-scale-follow-the-setting-of-app-account-center?id=Ka9qo7so58efq#title-7-Round%20values
-            temperature = temperature / 10
+            temperature = temperature * 5
+        elif self._current_temperature.scale == 0 and self._current_temperature.step != 1:
+            temperature = temperature / 2
 
         return self._current_temperature.scale_value(temperature)
 
@@ -388,6 +390,8 @@
         if temperature is None:
             return None
 
+        if self._set_temperature.scale != 0 and self._set_temperature.step != 1:
+            temperature = temperature * 5
         return self._set_temperature.scale_value(temperature)
 
     @property

@imxs69
Copy link

imxs69 commented Aug 8, 2022

Hi,
I have the same problem wit 2 devices.
Thanks

@HercegAndras
Copy link

HercegAndras commented Aug 14, 2022

I have the same situation with the MOES BHT-002-GC (Wifi) - the real temperature is 5x times smaller in HA, compared with the tuya app - which shows the correct values.

Is it possible somehow workaround it with just simply modify the values on the card?
Trying also with simple-thermostat repo form HACS, but did not find how to do that.

many thanks!!

edit:
okay, just found, that with local tuya integration & with these configs at least the temp values are correct, and you can switch on/off the heating.
But you cannot swicth between manual and auto mode, and if you turned off the thermostat, you cannot turn it on again any more.

edit2:
OK, the manual-programming switching is also working.
just add this part to your climate.py file, HVAC_MODE_SETS secion:

“1/0”: {
HVAC_MODE_HEAT: “1”,
HVAC_MODE_AUTO: “0”,
},

then reboot, re-add the thermostat, set it again with 1/0 mode the it works well.

@Phil-m-pinto
Copy link

Phil-m-pinto commented Aug 18, 2022

#72703 apparently this is not a HA issue. It's a manufacturer or a tuya issue and the HA teem are can do nothing about it.🤔

@midstar
Copy link

midstar commented Sep 3, 2022

I recommend all of you having the BHT-002 thermostat to use my custom component based on the official integration found here

@prosciutt00
Copy link

Any fix to the wrong temprature issue?

@midstar
Copy link

midstar commented Sep 15, 2022

Any fix to the wrong temprature issue?

BHT-002 will never be fixed in the official Tuya integration. Please use the custom integration which is based on the official integration. See the instructions here:
https://github.com/midstar/homeassistant_tuya_with_bht-002_support

@frenck
Copy link
Member

frenck commented Sep 15, 2022

BHT-002 will never be fixed in the official Tuya integration.

That is not correct. It can be supported if implemented correctly.

@midstar
Copy link

midstar commented Sep 15, 2022

BHT-002 will never be fixed in the official Tuya integration.

That is not correct. It can be supported if implemented correctly.

True. But I doubt that the asian OEM manufacturer or Tuya (not sure where the problem is) will do anything about it since the thermostat works perfectly fine with the Smart Life app, Google, Alexa etc.

@frenck
Copy link
Member

frenck commented Sep 15, 2022

But I doubt that the asian OEM manufacturer or Tuya (not sure where the problem is) will do anything about it since the thermostat works perfectly fine with the Smart Life app, Google, Alexa etc.

I find that a weird statement, I've not seen any PR or attempt from anyone actually to fix it upstream. I've done PRs upstream, and they have been merged and published 🤷

@midstar
Copy link

midstar commented Sep 15, 2022

But I doubt that the asian OEM manufacturer or Tuya (not sure where the problem is) will do anything about it since the thermostat works perfectly fine with the Smart Life app, Google, Alexa etc.

I find that a weird statement, I've not seen any PR or attempt from anyone actually to fix it upstream. I've done PRs upstream, and they have been merged and published 🤷

There are 9 issues reported in the previous Home Assistant Integration (https://github.com/tuya/tuya-home-assistant/issues?q=is%3Aissue+bht), which I thought was partly maintained by the Tuya team. However, I have reported an additional PR in the tuya-iot-python-sdk:

tuya/tuya-iot-python-sdk#62

@frenck
Copy link
Member

frenck commented Sep 15, 2022

Reporting != contributing code.

@posean
Copy link

posean commented Sep 16, 2022

I have twice devices with different behavior, i can wrote some patch. Whom i must give fix-patch that is will come in main code?
Where is a maintainer of this component?

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@Benon-user
Copy link

this issue still exists in newest version of HA
Home Assistant 2023.1.1
Supervisor 2022.12.1
Operating System 9.4
Frontend 20230104.0 - latest

The HA Thermostat card shows 5 times smaller temperature.
image

This ticket needs to be assign for developing not to close.

Thanks,
Benon

@github-actions github-actions bot removed the stale label Jan 8, 2023
@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests