Tuya based water timer

I have the orange coloured Diivoo water timer with 2 valves. When I add it to Tuya integration, there is only one switch which controls the left valve.
I looked at Tuya developer link and added the device to it and there is only one switch, how does the app control both valves ?

Code from switch.py

    # Smart Water Timer
    "sfkzq": (
        SwitchEntityDescription(
            key=DPCode.SWITCH,
            translation_key="switch",

 "data": {
    "endpoint": "https://apigw.tuyaus.com",
    "terminal_id": "17494243685999rmEDR",
    "mqtt_connected": true,
    "disabled_by": null,
    "disabled_polling": false,
    "devices": [
      {
        "id": "eb693cdiizikexjp",
        "name": "2-Zone Smart Water Timer 2",
        "category": "sfkzq",
        "product_id": "r6ya07uz",
        "product_name": "2-Zone Smart Water Timer",
        "online": true,
        "sub": true,
        "time_zone": "-04:00",
        "active_time": "2025-06-08T23:59:22+00:00",
        "create_time": "2025-06-08T23:59:22+00:00",
        "update_time": "2025-06-08T23:59:22+00:00",
        "function": {
          "switch": {
            "type": "Boolean",
            "value": {}
          },

I was able to make it work. Steps:

  1. create an account on https://platform.tuya.com
  2. Create a new project
  3. Add the device using Devices->link app account (use Smartlife app username/password)
  4. Go to device debugging and there is a link at the top [product details], click on that
  5. In the next screen switch " Select Control Instruction Mode" to DP Instruction and save
  6. in HA got HACS and install this GitHub - lasry1/home-assistant-tuya-custom: ggq added and do not restart yet
  7. Open the custom_components/tuya/switch.py on you HA (you can use the File editor)
  8. Look for sfkzq
  9. Remove that section and replace it with
    # Smart Water Timer
    "sfkzq": (
        SwitchEntityDescription(
            key=DPCode.SWITCH,
            name="Switch",
            icon="mdi:sprinkler-variant",
        ),
        SwitchEntityDescription(
            key=DPCode.SWITCH_2,
            name="Switch_2",
            icon="mdi:sprinkler-variant",
        ),        
    ),
  1. Save the file and restart HA
  2. Go to settings devices and services and Add Tuya custom integration and configure it as you would normally

You can use my custom_component after doing steps 1-5

Thanks for the info.

I’m trying to use GitHub - lasry1/home-assistant-tuya-custom: ggq added just for the 1 switch controller Diivoo WT-03, which seems to be a sfkzq water timer (based on the Tuya debug data).

When I restarted HA I can see the old integration entry failed to bet setup, so I created a new one. When I did that I see the device, but the switch is not controllable, and the diagnostic valuse are all still unavailable.

where there any other suggestions involved it getting this to work?

You need to use my repo (previous post) and follow the instructions in that repo to switch the device instructions.

I’m on step 8. On opening switch.py in custom_compontents/tuya I do not have entry for sfkaq. I do have an entry for sfkzq, which is as follows:

“sfkzq”: (
SwitchEntityDescription(
key=DPCode.SWITCH,
name=“Switch”,
icon=“mdi:sprinkler-variant”,
),
),

which is the first portion of your modified code.

I have tried replacing this portion of code with your modified code, adding the ‘switch_2’ portion.

On rebooting and adding the Tuya integration I do now see Switch 1 and Switch 2 for the water timer, but both switches report unavailable and do not respond to any input.

sfkaq was a typo, now fixed.
you said you rebooted and added Tuya integration, if you make changes then add the integration,this will overwrite what you modified.
Please follow the steps as I posted them, this is not for the builtin tuya.

I followed all the steps, but at the end I failed when restarting HA with the following error message:

Setup failed for custom integration ‘tuya’: Unable to import component: No module named ‘homeassistant.backports.enum’

Which comes from line 10 in const.py:
from homeassistant.backports.enum import StrEnum

Information from HA developers: homeassistant.backports.enum.StrEnum is deprecated and was replaced by enum.StrEnum. It was removed starting with Python 3.12, see https://developers.home-assistant.io/blog/2024/04/08/deprecated-backports-and-typing-aliases

Would it be possible to correct this to get the integration working again?

I stopped using this integration and using Tuya Local instead.
If you want this one fixed, you need to contact the developer of this integration (I only added a device)

In the meantime I found that Xtend Tuya is doing the job with my water timer very well, so I also stopped my activities on this integration.