Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

Tuya Thermostat unavailable after setting temperature #49

Open
hribaro1 opened this issue Nov 7, 2020 · 35 comments
Open

Tuya Thermostat unavailable after setting temperature #49

hribaro1 opened this issue Nov 7, 2020 · 35 comments

Comments

@hribaro1
Copy link

hribaro1 commented Nov 7, 2020

Tuya original and Tuya custom integration behave the same.
After reload of the hassio server temperature is shown on climate entity.

Besides wrong temperature showing which can be adjusted also setting of temperature does not work
Switch on and switch off of the thermostat works normally.
If I want to set the temperature to different value then immediately thermostat becomes unavailable in hassio lovelace.

Thank you in advance for possible suggestions.

Regards
Robert

@myrulezzz
Copy link

Hi I am having the same issue. Able to switch on, switch off thermostat but changing the temperature makes thermostat unavailable in home assistant.
After restarting home assistant it shows the correct status to off.
I am facing another one issue. Temperature is shown:
21C is 2.1 in home assistant
I have tried adding in configuration.yaml
tuya_custom:
devices_config:
- device_name: # this is mandatory with at least one of the other keys
unit_of_measurement: "C" # "F" or "C", not set to use value provided from cloud
temp_divider: 1 # any positive number, all temperature values will be divided by this value
curr_temp_divider: 1 # any positive number, only current temperature values will be divided by this value
ext_temp_sensor: sensor.temp # a sensor that provide ambient temp used when not provided by device
but i get temperature instead of 21C, 210C

@Kirmas
Copy link

Kirmas commented Nov 8, 2020

Its looks like PaulAnnekov/tuyaha#51 (comment)

If this is a problem with out of range value you can change set_temperature function in the tuyaha/devices/climate.py file

def set_temperature(self, temperature):
"""Set new target temperature."""

    # the value used to set temperature is scaled based on the configured divider
    divider = self._divider or 1

    if not self.has_decimal():
        temp_val = round(float(temperature))
        set_val = temp_val * divider
    else:
        temp_val = float(temperature)
        set_val = round(temp_val * divider)
    if self._control_device("temperatureSet", {"value": temp_val}):
        self._update_data("temperature", set_val)

I think about pull request with this small fix but not sure that all devise work similar

@ollo69
Copy link
Owner

ollo69 commented Nov 8, 2020

I have always wondered if the scaled temperature should be reset to the original value in the set method, but to maintain back compatibility and not having received any related issue until now, I set it as is.
As soon as I will have some time available, I will align this component to the version that will be released shortly in HA (PR is already merged), then I will proceed to define here a new parameter to manage this situation. If everything will be ok, I will proceed with the PRs in TuyaHA and HA.
Just be patient, full process will take some times...

ollo69 added a commit that referenced this issue Dec 8, 2020
Fix issue in setting temperature for some devices (issue #49)
@ollo69
Copy link
Owner

ollo69 commented Dec 8, 2020

Just released a new version to fix this issue.
There is a ne config option (Set Temperature value divided) that should be checked for this case.
Before pushing PR in TuyaHA and HA, please confirm this fix the issue.

@myrulezzz
Copy link

myrulezzz commented Dec 8, 2020 via email

@ollo69
Copy link
Owner

ollo69 commented Dec 8, 2020

Yes, please. You can also use HACS for this if you installed it.
Tuya Custom is intended to test new functionality for Tuya integration before pushing change in official library and integration, to speed-up test and avoid breaking change. Now this component is aligned again with last version of official HA integration and device configuration is managed from UI integration options.

@myrulezzz
Copy link

myrulezzz commented Dec 8, 2020 via email

@ollo69
Copy link
Owner

ollo69 commented Dec 8, 2020

Did you change some option in integration page?
Can you check HA logs for error message?

@myrulezzz
Copy link

myrulezzz commented Dec 8, 2020 via email

@myrulezzz
Copy link

myrulezzz commented Dec 8, 2020 via email

@ollo69
Copy link
Owner

ollo69 commented Dec 8, 2020

Did you change some option in integration page?

@myrulezzz
Copy link

myrulezzz commented Dec 8, 2020 via email

@myrulezzz
Copy link

And thr temperature from 2.4 when i press the up arrow goes directly to 2.9 in the thermostat control.is this the correct behavior? Shouldn't go to 2.5 2.6 e.t.c?

@ollo69
Copy link
Owner

ollo69 commented Dec 8, 2020

I don't see your options, I think you should post using browser and not e-mail.
Anyway, if I well understand, HA is showing values that is 1/10 of real one, eg 2.4 instead of 24.0, can you confirm this?
I need to do some modification, but than it will be required that you change options in HA for your device.
I'll let you know when new version will be available.

@myrulezzz
Copy link

image

Hi here are the options.yes you are correct for the temperature

ollo69 added a commit that referenced this issue Dec 8, 2020
Allow divider value in range 0.1 - 0.9 (issue #49)
@ollo69
Copy link
Owner

ollo69 commented Dec 8, 2020

You should select your device from the list and select submit to configure it!

Please first of all install the last version I just released (v0.1.2) and then configure your device as in picture below:

image

Eventually define also minimum and maximum target values.

Than let me know if value are correct and set command works properly

@myrulezzz
Copy link

myrulezzz commented Dec 9, 2020 via email

@ollo69
Copy link
Owner

ollo69 commented Dec 9, 2020

Sorry but your explanation is totally unclear and conflicting with previous information.
You said before that your thermostat was showing 2.4 instead of 24, now you say 2400 instead of 240. Obviously if your thermostat in HA is displaying 240, the Temperature value divider in the option page should be set to 10 and not 0.1.
May be it is better if you post some images of what is really displayed in HA?

@myrulezzz
Copy link

General options
options

Thermostat Options
thermostatoptions

Current Temperature shown on thermostat
currentthermostat
Pressing the up arrow to increase temperature
arrowup
Pressing the down arrow arrow to decrease temperature goes to 34 and then unavailable
arrowdown

@ollo69
Copy link
Owner

ollo69 commented Dec 9, 2020

Please set option Temperature values divider to 10 instead 0.1
Report if it solve.

@myrulezzz
Copy link

Hi changed and the temperature is correct. But when changing temperature still goes to unavailable and get the same warning.

@ollo69
Copy link
Owner

ollo69 commented Dec 9, 2020

Check option Use Temperature value previously divided in set option

@myrulezzz
Copy link

myrulezzz commented Dec 9, 2020 via email

@myrulezzz
Copy link

Ollo one more question. For tuya covers do you know any way to make the cover work with a slider? Instead of up down stop?

@ollo69
Copy link
Owner

ollo69 commented Dec 9, 2020

Don't think it is possible, API do not provide information about current cover position.

@rhladky
Copy link

rhladky commented Dec 11, 2020

@ollo69 - I am too lazy to fiddle with custom component :) Any idea when the change will be available in official HA new version?

@ollo69
Copy link
Owner

ollo69 commented Dec 11, 2020

Still need some adjustment and feed-back, than I will create PR but need commit from library and HA. It will take some times, may be 1 month...

@rhladky
Copy link

rhladky commented Dec 13, 2020

OK, I did setup the tuya custom integration and works like a hell :) Thank you very much for your effort @ollo69 . Wish you all the best and Merry Xmas.

@peetereczek
Copy link

peetereczek commented Dec 21, 2020

I just changed from official integration to your custom one. Issue has gone, thanks for fix!
Looking forward for the merge information.

Correct setting example:
image

@kitkat270
Copy link

kitkat270 commented Jan 12, 2021

Hi @ollo69, still not quite right for me I'm afraid.

Still getting these in the log, then the device goes unavailable.

Logger: custom_components.tuya_custom.tuyaha.tuyaapi Source: custom_components/tuya_custom/tuyaha/tuyaapi.py:273 Integration: Tuya Custom (documentation) First occurred: 19:00:36 (4 occurrences) Last logged: 19:08:04 control device error, error code is ValueOutOfRange

Screenshot 2021-01-12 at 19 14 02

The temperature values are fine with the divider set at 10. But I'm getting the same 'unavailable' problem with and without the 'Use divider for set' ticked.

EDIT: Just to add... if I set the temp to 18, the display on the radiator shows 80.0. If I set it to 15, it shows 50.0. If I set it to 20, it shows 0.0. And it does this even when I untick the 'Use divider for set' box.

Many thanks for your efforts sorting all these things :-)

Amanda

@djp3k05
Copy link

djp3k05 commented Mar 4, 2021

thank you for your hard work. that fixed my issues and now my Moes thermostats are working fine. Temperature is displayed correctly and also I can set the desired target temperature.
Used the "10" divider value and the "Use divided temperature..." checkbox.
Unfortunately I discovered that sensors (like the sonoff zigbee temperature/pir and more) can't be imported from Tuya, as no support available for them. I will order the stuffs needed to use the zigbeemqtt to overcome all the issues with the Tuya integration.
Thank you again.

@thaliamontreux
Copy link

I'm having a issue with my thermostat from smart life I have a saswell thermostat. Hassio reports 45 degrees and im unable to adjust the tempature. here is what is interesting. When I add the thermostat to google, it creates 2 thermostats. But I only have one on smart life. One of them allows me to adjust the tempature and reports it correctly the other one just allows me to turn the power off to the device and reports 45 degrees... Why two thermostats. I looked in hassio and I only got one thermostat. So it's not correctly pulling information from tuya? can anyone help? This is very frustrating.

@ollo69
Copy link
Owner

ollo69 commented Aug 4, 2021

This component is not supported anymore. Please refer to integration main page.

@myrulezzz
Copy link

myrulezzz commented Oct 4, 2021 via email

@diemon24
Copy link

diemon24 commented Oct 7, 2021

Общие опции Опции

Варианты термостата термостатопции

Текущая температура, показанная на термостате текущийтермостатНажатие стрелки вверх для повышения температуры стрелка вверхНажатие стрелки вниз для снижения температуры доходит до 34, а затем недоступно стрелка вниз

Hello. After install custom Tuya and activated integration, after more times (many hours) I see all devices in HA. But configuration page in Tuya Custom integration not open. When I can click "Configuration" I see window "Don't open configuration". How config file I can enter parameters thermostats parameters (values devider)?

in /config/custom_components/tuya_custom/tuyaha/devices/climate.py I change this param:

string 19-24 I change devider 1 to 10:
def init(self, data, api):
super().init(data, api)
self._unit = None
self._divider = 10
self._divider_set = False
self._ct_divider = 10

and my temperature now correct in Lovelace

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants