tuya / tuya-home-assistant

Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
MIT License
861 stars 206 forks source link

Climate device bug (DUUX threesixty ) #482

Closed malosaa closed 2 years ago

malosaa commented 2 years ago

Describe the bug Can not control the device, operation button is no option in it

Expected behavior It get detected, i can control the temp, but when its on it says it's off, and not able to select an operation.

Screenshots image

thermostat module image

Home Assistant Version

**Device info (please complete the following information, which can be found in [log](https://github.com/tuya/tuya-home-

 {
      "active_time": 1632234486,
      "biz_type": 0,
      "category": "qn",
      "create_time": 1632234486,
      "icon": "smart/icon/ay1546498252458MDNjl/9344e65d792a4d564c734381d7c3dce1.png",
      "id": "31300661483fda835c80",
      "ip": "***",
      "lat": "***",
      "local_key": "***",
      "lon": "***",
      "model": "",
      "name": "ThreeSixty",
      "online": true,
      "owner_id": "10107869",
      "product_id": "2vcy8zacjqw3olsq",
      "product_name": "",
      "status": [
        {
          "code": "switch",
          "value": false
        },
        {
          "code": "temp_set",
          "value": 30
        },
        {
          "code": "level",
          "value": "1"
        }
      ],
      "sub": false,
      "time_zone": "+01:00",
      "uid": "***",
      "update_time": 1632263147,
      "uuid": "31300661483fda835c80"
    },

**Device specifications

2021-09-22 13:54:16 INFO (MainThread) [custom_components.tuya_v2.climate] climate init
2021-09-22 13:54:16 INFO (MainThread) [custom_components.tuya_v2.climate] climate add->['31300661483fda835c80']
}
2021-09-22 13:54:09 DEBUG (SyncWorker_1) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/31300661483fda835c80/specifications, params = None, body = None, t = 1632311649045 
2021-09-22 13:54:09 DEBUG (SyncWorker_1) [tuya iot] Response: {
  "result": {
    "category": "qn",
    "functions": [
      {
        "code": "switch",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "temp_set",
        "type": "Integer",
        "values": "{\"unit\":\"℃\",\"min\":18,\"max\":30,\"scale\":0,\"step\":1}"
      },
      {
        "code": "level",
        "type": "Enum",
        "values": "{\"range\":[\"1\",\"2\",\"3\"]}"
      }
    ],
    "status": [
      {
        "code": "switch",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "temp_set",
        "type": "Integer",
        "values": "{\"unit\":\"℃\",\"min\":18,\"max\":30,\"scale\":0,\"step\":1}"
      },
      {
        "code": "level",
        "type": "Enum",
        "values": "{\"range\":[\"1\",\"2\",\"3\"]}"
      }
    ]
  },
  "success": true,
  "t": 1632311649167
}

Additional context

DatDraggy commented 2 years ago

I'm having the same issue. My AC FQC8150 can be controlled through HA but the state is never updated and will always show as turned off.

SgtBatten commented 2 years ago

Same issue with my 'qn' kogan panel heater. The v1 tuya component at least let me turn it on and off but now i've lost that with v2

Daandeve commented 2 years ago

Same issue with 'eurom smart electric heater' current temperature is null and operations are not available. Home assistant version 2021.10.4

malosaa commented 2 years ago

Let's hope they fix it... @Daandeve

Can anyone tag the developer? As this bug is almost for all electric heaters

Als you know what's weird, I have also homeseer v4, there is a tuya plugin and works as expected.. so the Home assistant version has a bug

malosaa commented 2 years ago

I found a way to fix the status and operation mode, but for heaters like i have with a certain ventilation level i don't know how to add it

please try this one, for me it works.

@DatDraggy @SgtBatten @Daandeve @pfefferle

climate.zip

malosaa commented 2 years ago

I think i fixed also the fan control.

i will test some versions and upload it here. than everything should be fixed.

DatDraggy commented 2 years ago

@malosaa thank you for your effort but I think it would be better to create a fork and change it there, to easily see changes and maybe even make improvements. Then you could make a pull request to have your changes integrated in the repo too

malosaa commented 2 years ago

ill do it now

malosaa commented 2 years ago

@DatDraggy

https://github.com/malosaa/tuya-home-assistant/blob/master/custom_components/tuya_v2/climate.py

in my last edit i did see this: with the newer api i did see that DPCODE_FAN_SPEED_ENUM has changed to DPCODE_LEVEL, so that fixes my fan speed.

//UPDATE Added DPCODE_FAN_SPEED_ENUM + DPCODE_LEVEL to support both

malosaa commented 2 years ago

But if u take a look, it fixes all the problems posted here. All my heaters show now the status, fanspeed, and on/of works correct in operation

this is my first device when it's off image

here my second device turned on. image

DatDraggy commented 2 years ago

It seems like now every device is regarded as a heater. My air conditioning unit is now only for heating but still doesn't update it's status

malosaa commented 2 years ago

It seems like now every device is regarded as a heater. My air conditioning unit is now only for heating but still doesn't update it's status

i will look at it now, weird, i have no problems here.

malosaa commented 2 years ago

@DatDraggy

i did some rewrite, try now

DatDraggy commented 2 years ago

Replaced file, restarted, still the same image Before there were much more actions

Daandeve commented 2 years ago

Where is the climate.py file located in home assistant 2021.10.4?

lmichalak78 commented 2 years ago

It does not work in my integration. My heaters look like this: image

What is more in my loga I have: Oct 18 10:55:46 havm hass[15099]: 2021-10-18 10:55:46 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform tuya_v2.sensor: Platform not found (cannot import name 'STATE_CLASS_TOTAL_INCREASING' from 'homeassistant.components.sensor' (/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/sensor/init.py)).

Where is the problem?

malosaa commented 2 years ago

That's really weird, here they show up normal. I did restart many times and everything is working.

I'll check again today to see if I did perhaps forget something for that specific device

kxqcvl commented 2 years ago

any update on this issue? Still not working

Daandeve commented 2 years ago

@kxqcvl More info on this topic #574

frenck commented 2 years ago

This issue has been fixed with the Home Assistant Core version of the integration. This fix will be published with the Home Assistant Core 2021.11 release.

malosaa commented 2 years ago

@frenck I just tested it, and doesnt work, this one is updated 3 days ago (core version) https://github.com/home-assistant/core/blob/dev/homeassistant/components/tuya/climate.py

Regards

frenck commented 2 years ago

@malosaa Please file a bug in that case at our Core repository and provide all needed details and debug logs. That way I can take a look at what is going on.

malosaa commented 2 years ago

@frenck ok doing it now

regards