question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Device Support Request] Tuya SmartLife compatible "Smart Water Valve"

See original GitHub issue

Is your feature request related to a problem? Please describe. I have a new Zigbee “Smart Water Valve”. It’s a battery/solar powered device that connects to an external garden tap. It is sold as a Tuya SmartLife compatible device.

Describe the solution you’d like I would like this device to be supported via ZHA

Device signature - this can be acquired by clicking on the "Zigbee Device Signature" button in the device settings
{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x0051",
      "in_clusters": [
        "0x0000",
        "0x0004",
        "0x0005",
        "0xef00"
      ],
      "out_clusters": [
        "0x000a",
        "0x0019"
      ]
    }
  },
  "manufacturer": "_TZE200_arge1ptm",
  "model": "TS0601",
  "class": "zigpy.device.Device"
}
Diagnostic information - this can be acquired by clicking on the "Download Diagnostics" button in the device settings
{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2022.4.7",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.9.9",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Australia/Brisbane",
    "os_name": "Linux",
    "os_version": "5.10.28-Unraid",
    "run_as_root": true
  },
  "custom_components": {
    "unifigateway": {
      "version": "0.3.3",
      "requirements": [
        "pyunifi==2.21"
      ]
    },
    "bayislandsguide": {
      "version": "1.0.0",
      "requirements": []
    },
    "iotawatt": {
      "version": "0.2.1",
      "requirements": [
        "iotawattpy==0.1.0"
      ]
    },
    "plex_recently_added": {
      "version": "0.3.8",
      "requirements": []
    },
    "fullykiosk": {
      "version": "1.0.1",
      "requirements": [
        "python-fullykiosk==0.0.11"
      ]
    },
    "weatherflow": {
      "version": "1.0.4",
      "requirements": [
        "pyweatherflowrest==1.0.8"
      ]
    },
    "smartthinq_sensors": {
      "version": "0.12.12",
      "requirements": [
        "pycountry>=20.7.3",
        "xmltodict>=0.12.0"
      ]
    },
    "bureau_of_meteorology": {
      "version": "1.1.2",
      "requirements": []
    },
    "goodwe": {
      "version": "1.0.0",
      "requirements": [
        "goodwe==0.2.17"
      ]
    },
    "hacs": {
      "version": "1.24.5",
      "requirements": [
        "aiogithubapi>=21.11.0"
      ]
    },
    "spotcast": {
      "version": "v3.6.29",
      "requirements": [
        "spotify_token==1.0.0"
      ]
    },
    "sonoff": {
      "version": "3.0.3",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    },
    "watchman": {
      "version": "0.5.0",
      "requirements": [
        "prettytable==3.0.0"
      ]
    }
  },
  "integration_manifest": {
    "domain": "zha",
    "name": "Zigbee Home Automation",
    "config_flow": true,
    "documentation": "https://www.home-assistant.io/integrations/zha",
    "requirements": [
      "bellows==0.29.0",
      "pyserial==3.5",
      "pyserial-asyncio==0.6",
      "zha-quirks==0.0.72",
      "zigpy-deconz==0.14.0",
      "zigpy==0.44.2",
      "zigpy-xbee==0.14.0",
      "zigpy-zigate==0.7.4",
      "zigpy-znp==0.7.0"
    ],
    "usb": [
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*2652*",
        "known_devices": [
          "slae.sh cc2652rb stick"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*zigstar*",
        "known_devices": [
          "ZigStar Coordinators"
        ]
      },
      {
        "vid": "1CF1",
        "pid": "0030",
        "description": "*conbee*",
        "known_devices": [
          "Conbee II"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8A2A",
        "description": "*zigbee*",
        "known_devices": [
          "Nortek HUSBZB-1"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8B34",
        "description": "*bv 2010/10*",
        "known_devices": [
          "Bitron Video AV2010/10"
        ]
      }
    ],
    "codeowners": [
      "@dmulcahey",
      "@adminiuga"
    ],
    "zeroconf": [
      {
        "type": "_esphomelib._tcp.local.",
        "name": "tube*"
      }
    ],
    "after_dependencies": [
      "usb",
      "zeroconf"
    ],
    "iot_class": "local_polling",
    "loggers": [
      "aiosqlite",
      "bellows",
      "crccheck",
      "pure_pcapy3",
      "zhaquirks",
      "zigpy",
      "zigpy_deconz",
      "zigpy_xbee",
      "zigpy_zigate",
      "zigpy_znp"
    ],
    "is_built_in": true
  },
  "data": {
    "ieee": "**REDACTED**",
    "nwk": 45888,
    "manufacturer": "_TZE200_arge1ptm",
    "model": "TS0601",
    "name": "_TZE200_arge1ptm TS0601",
    "quirk_applied": false,
    "quirk_class": "zigpy.device.Device",
    "manufacturer_code": 4417,
    "power_source": "Battery or Unknown",
    "lqi": 87,
    "rssi": null,
    "last_seen": "2022-05-06T20:18:03",
    "available": true,
    "device_type": "EndDevice",
    "signature": {
      "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
      "endpoints": {
        "1": {
          "profile_id": 260,
          "device_type": "0x0051",
          "in_clusters": [
            "0x0000",
            "0x0004",
            "0x0005",
            "0xef00"
          ],
          "out_clusters": [
            "0x000a",
            "0x0019"
          ]
        }
      }
    },
    "entities": [],
    "neighbors": [],
    "endpoint_names": [
      {
        "name": "SMART_PLUG"
      }
    ],
    "user_given_name": null,
    "device_reg_id": "09f15feed7b6da3de8ba64044d92e581",
    "area_id": null
  }
}

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:100 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
MattWestbcommented, May 13, 2022

Some interesting for tubes sniff. I have only looking on the pairing then tuya ZBGW is setting up the device / Zigbee chip and after that is only DP commands that is out of my scope. First we is knowing that also tuya DP devices can needing the tuya magic spell for working OK then the Zigbee module is sending some data to the MCU for configuring it. Then the device is joining its reporting one attribute then its have getting the network key (its not normal):

ZigBee Network Layer Data, Dst: 0x0000, Src: 0xef44
ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 1
    Frame Control Field: Data (0x00)
    Destination Endpoint: 1
    Cluster: Basic (0x0000)
    Profile: Home Automation (0x0104)
    Source Endpoint: 1
    Counter: 228
ZigBee Cluster Library Frame, Command: Report Attributes, Seq: 190
    Frame Control Field: Profile-wide (0x08)
    Sequence Number: 190
    Command: Report Attributes (0x0a)
    Attribute Field, Uint8: 70
        Attribute: Application Version (0x0001)
        Data Type: 8-Bit Unsigned Integer (0x20)
        Uint8: 70 (0x46)
    Attribute Field, Uint8: 54
        Attribute: Unknown (0xffe2)
        Data Type: 8-Bit Unsigned Integer (0x20)
        Uint8: 54 (0x36)
    Attribute Field, Uint8: 1
        Attribute: Unknown (0xffe4)
        Data Type: 8-Bit Unsigned Integer (0x20)
        Uint8: 1 (0x01)

then the normal tuya init with one magic spell being casted:

ZigBee Network Layer Data, Dst: 0xef44, Src: 0x0000
ZigBee Application Support Layer Data, Dst Endpt: 255, Src Endpt: 1
    Frame Control Field: Data (0x40)
    Destination Endpoint: 255
    Cluster: Basic (0x0000)
    Profile: Home Automation (0x0104)
    Source Endpoint: 1
    Counter: 48
ZigBee Cluster Library Frame, Command: Read Attributes, Seq: 22
    Frame Control Field: Profile-wide (0x10)
    Sequence Number: 22
    Command: Read Attributes (0x00)
    Attribute: Manufacturer Name (0x0004)
    Attribute: ZCL Version (0x0000)
    Attribute: Application Version (0x0001)
    Attribute: Model Identifier (0x0005)
    Attribute: Power Source (0x0007)
    Attribute: Unknown (0xfffe)

(its sent to EP 255 and the coordinator is acking it back from EP 255 !!!) and the rest is normal INIT until the device is requesting one update of the trust center link key the coordinator is sending this:

ZigBee Network Layer Data, Dst: 0xef44, Src: 0x0000
ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 1
    Frame Control Field: Data (0x00)
    Destination Endpoint: 1
    Cluster: Basic (0x0000)
    Profile: Home Automation (0x0104)
    Source Endpoint: 1
    Counter: 52
ZigBee Cluster Library Frame, Command: Write Attributes, Seq: 23
    Frame Control Field: Profile-wide (0x10)
    Sequence Number: 23
    Command: Write Attributes (0x02)
    Attribute Field, Uint8: 13
        Attribute: Unknown (0xffde)
        Data Type: 8-Bit Unsigned Integer (0x20)
        Uint8: 13 (0x0d)

five times and then sending the updated key ( = the INIT is made). The MCU is sending its DPs to the host system as normal. The device is sending:

ZigBee Network Layer Data, Dst: 0x0000, Src: 0xef44
ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 1
    Frame Control Field: Data (0x00)
    Destination Endpoint: 1
    Cluster: Basic (0x0000)
    Profile: Home Automation (0x0104)
    Source Endpoint: 1
    Counter: 251
ZigBee Cluster Library Frame, Command: Report Attributes, Seq: 200
    Frame Control Field: Profile-wide (0x08)
    Sequence Number: 200
    Command: Report Attributes (0x0a)
    Attribute Field, String: 
        Attribute: Unknown (0xffdf)
        Data Type: Character String (0x42)
        String: 

Plus one normal time request:

ZigBee Network Layer Data, Dst: 0x0000, Src: 0xef44
ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 1
    Frame Control Field: Data (0x00)
    Destination Endpoint: 1
    Cluster: Time (0x000a)
    Profile: Home Automation (0x0104)
    Source Endpoint: 1
    Counter: 252
ZigBee Cluster Library Frame, Command: Read Attributes, Seq: 201
    Frame Control Field: Profile-wide (0x00)
    Sequence Number: 201
    Command: Read Attributes (0x00)
    Attribute: Local Time (0x0007)

and the coordinator is responding:

ZigBee Network Layer Data, Dst: 0xef44, Src: 0x0000
ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 1
    Frame Control Field: Data (0x00)
    Destination Endpoint: 1
    Cluster: Time (0x000a)
    Profile: Home Automation (0x0104)
    Source Endpoint: 1
    Counter: 74
ZigBee Cluster Library Frame, Command: Read Attributes Response, Seq: 201
    Frame Control Field: Profile-wide (0x18)
    Sequence Number: 201
    Command: Read Attributes Response (0x01)
    Status Record, Uint32: 705710509
        Attribute: Local Time (0x0007)
        Status: Success (0x00)
        Data Type: 32-Bit Unsigned Integer (0x23)
        Uint32: 705710509 (0x2a1049ad)

And the rest is normal DP communication.

If not getting the MCU working ok its needed casting one normal tuya magic spell on the module then it joining the network (as being done with the TS004F DMS) and if its not enough trye sending the 0xffde after the normal magic is being casted and perhaps also the 0xffdf.

All the MCU commands is better persons with more knowledge is looking on if its somthing interesting but need copy every data sent from the DP cluster and encoding it by hand for doing it.

3reactions
tube0013commented, May 13, 2022

I got mine today. here’s a basic capture from the tuya gateway paring, and then turning it on to 50%, then 75% then 100% then off. I’ll hook up to a water line tomorrow and get some captures to see if it reads flow rate.

Valve_join_On50-75-100-Off.pcapng.zip

key: 2b8cfd4ec0b120ac9d32050a87404dc8

Read more comments on GitHub >

github_iconTop Results From Across the Web

MOES WiFi Smart Water Valve, Water Shut Off Tool ...
MOES WiFi Smart Water Valve, Water Shut Off Tool, Shower Timer Shutoff, Sprinkler Controller, Work with Tuya Smart Life APP, Compatible with Alexa...
Read more >
User Guide-Tuya IoT Development Platform-Tuya Developer
This topic describes how to use the Smart Life app . Download the app. Search for Smart Life in Apple's App Store and...
Read more >
Tuya Smart Wifi/zigbee Water Gas Pipeline Auto Shut Off ...
Tuya Smart WiFi/ZigBee Water Gas Pipeline Auto Shut OFF Valve Controller Smart Life APP Remote Control With Alexa Google Home · 1.Two Protocols...
Read more >
Tuya Smart - Apps on Google Play
Tuya Smart. Smart life, smart living • Remotely control home appliances from anywhere • Add and control multiple devices at once with one...
Read more >
Smart Home Device Types | Cloud-to-cloud | Google Home
Device Type Description Traits LOCK Locks can lock, unlock, and report a locked state. Required: LockUnlock VALVE Valves can be opened and closed. Required: OpenClose...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found