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
71k stars 29.64k forks source link

[tuya] No functions are available for Bluetooth TRV of model SEA802 B01 (Bluetooth TRV (drlajpqc)) #81931

Closed forabi closed 1 year ago

forabi commented 1 year ago

The problem

There's pretty much no functionality available to control any function of this Bluetooth TRV via Tuya integration

Basic missing features include: seeing current temperature, setting target temperature, setting mode to "Away".

image

One commercially available product using this module: Maxcio Smart Heating Thermostat Compatible with Alexa & Google Assistant, WiFi Gateway and 2.4 GHz WiFi Required, WLAN Radiator Thermostat with Child Lock Function

What version of Home Assistant Core has the issue?

2022.11.1

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 API

Link to integration documentation on our website

No response

Diagnostics information


{
  "home_assistant": {
    "installation_type": "Unsupported Third Party Container",
    "version": "2022.12.0.dev0",
    "dev": true,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.9.15",
    "docker": true,
    "arch": "aarch64",
    "timezone": "UTC",
    "os_name": "Linux",
    "os_version": "5.10.104-linuxkit",
    "run_as_root": false
  },
  "custom_components": {},
  "integration_manifest": {
    "domain": "tuya",
    "name": "Tuya",
    "documentation": "https://www.home-assistant.io/integrations/tuya",
    "requirements": [
      "tuya-iot-py-sdk==0.6.6"
    ],
    "dependencies": [
      "ffmpeg"
    ],
    "codeowners": [
      "@Tuya",
      "@zlinoliver",
      "@frenck"
    ],
    "config_flow": true,
    "iot_class": "cloud_push",
    "dhcp": [
      {
        "macaddress": "105A17*"
      },
      {
        "macaddress": "10D561*"
      },
      {
        "macaddress": "1869D8*"
      },
      {
        "macaddress": "381F8D*"
      },
      {
        "macaddress": "508A06*"
      },
      {
        "macaddress": "68572D*"
      },
      {
        "macaddress": "708976*"
      },
      {
        "macaddress": "7CF666*"
      },
      {
        "macaddress": "84E342*"
      },
      {
        "macaddress": "D4A651*"
      },
      {
        "macaddress": "D81F12*"
      }
    ],
    "integration_type": "hub",
    "loggers": [
      "tuya_iot"
    ],
    "is_built_in": true
  },
  "data": {
    "endpoint": "https://openapi.tuyaeu.com",
    "auth_type": 0,
    "country_code": "49",
    "app_type": "smartlife",
    "mqtt_connected": true,
    "disabled_by": null,
    "disabled_polling": false,
    "name": "Bathroom Heating",
    "model": "SEA802 B01",
    "category": "wk",
    "product_id": "drlajpqc",
    "product_name": "Bluetooth TRV",
    "online": true,
    "sub": true,
    "time_zone": "+02:00",
    "active_time": "2021-10-30T15:08:26+00:00",
    "create_time": "2021-10-30T15:08:26+00:00",
    "update_time": "2021-12-12T17:51:01+00:00",
    "function": {
      "window_check": {
        "type": "Boolean",
        "value": {}
      },
      "frost": {
        "type": "Boolean",
        "value": {}
      },
      "temp_correction": {
        "type": "Integer",
        "value": {
          "unit": "",
          "min": -6,
          "max": 6,
          "scale": 0,
          "step": 1
        }
      },
      "child_lock": {
        "type": "Boolean",
        "value": {}
      },
      "switch": {
        "type": "Boolean",
        "value": {}
      }
    },
    "status_range": {
      "window_check": {
        "type": "Boolean",
        "value": {}
      },
      "frost": {
        "type": "Boolean",
        "value": {}
      },
      "temp_correction": {
        "type": "Integer",
        "value": {
          "unit": "",
          "min": -6,
          "max": 6,
          "scale": 0,
          "step": 1
        }
      },
      "child_lock": {
        "type": "Boolean",
        "value": {}
      },
      "switch": {
        "type": "Boolean",
        "value": {}
      }
    },
    "status": {
      "window_check": true,
      "frost": true,
      "temp_correction": 0,
      "child_lock": false,
      "switch": true
    },
    "home_assistant": {
      "name": "Bathroom Heating",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": [
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "original_icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "climate.bathroom_heating",
            "state": "heat_cool",
            "attributes": {
              "hvac_modes": [
                "off",
                "heat_cool"
              ],
              "min_temp": 7,
              "max_temp": 35,
              "target_temp_step": 1.0,
              "current_temperature": null,
              "friendly_name": "Bathroom Heating",
              "supported_features": 0
            },
            "last_changed": "2022-11-10T19:58:29.681558+00:00",
            "last_updated": "2022-11-10T19:58:29.681558+00:00"
          }
        }
      ]
    }
  }
}

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Many properties in the JSON diagnostics file are `null`, including `current_temperature`. Also, the `state` is `heat_cool` but the device only supports `heat`. There's also no target temperature as far as I can tell.

Additionally, `supported_features` is `0`, which probably means the features are not detected?

Additional information

Using Tuya CLI, I can get the following information for the same device:

base ❯ tuya-cli get --id xxxxxxxxxxxxxxxx --key xxxxxxxxxxxxxxxx --cid xxxxxxxxxxxxxxxx --full
{
  dps: {
    '8': true,
    '10': true,
    '27': 0,
    '40': true,
    '101': true,
    '102': 203,
    '103': 50,
    '105': 0,
    '106': false,
    '108': true,
    '130': true
  },
  cid: 'xxxxxxxxxxxxxxxx'
}

Using Tuya API Explorer, these map to the following:

image

It seems like the most important properties are:

Additional functions that are exposed in the app and also have matching properties in the JSON response above:

Screenshot for the same device from the app:

Screenshot_20221110-211538_Smart Life Screenshot_20221110-211544_Smart Life Screenshot_20221110-211548_Smart Life Screenshot_20221110-211551_Smart Life

Data from Tuya API explorer

curl --request GET "https://openapi.tuyaeu.com/v1.2/iot-03/devices/xxxxxxxxxxxx/specification" --header "sign_method: HMAC-SHA256" --header "client_id: xxxxxxxxx" --header "t: 1668111711746" --header "mode: cors" --header "Content-Type: application/json" --header "sign: xxxxxxxx" --header "access_token: xxxxxxxxxxx"
ResponseCopy
{
  "result": {
    "category": "wk",
    "functions": [
      {
        "code": "window_check",
        "lang_config": {
          "false": "OFF",
          "true": "ON"
        },
        "name": "Window",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "frost",
        "lang_config": {
          "false": "OFF",
          "true": "ON"
        },
        "name": "Antifreeze",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "temp_correction",
        "lang_config": {
          "unit": ""
        },
        "name": "Temperature calibration",
        "type": "Integer",
        "values": "{\"unit\":\"\",\"min\":-6,\"max\":6,\"scale\":0,\"step\":1}"
      },
      {
        "code": "child_lock",
        "lang_config": {
          "false": "OFF",
          "true": "ON"
        },
        "name": "Lock",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "switch",
        "lang_config": {
          "false": "OFF",
          "true": "ON"
        },
        "name": "Switch",
        "type": "Boolean",
        "values": "{}"
      }
    ],
    "status": [
      {
        "code": "window_check",
        "lang_config": {
          "false": "OFF",
          "true": "ON"
        },
        "name": "Window",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "frost",
        "lang_config": {
          "false": "OFF",
          "true": "ON"
        },
        "name": "Antifreeze",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "temp_correction",
        "lang_config": {
          "unit": ""
        },
        "name": "Temperature calibration",
        "type": "Integer",
        "values": "{\"unit\":\"\",\"min\":-6,\"max\":6,\"scale\":0,\"step\":1}"
      },
      {
        "code": "child_lock",
        "lang_config": {
          "false": "OFF",
          "true": "ON"
        },
        "name": "Lock",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "switch",
        "lang_config": {
          "false": "OFF",
          "true": "ON"
        },
        "name": "Switch",
        "type": "Boolean",
        "values": "{}"
      }
    ]
  },
  "success": true,
  "t": xxxxxxx,
  "tid": "xxxxxxx"
}
curl --request GET "https://openapi.tuyaeu.com/v1.1/iot-03/devices/xxxxxxx" --header "sign_method: HMAC-SHA256" --header "client_id: xxxxxxxxx" --header "t: xxxxxx" --header "mode: cors" --header "Content-Type: application/json" --header "sign: xxxxxx" --header "access_token: xxxxxxx"
ResponseCopy
{
  "result": {
    "active_time": 1636024639,
    "category": "wk",
    "category_name": "Thermostat",
    "create_time": 1635605554,
    "gateway_id": "xxxxxxx",
    "icon": "smart/icon/ay1496289297888GkNKB/754e42cdd3956910e122d0c1cf7e2a9d.png",
    "id": "xxxxxx",
    "ip": "",
    "lat": "xxxx",
    "local_key": "xxxxxx",
    "lon": "9.5102",
    "model": "SEA802 B01",
    "name": "Bedroom Heating",
    "node_id": "xxxxxx",
    "online": true,
    "owner_id": "35844595",
    "product_id": "drlajpqc",
    "product_name": "Bluetooth TRV",
    "sub": true,
    "time_zone": "+01:00",
    "update_time": 1639331461,
    "uuid": "xxxxxxx"
  },
  "success": true,
  "t": xxxxxx,
  "tid": "xxxxxx"
}
home-assistant[bot] 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!

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)