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 HY369RT ZIGBEE control from HA does not work, no choice of operating mode, no battery status, after reset integration not available #59517

Closed
diemon24 opened this issue Nov 10, 2021 · 11 comments

Comments

@diemon24
Copy link

The problem

Please correct the error in working with the thermostat:

The device status is updated only when changed through the TuyaSmart app, however, I cannot control the device operating mode and change the temperature from HA. In the previous version of Tuya integration, the temperature selection worked correctly (without the possibility of selecting the thermostat operating mode).

Including I can not see the status of the battery charge, when, as in the TuyaSmart application, this function works.

After restarting Tuya integration, the device becomes inaccessible. But if in HA you click on the thermostat mode selection, it becomes available.

Other tuya devices are working correctly.

Снимок экрана 2021-11-10 в 23 16 36

Снимок экрана 2021-11-10 в 23 28 23

Снимок экрана 2021-11-11 в 00 26 12

>

Снимок экрана 2021-11-11 в 00 27 03

Снимок экрана 2021-11-10 в 23 34 51

Снимок экрана 2021-11-10 в 23 36 25

What version of Home Assistant Core has the issue?

core-2021.11.2

What was the last working version of Home Assistant Core?

No response

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?

Logger: homeassistant.util.logging
Source: util/logging.py:105 
First occurred: 00:16:10 (8 occurrences) 
Last logged: 00:36:12

Exception in async_write_ha_state when dispatching 'tuya_entry_update_bf049da52a878c4cdbkkro': () Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 486, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 519, in _async_write_ha_state state = self._stringify_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 492, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 210, in state return self.hvac_mode File "/usr/src/homeassistant/homeassistant/components/tuya/climate.py", line 438, in hvac_mode return TUYA_HVAC_TO_HA[self.device.status[DPCode.MODE]] KeyError: 'comfort'
Exception in async_write_ha_state when dispatching 'tuya_entry_update_bfe44ce5e60c931e4c3jvp': () Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 486, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 519, in _async_write_ha_state state = self._stringify_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 492, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 210, in state return self.hvac_mode File "/usr/src/homeassistant/homeassistant/components/tuya/climate.py", line 438, in hvac_mode return TUYA_HVAC_TO_HA[self.device.status[DPCode.MODE]] KeyError: 'comfort'
Exception in async_write_ha_state when dispatching 'tuya_entry_update_bf91b523c6ed1cfb38rukr': () Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 486, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 519, in _async_write_ha_state state = self._stringify_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 492, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 210, in state return self.hvac_mode File "/usr/src/homeassistant/homeassistant/components/tuya/climate.py", line 438, in hvac_mode return TUYA_HVAC_TO_HA[self.device.status[DPCode.MODE]] KeyError: 'comfort'



Logger: homeassistant.components.climate
Source: components/tuya/climate.py:438 
Integration: Климат (documentation, issues) 
First occurred: 00:11:24 (2 occurrences) 
Last logged: 00:11:25

Error adding entities for domain climate with platform tuya
Error while setting up tuya platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 607, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 715, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 486, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 519, in _async_write_ha_state
    state = self._stringify_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 492, in _stringify_state
    if (state := self.state) is None:
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 210, in state
    return self.hvac_mode
  File "/usr/src/homeassistant/homeassistant/components/tuya/climate.py", line 438, in hvac_mode
    return TUYA_HVAC_TO_HA[self.device.status[DPCode.MODE]]
KeyError: 'comfort'

Additional information

No response

@probot-home-assistant
Copy link

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


tuya documentation
tuya source
(message by IssueLinks)

@diemon24
Copy link
Author

what I can make what this be working now?

@diemon24
Copy link
Author

@frenck pls, what i can make what this be working now?

@frenck
Copy link
Member

frenck commented Nov 15, 2021

@frenck pls, what i can make what this be working now?

I'm not sure why you pint me directly for this. I have no idea. This is an open source project, feel free to contribute a fix.

@diemon24
Copy link
Author

@frenck pls, what i can make what this be working now?

I'm not sure why you pint me directly for this. I have no idea. This is an open source project, feel free to contribute a fix.

Sorry. I assumed you could help with this ...

@awaldram
Copy link

#58876

this explains why most probably you cant set temperature any more.
Also a couple of potential fixes one requires code changes the other uses a Template to remediate the code failings.

@diemon24
Copy link
Author

The solution was found in the new version 2021.11.5

This is also described here:
#58876

@diemon24
Copy link
Author

@frenck pls, what i can make what this be working now?

I'm not sure why you pint me directly for this. I have no idea. This is an open source project, feel free to contribute a fix.

thank you very much for update. Now I can managed temperature but hvac mode don't working... How I can change hvac mode parameters in config files? I cannot specify Eco, Boost and Eco modes

@diemon24
Copy link
Author

diemon24 commented Nov 29, 2021

In addition to updating the files, I updated the climate.py file in Tuya Integration in docker:
I create a new file climate.py in homeassistant work configuration directory /config/climate.py and manual copy in bash console:

  • cp config/climate.py /usr/src/homeassistant/homeassistant/components/tuya/climate.py

In climate.py I changed 40-46 strings:
TUYA_HVAC_TO_HA = { "auto": HVAC_MODE_AUTO, "comfort": HVAC_MODE_HEAT, "eco": HVAC_MODE_HEAT_COOL, }

I do not use the existing settings in the ECO, COMFORT and BOOST presets. I am making the setting using the AUTO function and the MANUAL heating setting. Because the Tuya cloud gives for manage only the "Comfortable", :Auto", "Holiday" and "Eco" HVAC modes. But the comfort mode does not work. Only Auto and Eco are working correctly.
Thus, the device receives the status and can be controlled from the HA.

This change would prevent me from performing an HA update, but it did allow my device to work.

For automation, I use:

` - service: climate.set_hvac_mode
data:
hvac_mode: auto
target:
entity_id:
- climate.radiator_gostinaya
- climate.radiator_kuhnya
- climate.radiator_spalnya

  • delay:
    hours: 0
    minutes: 0
    seconds: 1
    milliseconds: 0
  • service: climate.set_temperature
    target:
    entity_id:
    • climate.radiator_gostinaya
    • climate.radiator_kuhnya
    • climate.radiator_spalnya
      data:
      temperature: 24`

For best performance, you need to use presets - ECO/COMFORT. But I don’t have much development experience, so I don’t know how to do it correctly.

For Tuya integration, I have climatic devices only thermostats. So it works. But this HVAC configuration may not work for other Tuya climatic devices if your network has thermostats, heaters and air conditioners at the same time. If use climatic devices any developers, this might work.

@diemon24
Copy link
Author

Снимок экрана 2021-11-30 в 01 34 31

@github-actions
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.

@github-actions github-actions bot added the stale label Feb 27, 2022
@github-actions github-actions bot closed this as completed Mar 6, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 6, 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

3 participants