core: Tuya WiFi Scene Select switch is unsupported

The problem

Tuya WiFi scene select switch isn’t supported by the Tuya integration. How can support be added?

Here is the diagnostic information for that device.

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.5.4",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.10.11",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/London",
    "os_name": "Linux",
    "os_version": "6.1.29",
    "supervisor": "2023.04.1",
    "host_os": "Home Assistant OS 10.2",
    "docker_version": "23.0.6",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "warmup": {
      "version": "2023.3.27",
      "requirements": []
    },
    "hacs": {
      "version": "1.32.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "panasonic_cc": {
      "version": "1.0.32",
      "requirements": []
    },
    "ramses_cc": {
      "version": "0.0.2",
      "requirements": [
        "ramses-rf==0.22.40",
        "pyserial-asyncio==0.6"
      ]
    }
  },
  "integration_manifest": {
    "domain": "tuya",
    "name": "Tuya",
    "codeowners": [
      "@Tuya",
      "@zlinoliver",
      "@frenck"
    ],
    "config_flow": true,
    "dependencies": [
      "ffmpeg"
    ],
    "dhcp": [
      {
        "macaddress": "105A17*"
      },
      {
        "macaddress": "10D561*"
      },
      {
        "macaddress": "1869D8*"
      },
      {
        "macaddress": "381F8D*"
      },
      {
        "macaddress": "508A06*"
      },
      {
        "macaddress": "68572D*"
      },
      {
        "macaddress": "708976*"
      },
      {
        "macaddress": "7CF666*"
      },
      {
        "macaddress": "84E342*"
      },
      {
        "macaddress": "D4A651*"
      },
      {
        "macaddress": "D81F12*"
      }
    ],
    "documentation": "https://www.home-assistant.io/integrations/tuya",
    "integration_type": "hub",
    "iot_class": "cloud_push",
    "loggers": [
      "tuya_iot"
    ],
    "requirements": [
      "tuya-iot-py-sdk==0.6.6"
    ],
    "is_built_in": true
  },
  "data": {
    "endpoint": "https://openapi.tuyaeu.com",
    "auth_type": 0,
    "country_code": "44",
    "app_type": "smartlife",
    "mqtt_connected": true,
    "disabled_by": null,
    "disabled_polling": false,
    "name": "Bathroom Smart Switch",
    "model": "LKWSW201",
    "category": "wxkg",
    "product_id": "l8yaz4um5b3pwyvf",
    "product_name": "Wireless Switch",
    "online": true,
    "sub": false,
    "time_zone": "+00:00",
    "active_time": "2023-01-05T20:12:39+00:00",
    "create_time": "2023-01-05T20:12:39+00:00",
    "update_time": "2023-05-30T17:17:47+00:00",
    "function": {},
    "status_range": {
      "switch_mode1": {
        "type": "Enum",
        "value": {
          "range": [
            "click",
            "press"
          ]
        }
      },
      "switch_mode2": {
        "type": "Enum",
        "value": {
          "range": [
            "click",
            "press"
          ]
        }
      },
      "battery_percentage": {
        "type": "Integer",
        "value": {
          "unit": "%",
          "min": 0,
          "max": 100,
          "scale": 0,
          "step": 1
        }
      }
    },
    "status": {
      "switch_mode1": "click",
      "switch_mode2": "click",
      "battery_percentage": 100
    },
    "home_assistant": {
      "name": "Bathroom Smart Switch",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": []
    }
  }
}

What version of Home Assistant Core has the issue?

2023.5.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

No response

Diagnostics information

{ “home_assistant”: { “installation_type”: “Home Assistant OS”, “version”: “2023.5.4”, “dev”: false, “hassio”: true, “virtualenv”: false, “python_version”: “3.10.11”, “docker”: true, “arch”: “x86_64”, “timezone”: “Europe/London”, “os_name”: “Linux”, “os_version”: “6.1.29”, “supervisor”: “2023.04.1”, “host_os”: “Home Assistant OS 10.2”, “docker_version”: “23.0.6”, “chassis”: “vm”, “run_as_root”: true }, “custom_components”: { “warmup”: { “version”: “2023.3.27”, “requirements”: [] }, “hacs”: { “version”: “1.32.1”, “requirements”: [ “aiogithubapi>=22.10.1” ] }, “panasonic_cc”: { “version”: “1.0.32”, “requirements”: [] }, “ramses_cc”: { “version”: “0.0.2”, “requirements”: [ “ramses-rf==0.22.40”, “pyserial-asyncio==0.6” ] } }, “integration_manifest”: { “domain”: “tuya”, “name”: “Tuya”, “codeowners”: [ “@Tuya”, “@zlinoliver”, “@frenck” ], “config_flow”: true, “dependencies”: [ “ffmpeg” ], “dhcp”: [ { “macaddress”: “105A17*” }, { “macaddress”: “10D561*” }, { “macaddress”: “1869D8*” }, { “macaddress”: “381F8D*” }, { “macaddress”: “508A06*” }, { “macaddress”: “68572D*” }, { “macaddress”: “708976*” }, { “macaddress”: “7CF666*” }, { “macaddress”: “84E342*” }, { “macaddress”: “D4A651*” }, { “macaddress”: “D81F12*” } ], “documentation”: “https://www.home-assistant.io/integrations/tuya”, “integration_type”: “hub”, “iot_class”: “cloud_push”, “loggers”: [ “tuya_iot” ], “requirements”: [ “tuya-iot-py-sdk==0.6.6” ], “is_built_in”: true }, “data”: { “endpoint”: “https://openapi.tuyaeu.com”, “auth_type”: 0, “country_code”: “44”, “app_type”: “smartlife”, “mqtt_connected”: true, “disabled_by”: null, “disabled_polling”: false, “name”: “Bathroom Smart Switch”, “model”: “LKWSW201”, “category”: “wxkg”, “product_id”: “l8yaz4um5b3pwyvf”, “product_name”: “Wireless Switch”, “online”: true, “sub”: false, “time_zone”: “+00:00”, “active_time”: “2023-01-05T20:12:39+00:00”, “create_time”: “2023-01-05T20:12:39+00:00”, “update_time”: “2023-05-30T17:17:47+00:00”, “function”: {}, “status_range”: { “switch_mode1”: { “type”: “Enum”, “value”: { “range”: [ “click”, “press” ] } }, “switch_mode2”: { “type”: “Enum”, “value”: { “range”: [ “click”, “press” ] } }, “battery_percentage”: { “type”: “Integer”, “value”: { “unit”: “%”, “min”: 0, “max”: 100, “scale”: 0, “step”: 1 } } }, “status”: { “switch_mode1”: “click”, “switch_mode2”: “click”, “battery_percentage”: 100 }, “home_assistant”: { “name”: “Bathroom Smart Switch”, “name_by_user”: null, “disabled”: false, “disabled_by”: null, “entities”: [] } } }

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

So I fixed this in a very roundabout manner. But it works. On the Tuya IOT platform, I created a 4 button switch product. Scanned the QR code of my newly created product into the SmartLife app. Then I associated new scenes with the Single click and long press of the Tuya Scene switch with Switch 1 On and Switch 2 On of my newly created product. Then in HA using Automations, I track when Switch 1 or Switch 2 of my new product turns on. And then I can do something else, and ofcourse turn the Switch back off as part of the Automation.