Smart Life (tuya) show wrong temperature

@3v1n0 Thank you! Did you submit fixes to mainstream repo?

1 Like

All my Tuya devices disappeared (disconnected) from HA yesterday after I updated to core 2021.11.1 did anyone else have this problem for the TuyaV2 integration? Once I rolled back to the previous day’s HA back up everything as working again.

I did mention that it would be the way (even though my code is just a quick hack, not something merge-able), but it requires custom codepaths for devices with product_id that is IAYz2WK1th0cMLmL (please check if yours match).

So, I can imagine that upstream is reluctant in doing that just for one specific kind (that tuya explicitly didn’t support), even though that’s probably the most sold tuya thermostat ever…

I’ve updated the branch to make it look only like an heater given that this is something true for this, and the scheduler card didn’t support properly the heater/cooler mode.


BTW, I think that another way to use it without the custom integration above would be to just define a custom heater via:

template:
  - sensor:
      - name: "Tuya thermostat fixed temperature"
        unique_id: tuya_thermostat_temperature_fixed
        unit_of_measurement: "°C"
        state: '{ (states('sensor.original_tuya_temperature_sensor_name')) | float) / 2.0 }' # use your multiplier here

climate:
  - platform: generic_thermostat
    name: Tuya Heater
    heater: climate.your_tuya_thermostat_id
    target_sensor: sensor.tuya_thermostat_temperature_fixed
    min_temp: 5
    max_temp: 35
    ac_mode: false
    target_temp: 17
    min_cycle_duration:
      seconds: 5
    initial_hvac_mode: "off"
    away_temp: 12
    precision: 0.5

Then, set the actual thermostat temperature value to an high value, and just use this manual thermostat to handle it. Sad but should work (check the syntax, as I didn’t test it fully).

This worked great, thanks!

I have a MOES BHT-002 thermostat which uses the SmartLife app. It used to work with the old TUYA integration but I now have several problems:

  • Temperatures (readings and settings) are out by a factor of a fifth
  • Temperatures never update. When I add the TUYA 2 integration (I’ve added and removed it several times to see if I can sort it out at all to no avail), the temperature seems to be read but then no more.
  • I can’t send any commands to the thermostat - I can’t set a temperature, switch it off, etc.
    Some of the suggestions above may help (I’ve already set up a sensor to multiply the temperature by 5) but not everything. Appreciate any suggestions.

Old Tuya
It will work, I don’t know how long
Edit:
Tuya pushed back the timeline for sunsetting the old API with 6 months; but it was too late for us to change course and ship the old integration.

https://github.com/andrey-yantsen/home-assistant-tuya-old

Thanks, I’ll look at that. A bit of an update as I realise I’m mistaken about it not reporting to HA. I manually changed the temperature setting on the thermostat using the SmartLife app and it updated in HA. For info, this is what the states are in developer tools. As you can see, HA can’t read the current temperature and I can’t control it from HA.

hvac_modes: off, heat_cool
min_temp: 1
max_temp: 7
target_temp_step: 0.5
current_temperature: null
temperature: 2.3
friendly_name: Blah thermostat
supported_features: 1

1 Like

Sorry to come back so quickly. I installed the old Tuya using HACS, deleted the new Tuya, restarted HA but I can’t see how to configure my devices in the old Tuya. There’s nothing I can see to set it up.

Refresh your browser ( Ctrl + F5 )

ScreenShot_20211114161050

Groan! I tried just about everything except refreshing the browser! Thanks so much for your help, it’s now working perfectly as it used to.

As we’re on the subject, can I be cheeky and ask for some more help! :grin: Ideally I’d like to use local control for my Tuya devices. I’ve had no success getting the local keys of my devices. I’ve tried the Tuya development platform but get a “code”: 1106, “msg”: “permission deny” error when I try to get the device information. I’ve tried packet sniffing using Packet Capture but I can’t create a certificate (seems to be a common problem these days).

I’m stumped. Would you have any suggestions for how I might get around this?

  1. Tuya 1106, permission deny
    https://support.tuya.com/en/help/_detail/K9kui9wvuwc93

  2. You Tube
    HOW TO - Get All Local Tuya Keys

    https://youtu.be/YKvGYXw-_cE

  3. https://iot.tuya.com

1 Like

Well it’s another laugh out loud moment! Your image 3 doesn’t look like what I see. Tonight, when I tried it I finally got an option that got me the local key! I swear I have tried every option without success, several times. The option that has worked for me, “Get Device Information”, seems new. The option “Get the device information” which, from its name, obviously does something completely different still gives the permission deny error!

Anyway, hopefully to help others here’s how it looks for me, and thanks again for your time, I do appreciate it.

1 Like

The math I figured out to get the correct temperature set point from my Della 12000 BTU Mini-Split was the following in Developer Tools > Templates:

{{ (((state_attr(‘climate.shed_mini_split’, ‘temperature’) - 142.0) / 1.777 + 61.0) * 2.0) | round(0) | float / 2.0 }}

However, I could not figure out how to override how this was appearing via the “Customize Entities” UI, and I couldn’t use the tuya-hacks download because the climate.py file only had a variable for TUYA_TEMPERATURE_MULTIPLIER which wouldn’t work because my math needs to subtract a constant before multiplying (or dividing in my example) by a constant then adding back a third constant. The custom_components/tuya hack only seems to allow for a constant multiplier and not for subtractive and additive constants?!?

Hello I’ve been trying for days to figure out why to resolve the issue with my Tuya devices showing the incorrect temperature. no mater what I’ve tried i cant seem to get the current temperature to display in HA. I see many posts about going into “configurations, integrations, tuya then options” and adjust the divider however this setting does not exist anywhere. I also tried to download and install the custom integrations such as GitHub - ollo69/ha_tuya_custom: Tuya Custom Component for testing however, when i install or place the folder into my “custom_components” folder the integration completely disappears from HA. i also tried local tuya and im able to add the device successfully however, im not able to get the correct temperature. any assistants anyone can provide is greatly apricated!

The new Tuya integration has no ability to adjust the multiplier and local Tuya doesn’t yet support thermostats. You have to revert to old Tuya. Follow the instructions above (basically: remove new Tuya, install old Tuya using HACS, restart HA, refresh your browser, set up old Tuya integration where you’ll then find the options for multipliers). Good luck!

1 Like

thanks so much for your response! their are so many links on this post. are you able to provide the link to the repository for “old tuya” so that i can download and install in my HA environment?

Like 3v1n0 i made a dirty hacks to tuya v2 component from its master branch and now it using hard-coded multiplier 2 and temp_step 0.5.
Get https://gazizova.net/pub/install/hassio/tuya.zip , check with antivirus (e.g. clamscan, don’t trust any guy from internet!), extract it to /config/custom_components/ and restart HA to try. If something wrong, remove this folder tuya.
Modified component is usable if you have one or several tuya climate devices only with one multiplier value (2 or 10). If you have several tuya devices with mixed values then use old tuya v1 component that have per-device settings.

2 Likes

Think I used this one.

1 Like

Thanks a lot! I´ve used this way to fix it and it works, temperatures are correct and you can even set the temp.

Notes:
1, You can set the temperature of device only when it´s set to manual mode (through SmartLife app).
2, I think there is no refresh rate of temperature status:


Only after restart of HA I will get update of temperatures. Do you know how to fix it?
3, After some time value of temperature set is changed without any intervention from my side.

1 Like

Home Assistant 2021.12.9

Hi there,
I have the latest HA version and the official Tuya plugin, unfortunately the thermostat shows wrong values, these would have to be multiplied by 5. How can I change that? thank you

2 Likes