core icon indicating copy to clipboard operation
core copied to clipboard

Klarta Humidifier - Cannot set humidity, device doesn't provide methods to set it error - Tuya integration

Open convicte opened this issue 1 year ago • 8 comments

The problem

The device is correctly recognized by HA, but fails to expose all the settings, nor even the basic humidity adjustment mechanism: image

Adjusting the slider produces the following error - Cannot set humidity, device doesn't provide methods to set it

What version of Home Assistant Core has the issue?

2022.11.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tuya

Link to integration documentation on our website

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

Diagnostics information

tuya-2109f5cf8b931df6bab8eb459eab4563-Downstairs humidifier-f0fc3b85316aa7541c1a8d63ec998e9c.json.txt

Example YAML snippet

Not applicable

Anything in the logs that might be useful for us?

Logger: homeassistant.components.websocket_api.http.connection
Source: components/tuya/humidifier.py:153
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 21:40:12 (1 occurrences)
Last logged: 21:40:12

[140427823671536] Cannot set humidity, device doesn't provide methods to set it
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1744, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1781, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 208, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 943, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/humidifier/__init__.py", line 207, in async_set_humidity
    await self.hass.async_add_executor_job(self.set_humidity, humidity)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tuya/humidifier.py", line 153, in set_humidity
    raise RuntimeError(
RuntimeError: Cannot set humidity, device doesn't provide methods to set it

Additional information

No response

convicte avatar Dec 06 '22 20:12 convicte

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (websocket_api) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of websocket_api can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign websocket_api Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


websocket_api documentation websocket_api source (message by IssueLinks)

home-assistant[bot] avatar Dec 06 '22 20:12 home-assistant[bot]

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!

Code owner commands

Code owners of tuya can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign tuya Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


tuya documentation tuya source (message by IssueLinks)

home-assistant[bot] avatar Dec 06 '22 20:12 home-assistant[bot]

It looks like there is some strange lack of compatibility between Tuya-to-HA platform and the actual parameters visible in the Tuya Smart Life. I can adjust 10 different things in their app, but what is exposed as set parameters is this:

image

convicte avatar Dec 06 '22 21:12 convicte

Came across the same issue just today. What you see above matches what is available in HA. I see that in tuya dev portal you can switch from standard instruction set to DP instruction set (whatever "DP" stands for) and then you are able to from control all the settings from tuya portal. However, then the device is seen by HA as unsupported. Therefore my understanding is that we either need:

  • standard instruction set mode and then adjust the mapping on tuya portal side (need to contact tuya? can be done from UI/API?)
  • DP instruction set mode, but then mapping between device specific instructions and generic interface needs to happen on HA side (integration/configuration).

Any thoughts @frenck ?

tomasz-grobelny avatar Dec 12 '22 23:12 tomasz-grobelny

Small update: I tried contacting TuYa on option 1 above - their answers did not bring much value, so the only option is to somehow use this "DP instruction set mode" which means that device specific logic needs to be on HA (integration) side.

BTW, this level seems to correspond to target humidity, doesn't it?

tomasz-grobelny avatar Dec 27 '22 23:12 tomasz-grobelny

@tomasz-grobelny - you could try a custom repo for tuya setup. i have used local tuya for a couple of devices that didnt have all the features.

its fairly straightforward to map the DP instructions to the entities but did take a couple of goes for me to get it perfect.

UrZdcw9 avatar Jan 03 '23 06:01 UrZdcw9

@UrZdcw9 can you share some example of such mapping?

lukasz-bielinski avatar Feb 01 '23 13:02 lukasz-bielinski

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.