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

MoesGo WiFi Thermostat is not properly controllable using the new Tuya integration #57184

Closed
andrey-yantsen opened this issue Oct 6, 2021 · 46 comments

Comments

@andrey-yantsen
Copy link

The problem

I have 4 thermostats, and all of them not only report incorrect temperature but also do not allow to change the operation mode from HASS. The operation mode is always off, and the temperature is 5 times less than set on the thermostat.

With the previous version, everything was warning like a charm.

What is version of Home Assistant Core has the issue?

2021.10.0

What was the last working version of Home Assistant Core?

2021.9.7

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Tuya

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tuya/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

I tried collecting the device info/specifications as described in https://github.com/tuya/tuya-home-assistant/wiki/How-to-get-the-log, but the current logs do not show any info like this.

@probot-home-assistant
Copy link

Hey there @tuya, @zlinoliver, @METISU, 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)


tuya documentation
tuya source
(message by IssueLinks)

@rotem925
Copy link

rotem925 commented Oct 6, 2021

I have the same issue. Not controllable. Status not updated and the temperature is 0.

@andrey-yantsen
Copy link
Author

andrey-yantsen commented Oct 6, 2021

Here's the "instruction set" as displayed in Tuya IoT ("status set" is the same):
image

Product Category is wk.

In Tuya IoT I can see the temperature as double the real value (i.e. I see 40º when the thermostat is set to 20º), but in the SmartLife app, the temperature is displayed correctly.

@OptimusGREEN
Copy link

similar issue here. real target temp is 20 and integration says 4, real current temp is 20.5 and integration says 0

@cybermerlo

This comment has been minimized.

@alexanderznamensky
Copy link

same issues with MoesHouse BHT-002-GBLW WiFi thermostats and SASWELL SEA801 / SASWG-01-RF-WiFi thermostats:

  • incorrect temperature
  • not all metrics are available
  • not possible to switch on / off

@andrey-yantsen

This comment has been minimized.

@probot-home-assistant

This comment has been minimized.

@probot-home-assistant

This comment has been minimized.

@probot-home-assistant

This comment has been minimized.

@jone9618

This comment has been minimized.

@rafalg7
Copy link

rafalg7 commented Oct 16, 2021

@frenck
Copy link
Member

frenck commented Oct 16, 2021

The operation mode is always off,

This has been fixed in the current development version of Home Assistant. The climate integration had some serious rewrites for the upcoming release.

Unfortunately, I was not able to verify if the temperature issue has been resolved. This requires someone running Home Assistant dev or nightly builds (or wait until the next beta or next release).

@andrey-yantsen
Copy link
Author

Hey @frenck! Thanks for the update!

I just tried the latest dev build available in docker (2021.11.0.dev20211016), and actually, it's become a bit worse than with stable version :)

Now I can turn the thermostat off and on, but it's pretty much all I can do:

  • The displayed temperature is still five times lower than the one shown on the thermostat (e.g. 4º instead of 20º)
  • When I change the desired temperature from HA — it doesn't get changed on the thermostat. At the same time, the integration bundled with 2021.10.4 does change the temperature
  • But, at least, when I do change the temperature on the thermostat — the change is displayed by HA :)

@frenck
Copy link
Member

frenck commented Oct 16, 2021

Now I can turn the thermostat off and on, but it's pretty much all I can do:

Hehe well that is better than unable to do it 😄

For the other issues, unfortunate. But, there is room for fixing stuff!

If you log in, into the IoT cloud of Tuya, go to the device debugging for your thermostat, could you provide me with a dump of the following:

  • Basic information (please remove association & IP address fields)
  • Device Debugging -> Click Update Device status, Clikc JSON editing, copy the text field shown and paste it into this issue.
  • Device Debugging -> Standard instruction set: It shows a table with the instruction set supported by your thermostat, which I would need in full.
  • Device Debugging -> Standard status set: It shows all possible statuses your thermostat can supply, which I would need in full.

With that information, I should be able to create a reproduction.

Help is greatly appreciated 👍

../Frenck

@andrey-yantsen
Copy link
Author

andrey-yantsen commented Oct 16, 2021

@frenck you can find everything below; I hope it will help you. In any case — I'll be happy to help with the testing/debugging.

P.S. I'm a bit paranoid, so I masked the device ID a little; feel free to poke me if you need the full one :)

Product Name: 柏益温控器(采暖)
Device ID: 4231005224a16039%%%%
Product Category: wk
Device Status: Online
Activated At: 2021-05-06 14:41:20
Sub-Device or Not: No


Control:

The real set temperature on the thermostat is 23º. The current temperature is 22.5º.

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

Standard instruction set:

Code Type Values
switch Boolean "{true,false}"
child_lock Boolean "{true,false}"
temp_set Integer { "unit": "℃", "min": 10, "max": 70, "scale": 1, "step": 5 }
eco Boolean "{true,false}"
upper_temp Integer { "unit": "℃", "min": 0, "max": 100, "scale": 0, "step": 5 }

Standard status set:

Code Type Values
eco Boolean "{true,false}"
temp_set Integer { "unit": "℃", "min": 10, "max": 70, "scale": 1, "step": 5 }
switch Boolean "{true,false}"
child_lock Boolean "{true,false}"
upper_temp Integer { "unit": "℃", "min": 0, "max": 100, "scale": 0, "step": 5 }

@frenck
Copy link
Member

frenck commented Oct 16, 2021

@andrey-yantsen Could you add the real temperature that shown in the app/display for the temperatures shown in the above debug data?

@andrey-yantsen
Copy link
Author

@frenck yup, sorry, I forgot about it. Added to the original comment. set=23º, current=22.5º.

@cybermerlo
Copy link

Thanks Frenck for all your work

@lucaxxaa
Copy link

...same problems. We hope on @frenck resolution

@frenck
Copy link
Member

frenck commented Oct 23, 2021

Well, I have some more information. As it seems, this device has customizations, specifically for this manufacturer/device. Thus isn't supported/being able to support the cloud API (according to Tuya).

This makes it hard to implement. From an API consumer perspective (Home Assistant), we currently do not have a way to differentiate between this device and others.

I've added some extra information in the upcoming Home Assistant release, that might help to find and implement a solution. But this means for 2021.11, this issue won't be fixed.

@andrey-yantsen
Copy link
Author

andrey-yantsen commented Oct 23, 2021

@frenck, thanks for the update anyway.

Any chance you can add some temporary ugly workaround for 2021.11? Like an option to add an attribute __tuya_multiplier for a thermostat entity via customizations. If Tuya decides to shut down the old API before the fix is ready — everybody using the affected thermostats will have to update their automation to adjust the temperature.

P.S. I wonder how the Smart Life app works appropriately while the API has no idea about the multiplication. Also, I'm surprised that the temperature displayed in HA has to be multiplied by 5, while the temperature visible in Tuya IoT debug has to be divided by 2 to get the correct temperature :)

@frenck
Copy link
Member

frenck commented Oct 23, 2021

Any chance you can add some temporary ugly workaround for 2021.11?

No, that is not something we accept or do.

@andrey-yantsen
Copy link
Author

Well, that's understandable, but I had to try :)

Thanks!

P.S. Don't hesitate to poke me if you'll get any ideas on how I can assist here.

@alexanderznamensky
Copy link

Hi All!
Looks like there is still no solution for correct working of thermostats?

@paulius2k
Copy link

paulius2k commented Jan 14, 2022

Hi,
I also need this one to work (for BHT-002-GCLW).

According to these tickets, it's not very optimistic:
tuya/tuya-home-assistant#361
tuya/tuya-home-assistant#502
tuya/tuya-home-assistant#676
tuya/tuya-home-assistant#675
tuya/tuya-home-assistant#670
tuya/tuya-home-assistant#547
tuya/tuya-home-assistant#542
tuya/tuya-home-assistant#535
tuya/tuya-home-assistant#502

The main problem for me is that current_temperature is not reported at all.

@paulius2k
Copy link

paulius2k commented Jan 19, 2022

@frenck : I have just found out from Tuya support, that current_temperature value from BHT-002 is actually sent in parameter upper_temp, I checked it at it seems to be true:

2022-01-19 12:19:21 DEBUG (Thread-5) [homeassistant.components.tuya] Received update for device xxx: {'switch': True, 'temp_set': 24, 'upper_temp': 29, 'eco': False, 'child_lock': False}

EDIT: I just noticed this had been found already in #57403 (comment)

I could use this data in e.g. templates to workaround the current_temperture=null issue, however, I don't see the upper_temp parameter anywhere, eventhough as shown above, it registers in logs.

Is there any way to access it? maybe include it into the list of attributes of this climate entity, next to others:

hvac_modes: off, heat_cool
min_temp: 1
max_temp: 7
target_temp_step: 0.5
current_temperature: null
temperature: 2.4
friendly_name: xx
supported_features: 1

OR do implement quirk for BHT thermostats and set current_temperature attribute = to upper_temp, not sure if that's ok tough.

@frenck
Copy link
Member

frenck commented Jan 19, 2022

In this case, the device is communicating non-standard. This is an issue that either Tuya or the manufacturer needs to resolve; as it is using customized data points, not supported by Tuya cloud, not documented and specific for this device model.

We cannot add/support these things, as with 400K+ different models in Tuya's database, it would be one endless fest of exceptions. That is not a maintainable situation.

@paulius2k
Copy link

paulius2k commented Jan 19, 2022

@frenck : on a global scale - I do agree.

  1. For the long term solution I will write to the support of MOES House (producer of devices) and see what they are ready to do.
  2. As a workaround: is there any way to register and access upper_temp value received in Tuya update message?

@alexanderznamensky
Copy link

Hi All!

In old version of Tuya component this device worked fine:
image

In new one:
image

Does this mean that Tuya made some changes in old component for such devices?

@frenck
Copy link
Member

frenck commented Jan 19, 2022

@alexanderznamensky

In old version of Tuya component this device worked fine

Not really relevant; as the API used there is no longer an option (as it is going to be discontinued). The question you ask at the end is more a question you should ask Tuya, as they developed those APIs.

@frenck
Copy link
Member

frenck commented Jan 19, 2022

@frenck : on a global scale - I do agree.

  1. For the long term solution I will write to the support of MOES House (producer of devices) and see what they are ready to do.
  2. As a workaround: is there any way to register and access upper_temp value received in Tuya update message?

There isn't a way to access that parameter from within automations or templates, as it is not a used/known/picked up data point by Home Assistant.

@mowl111
Copy link

mowl111 commented Jan 24, 2022

Hi All!

In old version of Tuya component this device worked fine: image

In new one: image

Does this mean that Tuya made some changes in old component for such devices?

Is it possible to change to the previous (old) version, to get them working? I just installed HA for control and protocol those devices.... Great work with HA @frenck 👌

@andrey-yantsen
Copy link
Author

andrey-yantsen commented Jan 24, 2022

@mowl111 nope, unfortunately, it's not really possible. As it was said multiple times, Tuya will deprecate the old API sometime soon, and the old integration will stop working. You can try raising a ticket with Tuya (via their https://iot.tuya.com interface), but the chances are low.

As an alternative, you can use LocalTuya — they just released thermostat support today, or you can use the old integration via HACS, installing it from the repo andrey-yantsen/home-assistant-tuya-old.

@alexanderznamensky
Copy link

HI @andrey-yantsen!
Have you tried to use LocalTuya for our device?
I did it once without sucess....

@andrey-yantsen
Copy link
Author

andrey-yantsen commented Jan 25, 2022

@alexanderznamensky yeah, I set it up yesterday, working like a charm. I used values from rospogrigio/localtuya#548 (review) but removed the mode control altogether as it was somewhat broken for me. I'm using Schedy anyway, and just set the required temperature to 19ºC when don't need the heating.

I don't think I would be able to help you with any questions, but it definitely will be better to continue the discussion in the PR to LocalTuya and not here, to avoid being too much off-topic.

P.S. During the config flow the integration was failing to add the device, but after a few more attempts — it was indeed added.

@paulius2k
Copy link

paulius2k commented Jan 25, 2022

Update on the Tuya Developer IoT Platform / App solution:

  • I got a response from Tuya support that:

What is displayed on the APP is the manufacturer's customized panel, which is defined by the manufacturer during production.
The manufacturer does not define the current_temperature directive, and this does not meet the cloud standard.
This is the cloud standard instruction document: https://developer.tuya.com/en/docs/iot/f?id=K9gf45ld5l0t9

  • I wrote to the manufacturer's - MOES House - support.
    The good thing is that they replied right away with request to provide more info.
    The worrisome thing is that it's been a week since I replied and they haven't responded anymore. Still trying...

UPD 01.27:
I got a message that the delay in response is due to the Chinese New Year holidays, which according to the web are:

Celebrations of Chinese New Year traditionally last for 16 days, starting from Chinese New Year's Eve to the Lantern Festival. In 2022, that is from January 31st to February 15th.

As a public holiday, Chinese people will get 7 days off from work from January 31st to February 6th in 2022.

Traditionally Chinese Lunar New Year activities started as early as three weeks before Chinese New Year's Eve. Old-fashioned (mostly rural) folk start cleaning their houses from the 23rd of the twelfth lunar month (January 25th, 2022).

@frenck
Copy link
Member

frenck commented Jan 26, 2022

Home Assistant 2022.2 (now in beta, feel free to join!), will have a diagnostics dump tool on the device page, which contains information to share in issues like these.

It can be helpful if all of you having issues with these MoesGo thermostats posted their diagnostics results here. I will allow finding a solution (or worst case, conclude there is none).

@andrey-yantsen
Copy link
Author

Thank you, Franck, for not giving up on us! :) Here's what I have: https://gist.github.com/andrey-yantsen/fbf856451e0b0b36c269d334a04d36a9.

Target temperature = 19 ºC
Current temperature = 21.5 ºC

@alexanderznamensky
Copy link

Hi Franck!
Thanks indeed!
Mine diagostic file is here: https://gist.github.com/alexanderznamensky/5168b2031998e7221cf93f7c7e897043

@KrisRux
Copy link

KrisRux commented Feb 3, 2022

@nawwman
Copy link

nawwman commented Feb 6, 2022

tuya-7f9cc39ea0465650084176882f541e7c-1OG Arbeitszimmer-68127b3731f6815fe90f89651d48f452.json (1).txt

For reference, current temp=20.5°C, target temp=22.0°C
device in HA is showing 4.4°C as target temp and no current temp

@SaSa1983
Copy link
Contributor

@frenck This should be fixed with #63941

Although still the "current_temperature" is missing because it is sent as "upper_temp" or "upper_temp_f"
But this has to be fixed in a separator commit

@andrey-yantsen
Copy link
Author

Just copied the updated base.py to my "beta" instance — it indeed helped with the scale! Thank you!

@snorbik
Copy link

snorbik commented Feb 18, 2022

after update to 2022.2.8 - tuya thermostats are broken for me.

Current temperature = 16,5 C (showing 90 C)
Set temperature = 10,0 C (showing 50 C)

Any idea how to fix it?

@frenck
Copy link
Member

frenck commented Feb 18, 2022

@snorbik Please, don't respond the same message on every closed issue.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2022
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