home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.65k stars 30.41k forks source link

Moes Thermostat (Tuya) showing temperatures 5 times less than reality #72703

Closed richard-c-howlett closed 1 year ago

richard-c-howlett commented 2 years ago

The problem

In the ongoing saga with Tuya based thermostats (Moes BHT-002) I have the issue of my temperatures are 5 times less than the real temperatures. Eg real temperature shown in SmartLife App is 19.5 degC but HomeAssistant 2022.5.5 shows 3.9 degC.

3.9 x 5 = 19.5

It was working fine in 2022.4.7.

I've trawled through many posts about these thermostats and the seemingly random differences in the temperatures they report. It would appear that it gets fixed for some and then broken for others.

Can we not have a configuration option that has a multiplier / divider value so that we can set this ourselves.

image image

What version of Home Assistant Core has the issue?

2022.5

What was the last working version of Home Assistant Core?

2022.4.7

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Tuya

Link to integration documentation on our website

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

Diagnostics information

tuya-2620e0a08968157285959f6dfebdc0bd-Thermostat-e6fc1ea397e4d915aad1d40377808aa9.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

tuya documentation tuya source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

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)

aperr69 commented 2 years ago

Same as issue (Issue #71315) reported on 04/05/2022. Having the ability to manipulate the divider for the temperature in a soft coding way is a good idea, as most of the work-arounds to fix this problem are for docker HA and not HAOS

Phil-m-pinto commented 2 years ago

Not sure what's going on but The HA guys don't seem to be doing anything about it. so far there has been release after release but it never seems to get fixed. Just an acknowledgement of the problem would be nice.

Dancage commented 2 years ago

same issue, just updated to 2022.6.0 and still not fixed, any ideas?

Phil-m-pinto commented 2 years ago

same issue, just updated to 2022.6.0 and still not fixed, any ideas?

Same here. I was hoping it would be fixed by now. None of my climate automations work at the moment' and we're unable to use home assistance to set the temperature. Not good when you're trying to sell the benefits to the other half.☺️

mromaithi commented 2 years ago

Same issue since 2022.5. I keep reverting back to 2022.4 - Please fix it.

Berdi86 commented 2 years ago

I have the same issue with all my tuya thermostats from different brands. It was okay for a short time, now I have 1/5 temperature.

frenck commented 2 years ago

The problem in this case, is that Moes thermostats are working off-specifications. They use a non-standard setting that the Tuya API is not able to handle correctly.

This is not a Home Assistant issue. The fact it shortly worked correctly, was caused by a bug in Home Assistant (which caused all others not to work correctly as the counterpart).

The only thing you can do: Is raise support/complaints with Tuya or Moes in these cases. They need to figure this out. For these Moes devices we correctly process the data as provided by Tuya (which has been verified and concluded in many issues before).

richard-c-howlett commented 2 years ago

I agree but having tried unsuccessfully to convince Moes already some time ago that this is something they need to fix I think the sensible way to workaround this is to have a configuration option that has a multiplier / divider value so that we can set this ourselves. Moes just batted it away when I approached them about it.

frenck commented 2 years ago

We don't provide entity based configuration options in Home Assistant. We can thus not offer your suggested configuration option.

We provide values as provide by the upstream APIs, if they are incorrect it is their problem to solve.

We don't have a viable construct to solve this, nor is it a problem caused by Home Assistant.

At this point, we can only say: Moes thermostats communicate incorrect values and their firmware (or Tuyas cloud handling in their APIs), is broken 😞

richard-c-howlett commented 2 years ago

Is there a code workaround that you could suggest so I can fix this myself? I know enough Python to do it. If you can tell me where I need to insert the code to do the multiplication of the current and target temperatures I can modify the code myself. I realise I will have to make the same change every time I upgrade but if that's the only way I can keep up-to-date with HA and have a working thermostat then that's how it will have to be.

Unless you can give Moes a kick up the ass for me please. Maybe a major writer/code owner for HA will have more luck with their less than helpful support staff. Like I said they just bat me away saying there's nothing wrong with the values supplied if the Tuya/SmartLife App displays it correctly (which it does).

frenck commented 2 years ago

Is there a code workaround that you could suggest so I can fix this myself? I know a bit of Python. Tell me where I can add the multiplication in and I can modify the code myself.

If you are a python programmer you can adjust climate.py to your likings in a custom integration. But that is a bit out of scope for our issue tracker.

frenck commented 2 years ago

Unless you can give Moes a kick up the ass for me please

You can do that. Stop buying their products 🀷

richard-c-howlett commented 2 years ago

I wouldn't call myself a Python programmer! I dabble in Python. Bash scripting is my thing.

richard-c-howlett commented 2 years ago

Unless you can give Moes a kick up the ass for me please

You can do that. Stop buying their products 🀷

I don't wish to replace the thermostat just for this issue. It works, just doesn't display correctly in the latest version of HomeAssistant

richard-c-howlett commented 2 years ago

I added "temperature = temperature * 5" in the functions "current_temperature" and "target_temperature" just before the return statement and it shows the correct temperatures. However when I then try to set a temperature it thinks the maximum it will accept is 7deg. I thought I could resolve this by setting the min and max using Developer Tools and setting the min and max to 5 and 35 respectively. This allows the slider to move up past 7 degrees but the temperature is never set at the value I choose.

So whilst adding a simple line into the code in a couple of places fixes the visual aspect there's underlying issues that I do not know how to resolve. I would greatly appreciate some help with this please.

I have 2 HA environments (Live running 2022.4.7 which is the latest that works and Test running 2022.6.2 which exhibits the problem). I've done a diff between the climate.py on Live and Test and there's no code changes relating to temperatures between 2022.4.7 and 2022.6.2. The changes seem to relate to HVAC modes.

Back last year when I was using the Tuya v1 integration it had options to set dividers for current and target temperatures. I've attached a screenshot from the instructions I wrote to help me reinstall HA if needed. Back then the temperatures were double what they should be so I set the dividers to 2. image Can you not reinstate something like this? This would solve many HomeAssistant users problems with this particular thermostat.

aperr69 commented 2 years ago

_added "temperature = temperature * 5" in the functions "current_temperature" and "targettemperature" just before the return statement and it shows the correct temperatures. However when I then try to set a temperature it thinks the maximum it will accept is 7deg. I thought I could resolve this by setting the min and max using Developer Tools and setting the min and max to 5 and 35 respectively. This allows the slider to move up past 7 degrees but the temperature is never set at the value I choose.

Are you using HAos or the HA docker solution?

richard-c-howlett commented 2 years ago

I run HA Core in a Python VirtualEnv on CentOS 7

frenck commented 2 years ago

Can you not reinstate something like this? This would solve many HomeAssistant users problems with this particular thermostat.

That is an integration option dialog, which is not the right path. If you have 2 different Tuya climate devices (e.g., Moes and another one that does work right), it will become problematic. As you can set is once for the whole integration.

richard-c-howlett commented 2 years ago

It would be better than it is now though ;) And I would have thought that generally people stick to one manufacturer....

frenck commented 2 years ago

It would be better than it is now though ;)

I disagree. Introducing concepts that we know are wrong by design is something we should never ever do and is never ever a long-term solution or improvement at all.

And I would have thought that generally people stick to one manufacturer....

That is not relevant for the implementation at all, the architecture of Home Assistant allows for it, so it has to be taken into account.

richard-c-howlett commented 2 years ago

OK so can you use your clout as a senior HA code owner/developer to get Moes to fix it their end please. Otherwise there's many of us who are stuck on 2022.4.7

frenck commented 2 years ago

Otherwise there's many of us who are stuck on 2022.4.7

Sorry to hear that. We cannot fix their devices at this point. As said above before, please contact Tuya and/or Moes.

richard-c-howlett commented 2 years ago

I've already been on at them and the say their product is working fine. I don't have the clout to say no it isn't

richard-c-howlett commented 2 years ago

OK I give in. Although I think Home Assistant could come up with a solution to this that would fit everyone I will try contacting Moes again.

@frenck could you please give me some text to add to the support ticket to accurately describe the problem at a level their dev team will understand. I ask this because if I tell them the temperature shows correctly in SmartLife/Tuya App and on the thermostat itself but not in Home Assistant all they will say is that I need to contact the writers of Home Assistant to get them to fix their code!!!

I'm hoping that with the correct description of the problem it may trigger a more supportive response from Moes.

frenck commented 2 years ago

The problem is that the temperature values communicated via the official Tuya Cloud API, maintained and offered by Tuya, are not correct for their devices. This is something we cannot do anything about; that is something Tuya & Moes need to figure out.

aperr69 commented 2 years ago

OK I give in. Although I think Home Assistant could come up with a solution to this that would fit everyone I will try contacting Moes again.

I feel your pain buddy. I too have set up multi-system calculations around HA, blgw and the Moes thermostats, that's totally bugg*red now.

If you need anymore people to pile into the Tuya API issue, please let us know the issue number.

richard-c-howlett commented 2 years ago

@frenck thank you but I can envisage something like what you've written getting the response that I should talk to Tuya which is where I was earlier this year before the unintentional code change fixed it for me and broke it for others.

I should add that I had just as much luck with Tuya. They just kept saying it's not their problem, talk to Moes. Moes said not our problem talk to Tuya.

You can see my frustration with this. To be brutally honest I think Home Assistant could find a solution to this that would then make these blasted thermostats work for everyone rather than the situation we have now where it's fine for some and broken for others.

richard-c-howlett commented 2 years ago

OK I give in. Although I think Home Assistant could come up with a solution to this that would fit everyone I will try contacting Moes again.

I feel your pain buddy. I too have set up multi-system calculations around HA, blgw and the Moes thermostats, that's totally bugg*red now.

If you need anymore people to pile into the Tuya API issue, please let us know the issue number.

Cheers - I'm trying Moes first. When I get the inevitable response that I should talk to Tuya and I raise a ticket with them I will let you know the issue number.

Phil-m-pinto commented 2 years ago

The problem is that the temperature values communicated via the official Tuya Cloud API, maintained and offered by Tuya, are not correct for their devices. This is something we cannot do anything about; that is something Tuya & Moes need to figure out.

Thank you for replying to this. I think it cures a lot of frustration that people have with the incorrect reading of their thermostats. At least we know what's going on now. The bit that puzzles me is the fact that smart Life displays the temperature correctly. So what are they doing to enable this? They must be changing the values. Surely it's these values that they should be passing to the home assistant integration. Something's clearly very wrong here. I think everyone needs to raise a ticket with tuya and ask them to explain why their app shows the correct temperature yet the temperature it passes to home assistant is incorrect. If everyone complains to tuya surely they cannot ignore it.

frenck commented 2 years ago

thank you but I can envisage something like what you've written getting the response that I should talk to Tuya which is where I was earlier this year before the unintentional code change fixed it for me and broke it for others.

Yes, the Tuya documentation has been corrected and the integration follows the specs as was designed by Tuya. Moes is the one not following the specifications in this case.

They just kept saying it's not their problem, talk to Moes. Moes said not our problem talk to Tuya.

I understand, in the end, we loose 😒

To be brutally honest I think Home Assistant could find a solution

We can't fix their data. In theory, quirk handling could be built into the library which is communicating with Tuya. Which is also built and maintained by Tuya 🀷

Berdi86 commented 2 years ago

It is not only in Moes, I have thermostats from Beca energy and other producers. They worked in the older version with home assistant, now they have also 1/5 of the temperature. I can not replace the thermostats with others, because they are a molti-steering with fan, air conditioning and cooling/heating valve.

mromaithi commented 2 years ago

I bought a Moes zigbee thermostat hoping it will solve the issue but it had it's own issue. Did anyone manage to find a fix? i'm stuck on 2022.4 HA dev please help..

frenck commented 2 years ago

@mromaithi Please read the actual thread before just shouting "HA dev please help..". Its not an HA issue.

Berdi86 commented 2 years ago

No, it caused the issue, so it could remove it

Phil-m-pinto commented 2 years ago

@mromaithi Please read the actual thread before just shouting "HA dev please help..". Its not an HA issue.

It my not be a HA issue but so many people are having this problem and Tuya and Moes are not responding to this and are unlikely to fix it.

There must be away you guys can resolve this. Please give us back a way to configure the temperature. This is really beginning to bug people. πŸ™

mromaithi commented 2 years ago

Have any one come up with any solution?

PAOK1926 commented 2 years ago

I have the same problem, temperature is right on the mobile application but is divided by 5 in Tuya's iot site and of course in HA. i also complained to both Tuya and Moes, but still no answer. i use HassOs, where is located this climate.py file to edit it temporarily ?

sag3ll0 commented 2 years ago

look like as #61876 after update to 2022.07 i got wrong temperature. but early it worked ok

Berdi86 commented 2 years ago

All my tuya thermostats have this issue. I don't have any moes thermostats. My thermostats are from beca. Now, also the tuya Google assistant integration has this issue. The fault is in the tuya service. Let's report that issues to tuya, in smartlife app and on every channel thousand times, to wake up sleepy tuya developers. Two of my thermostats are special thermostats with a cooling valve, a heating valve and a 3step fan, so I cant replace this big relais-array.

richard-c-howlett commented 2 years ago

Is any clever bod who knows Python and these Tuya thermostats able to come up with a replacement climate.py file please? I'm stuck on 2022.4.7 because of this temperature multiplier issue. I'd really like some of the improvements and enhancements offered by the latest releases but this thermostat issue is preventing me upgrading.

There must be loads of HA users suffering with this annoying issue. Does anyone have an open channel into Tuya regarding it?

Phil-m-pinto commented 2 years ago

All my tuya thermostats have this issue. I don't have any moes thermostats. My thermostats are from beca. Now, also the tuya Google assistant integration has this issue. The fault is in the tuya service. Let's report that issues to tuya, in smartlife app and on every channel thousand times, to wake up sleepy tuya developers. Two of my thermostats are special thermostats with a cooling valve, a heating valve and a 3step fan, so I cant replace this big relais-array.

73612 apparently the tuya_local integration works correctly on these thermostats so maybe that is the way forward. I'm going to give it a go as my comments to tuya are just falling on deaf ears.

https://community.home-assistant.io/t/moes-bht-002-thermostat-local-control-tuya-based/151953/101

Phil-m-pinto commented 2 years ago

This is ludicrous. Tuya have the technical know-how to build their company to the place it is today but they can't fix a temperature issue with a thermostat. The mind boggles πŸ˜”

mromaithi commented 2 years ago

This is ludicrous. Tuya have the technical know-how to build their company to the place it is today but they can't fix a temperature issue with a thermostat. The mind boggles πŸ˜”

Guys just flash the thermostat, use Mqtt and no more tuya cloud bs.

PAOK1926 commented 2 years ago

can you send a link or instructions to do the same ?

midstar commented 2 years ago

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

nawwman commented 2 years ago

@frenck It's not HA's fault or issue, sure, but the point is that Tuya and Moes are having a finger pointing standoff or just ignoring the issue. They don't have a problem, we normal users of those devices do. People have identified a - admittedly hacky - workaround that'll solve our problem in the short turn, it being just a simple multiplication of the values. Could that please just not be integrated for now?

In the future I'm pretty sure I'll stay clear of further Tuya devices

frenck commented 2 years ago

Could that please just not be integrated for now?

No, we won't add hacks/workarounds.

If someone wants to add/build a quirk system to support these cases, that would be awesome. Preferably directly into the Tuya client library (so all consumers of that package benefit from it).

../Frenck

serniko97 commented 2 years ago

Hi @frenck, could we add the possibility for all users to edit the base_value and base_step variables proposed with PR #77736 in the configuration file for each entity_id?

So users can edit the configuration.yaml like this:

tuya:
  entity_config:
    climate.livingroom_thermostat:
      temperature_divider: 2  # if omitted the default value is 10