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
69.94k stars 29.03k forks source link

Tuya Dehumidifier #80093

Closed joz1n closed 1 year ago

joz1n commented 1 year ago

The problem

Only ON/OFF switch working

What version of Home Assistant Core has the issue?

2022.10.3

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

No response

Diagnostics information

tuya-a3b93be241fd21bbbf22bf504a6932dc-Dehumidifier-D023-9c04277d76c49d97267e52ca209dc463.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2022-10-11 11:03:05.126 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140160595762224] Cannot set humidity, device doesn't provide methods to set it
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/src/homeassistant/homeassistant/components/tuya/humidifier.py", line 153, in set_humidity
RuntimeError: Cannot set humidity, device doesn't provide methods to set it

Additional information

No response

homeassistant commented 1 year 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)


tuya documentation tuya source (message by IssueLinks)

gnvdude commented 1 year ago

I've got a similar issue. Instead of opening a new case, I'll ride along with this one.

Everything is working fine for Tuya cloud to home assistant integration. I finally got around to checking why my dehumidifer was not working. In Tuya cloud it's labeled as a KT device not a CS

I cannot control in home assistant

image

image

frenck commented 1 year ago

I've got a similar issue. Instead of opening a new case, I'll ride along with this one.

That sounds like bad idea, as it is not related.

frenck commented 1 year ago

@joz1n This issue might actually have been solved in Home Assistant Core 2022.10.4, could you try?

joz1n commented 1 year ago

Works fine now But sensor data is still not displayed And there is no fan and mode control Are they supported?

frenck commented 1 year ago

But sensor data is still not displayed

Looking at the diagnostics you've provided, the Tuya Cloud API doesn't provide sensors for your device. Thus it is correct you don't see sensors in Home Assistant either.

And there is no fan and mode control Are they supported?

Humidifiers in Home Assistant have no fan modes.

webmasterkai commented 1 year ago

This issue is likely related to (or a duplicate of) #70016, #70344.

I too am unable to change the dehumidify_set_value Tuya attribute from within HA. Additionally, I'm seeing humidity_indoor available inside the data.status portion of the debug file, but no sensor for its value is created within HA.

My debug file: tuya-d49947b15c00c159b7c573724e28bac1-Twig Dehumidifier 1-cd7f17187279fd7a44073cac6387e015.json.txt

    "status": {
      "switch": true,
      "mode": "drying",
      "humidity_indoor": 58,
      "dehumidify_set_value": 50,
      "anion": false,
      "fan_speed_enum": "low",
      "child_lock": false,
      "swing": true
    }

The status documentation for Dehumidifier (cs) lists "countdown_left", "pm25", "temp_indoor", "humidity_indoor" as possible sensor values. Both temp_indoor and humidity_indoor seem to be missing from tuya/const.py.

Does "%" need to be added to the PERCENTAGE UnitOfMeasurement aliases?

Andre0512 commented 1 year ago

I changed my dehumidifier to climate entity (and also created sensors for humidity and temperature). It looks much better now. Screenshot from 2023-01-07 03-38-34

The biggest plus with climate entity is, you can control tuyas fan_speed_enum. This isn't possible with home assistants (de)humidifier.

The down sites are, the climate card is broken and you don't have a history because these are only for temperature. But when someone need these things, you can workaround this with dehumidifier template I think.

I would make a pr, do you like the climate solution with fan support or should I just fix the current dehumidifier?

Andre0512 commented 1 year ago

I overthought it and I think the cleanest solution should be here to stay with the dehumidifier entity and create some sensors and controls.

Screenshot from 2023-01-07 15-53-43

Note: My dehumidifier has the dehumidify_set_enum here (see tuya docs), so you can only chose between some given values. If your dehumidifiers have dehumidify_set_value, you can control it with the humidity control, else the "Target Humidity" select will be created.