-
Notifications
You must be signed in to change notification settings - Fork 944
Description
Problem description
I need some help to develop the quirk for the NEO NAS-WV03B2 irrigation timer valve, with the vendor ID _TZE204_4fblxpma and model TS0601.

https://www.szneo.com/en/products/show.php?id=273
I could find a quirk that support TS0601 valves : #1556
Changing only the VID in ts0601_valve.py didn't work well. I tried for all the valve supported.
The best result is : valve states is correctly reported to HA but I can't set valve state from HA.
I haven't a Tuya gateway which make it difficult to find the good DP.
Does anyone got the same devices and can help me ?
Additionally does someone has a good explanation on this "Tuya magic spell" (or a link) ?
Solution description
I would like at least to be able to change valve state from ZHA.
Having battery status and measured water consumption would be great.
Screenshots/Video
Screenshots/Video
[Paste/upload your media here]
Device signature
Device 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": "0x0104",
"device_type": "0x0051",
"input_clusters": [
"0x0000",
"0x0001",
"0x0004",
"0x0005",
"0x0006",
"0x0702",
"0xef00"
],
"output_clusters": [
"0x000a",
"0x0019"
]
}
},
"manufacturer": "_TZE204_4fblxpma",
"model": "TS0601",
"class": "zhaquirks.tuya.ts0601_valve.TuyaValve"
}Diagnostic information
Diagnostic information
{
"home_assistant": {
"installation_type": "Home Assistant Core",
"version": "2024.5.2",
"dev": false,
"hassio": false,
"virtualenv": true,
"python_version": "3.12.3",
"docker": false,
"arch": "aarch64",
"timezone": "Europe/Paris",
"os_name": "Linux",
"os_version": "6.1.0-18-arm64",
"run_as_root": false
},
"custom_components": {
"powercalc": {
"documentation": "https://github.com/bramstroker/homeassistant-powercalc",
"version": "0.1.0",
"requirements": [
"numpy>=1.21.1"
]
},
"veolia": {
"documentation": "https://github.com/tetienne/veolia-custom-component",
"version": "0.4.0",
"requirements": [
"pyolia==0.4.0"
]
},
"zha_toolkit": {
"documentation": "https://github.com/mdeweerd/zha-toolkit",
"version": "1.0.0",
"requirements": [
"pytz"
]
}
},
"integration_manifest": {
"domain": "zha",
"name": "Zigbee Home Automation",
"after_dependencies": [
"onboarding",
"usb"
],
"codeowners": [
"@dmulcahey",
"@adminiuga",
"@puddly",
"@TheJulianJES"
],
"config_flow": true,
"dependencies": [
"file_upload"
],
"documentation": "https://www.home-assistant.io/integrations/zha",
"iot_class": "local_polling",
"loggers": [
"aiosqlite",
"bellows",
"crccheck",
"pure_pcapy3",
"zhaquirks",
"zigpy",
"zigpy_deconz",
"zigpy_xbee",
"zigpy_zigate",
"zigpy_znp",
"universal_silabs_flasher"
],
"requirements": [
"bellows==0.38.4",
"pyserial==3.5",
"pyserial-asyncio==0.6",
"zha-quirks==0.0.115",
"zigpy-deconz==0.23.1",
"zigpy==0.64.0",
"zigpy-xbee==0.20.1",
"zigpy-zigate==0.12.0",
"zigpy-znp==0.12.1",
"universal-silabs-flasher==0.0.18",
"pyserial-asyncio-fast==0.11"
],
"usb": [
{
"vid": "10C4",
"pid": "EA60",
"description": "*2652*",
"known_devices": [
"slae.sh cc2652rb stick"
]
},
{
"vid": "10C4",
"pid": "EA60",
"description": "*slzb-07*",
"known_devices": [
"smlight slzb-07"
]
},
{
"vid": "1A86",
"pid": "55D4",
"description": "*sonoff*plus*",
"known_devices": [
"sonoff zigbee dongle plus v2"
]
},
{
"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": "0403",
"pid": "6015",
"description": "*conbee*",
"known_devices": [
"Conbee III"
]
},
{
"vid": "10C4",
"pid": "8A2A",
"description": "*zigbee*",
"known_devices": [
"Nortek HUSBZB-1"
]
},
{
"vid": "0403",
"pid": "6015",
"description": "*zigate*",
"known_devices": [
"ZiGate+"
]
},
{
"vid": "10C4",
"pid": "EA60",
"description": "*zigate*",
"known_devices": [
"ZiGate"
]
},
{
"vid": "10C4",
"pid": "8B34",
"description": "*bv 2010/10*",
"known_devices": [
"Bitron Video AV2010/10"
]
}
],
"zeroconf": [
{
"type": "_esphomelib._tcp.local.",
"name": "tube*"
},
{
"type": "_zigate-zigbee-gateway._tcp.local.",
"name": "*zigate*"
},
{
"type": "_zigstar_gw._tcp.local.",
"name": "*zigstar*"
},
{
"type": "_uzg-01._tcp.local.",
"name": "uzg-01*"
},
{
"type": "_slzb-06._tcp.local.",
"name": "slzb-06*"
}
],
"is_built_in": true
},
"data": {
"ieee": "**REDACTED**",
"nwk": 55026,
"manufacturer": "_TZE204_4fblxpma",
"model": "TS0601",
"name": "_TZE204_4fblxpma TS0601",
"quirk_applied": true,
"quirk_class": "zhaquirks.tuya.ts0601_valve.TuyaValve",
"quirk_id": null,
"manufacturer_code": 4417,
"power_source": "Battery or Unknown",
"lqi": 188,
"rssi": -53,
"last_seen": "2024-06-13T22:04:07",
"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": "0x0104",
"device_type": "0x0051",
"input_clusters": [
"0x0000",
"0x0001",
"0x0004",
"0x0005",
"0x0006",
"0x0702",
"0xef00"
],
"output_clusters": [
"0x000a",
"0x0019"
]
}
},
"manufacturer": "_TZE204_4fblxpma",
"model": "TS0601"
},
"active_coordinator": false,
"entities": [
{
"entity_id": "sensor.tze204_4fblxpma_ts0601_batterie",
"name": "_TZE204_4fblxpma TS0601"
},
{
"entity_id": "switch.tze204_4fblxpma_ts0601_commutateur",
"name": "_TZE204_4fblxpma TS0601"
},
{
"entity_id": "update.tze204_4fblxpma_ts0601_micrologiciel",
"name": "_TZE204_4fblxpma TS0601"
}
],
"neighbors": [],
"routes": [],
"endpoint_names": [
{
"name": "SMART_PLUG"
}
],
"user_given_name": null,
"device_reg_id": "6a23222dc6f62bfd195c693883382674",
"area_id": null,
"cluster_details": {
"1": {
"device_type": {
"name": "SMART_PLUG",
"id": 81
},
"profile_id": 260,
"in_clusters": {
"0x0000": {
"endpoint_attribute": "basic",
"attributes": {
"0x0001": {
"attribute_name": "app_version",
"value": 73
}
},
"unsupported_attributes": {}
},
"0x0004": {
"endpoint_attribute": "groups",
"attributes": {},
"unsupported_attributes": {}
},
"0x0005": {
"endpoint_attribute": "scenes",
"attributes": {},
"unsupported_attributes": {}
},
"0x0006": {
"endpoint_attribute": "on_off",
"attributes": {},
"unsupported_attributes": {
"0x0000": {
"attribute_name": "on_off"
},
"0x4003": {
"attribute_name": "start_up_on_off"
}
}
},
"0x0702": {
"endpoint_attribute": "smartenergy_metering",
"attributes": {
"0x0306": {
"attribute_name": "metering_device_type",
"value": 2
},
"0x0300": {
"attribute_name": "unit_of_measure",
"value": 7
}
},
"unsupported_attributes": {
"0x0400": {
"attribute_name": "instantaneous_demand"
},
"0x0301": {
"attribute_name": "multiplier"
},
"0x0302": {
"attribute_name": "divisor"
},
"0x0303": {
"attribute_name": "summation_formatting"
},
"0x0304": {
"attribute_name": "demand_formatting"
},
"0x0000": {
"attribute_name": "current_summ_delivered"
},
"0x0100": {
"attribute_name": "current_tier1_summ_delivered"
},
"0x0102": {
"attribute_name": "current_tier2_summ_delivered"
},
"0x0104": {
"attribute_name": "current_tier3_summ_delivered"
},
"0x0106": {
"attribute_name": "current_tier4_summ_delivered"
},
"0x0108": {
"attribute_name": "current_tier5_summ_delivered"
},
"0x010a": {
"attribute_name": "current_tier6_summ_delivered"
},
"0x0001": {
"attribute_name": "current_summ_received"
},
"0x0200": {
"attribute_name": "status"
}
}
},
"0x0001": {
"endpoint_attribute": "power",
"attributes": {},
"unsupported_attributes": {}
},
"0xef00": {
"endpoint_attribute": "tuya_manufacturer",
"attributes": {
"0xef00": {
"attribute_name": "mcu_version",
"value": "1.0.14"
},
"0xef01": {
"attribute_name": "time_left",
"value": 66
}
},
"unsupported_attributes": {}
}
},
"out_clusters": {
"0x000a": {
"endpoint_attribute": "time",
"attributes": {},
"unsupported_attributes": {}
},
"0x0019": {
"endpoint_attribute": "ota",
"attributes": {
"0x0002": {
"attribute_name": "current_file_version",
"value": 73
}
},
"unsupported_attributes": {}
}
}
}
}
}
}Logs
Logs
Too many logs, I don't know which are relevant.
Custom quirk
Custom quirk
Just force the model in TuyaValve class in [ts0601_valve.py](https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/tuya/ts0601_valve.py) :[...]
class TuyaValve(CustomDevice):
"""Tuya valve device."""
signature = {
MODELS_INFO: [("_TZE204_4fblxpma", "TS0601")],
[...]Additional information
Made a scan with zha-tools, does not help me much
{
"ieee": "a4:c1:38:de:d7:31:94:6b",
"nwk": "0x2d0a",
"model": "TS0601",
"manufacturer": "_TZE204_4fblxpma",
"manufacturer_id": "0x4417",
"endpoints": [
{
"id": 1,
"device_type": "0x0051",
"profile": "0x0104",
"in_clusters": {
"0x0000": {
"cluster_id": "0x0000",
"title": "Basic",
"name": "basic",
"attributes": {
"0x0000": {
"attribute_id": "0x0000",
"attribute_name": "zcl_version",
"value_type": [
"0x20",
"uint8_t",
"Analog"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 3
},
"0x0001": {
"attribute_id": "0x0001",
"attribute_name": "app_version",
"value_type": [
"0x20",
"uint8_t",
"Analog"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 73
},
"0x0002": {
"attribute_id": "0x0002",
"attribute_name": "stack_version",
"value_type": [
"0x20",
"uint8_t",
"Analog"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 0
},
"0x0003": {
"attribute_id": "0x0003",
"attribute_name": "hw_version",
"value_type": [
"0x20",
"uint8_t",
"Analog"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 1
},
"0x0004": {
"attribute_id": "0x0004",
"attribute_name": "manufacturer",
"value_type": [
"0x42",
"CharacterString",
"Discrete"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": "_TZE204_4fblxpma"
},
"0x0005": {
"attribute_id": "0x0005",
"attribute_name": "model",
"value_type": [
"0x42",
"CharacterString",
"Discrete"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": "TS0601"
},
"0x0006": {
"attribute_id": "0x0006",
"attribute_name": "date_code",
"value_type": [
"0x42",
"CharacterString",
"Discrete"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": ""
},
"0x0007": {
"attribute_id": "0x0007",
"attribute_name": "power_source",
"value_type": [
"0x30",
"enum8",
"Discrete"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 3
},
"0xffde": {
"attribute_id": "0xffde",
"attribute_name": "65502",
"value_type": [
"0x20",
"uint8_t",
"Analog"
],
"access": "READ|WRITE|REPORT",
"access_acl": 7,
"attribute_value": 13
},
"0xffe2": {
"attribute_id": "0xffe2",
"attribute_name": "65506",
"value_type": [
"0x20",
"uint8_t",
"Analog"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 56
},
"0xffe3": {
"attribute_id": "0xffe3",
"attribute_name": "65507",
"value_type": [
"0x48",
"Array",
"Discrete"
],
"access": "READ|REPORT",
"access_acl": 5
},
"0xfffd": {
"attribute_id": "0xfffd",
"attribute_name": "cluster_revision",
"value_type": [
"0x21",
"uint16_t",
"Analog"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 2
},
"0xfffe": {
"attribute_id": "0xfffe",
"attribute_name": "reporting_status",
"value_type": [
"0x30",
"enum8",
"Discrete"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 0
}
},
"commands_received": {},
"commands_generated": {}
},
"0x0001": {
"cluster_id": "0x0001",
"title": "Power Configuration",
"name": "power",
"attributes": {},
"commands_received": {},
"commands_generated": {}
},
"0x0004": {
"cluster_id": "0x0004",
"title": "Groups",
"name": "groups",
"attributes": {
"0x0000": {
"attribute_id": "0x0000",
"attribute_name": "name_support",
"value_type": [
"0x18",
"bitmap8",
"Discrete"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 0
},
"0xfffd": {
"attribute_id": "0xfffd",
"attribute_name": "cluster_revision",
"value_type": [
"0x21",
"uint16_t",
"Analog"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 2
}
},
"commands_received": {},
"commands_generated": {}
},
"0x0005": {
"cluster_id": "0x0005",
"title": "Scenes",
"name": "scenes",
"attributes": {
"0x0000": {
"attribute_id": "0x0000",
"attribute_name": "count",
"value_type": [
"0x20",
"uint8_t",
"Analog"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 0
},
"0x0001": {
"attribute_id": "0x0001",
"attribute_name": "current_scene",
"value_type": [
"0x20",
"uint8_t",
"Analog"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 0
},
"0x0002": {
"attribute_id": "0x0002",
"attribute_name": "current_group",
"value_type": [
"0x21",
"uint16_t",
"Analog"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 0
},
"0x0003": {
"attribute_id": "0x0003",
"attribute_name": "scene_valid",
"value_type": [
"0x10",
"Bool",
"Discrete"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 0
},
"0x0004": {
"attribute_id": "0x0004",
"attribute_name": "name_support",
"value_type": [
"0x18",
"bitmap8",
"Discrete"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 0
},
"0xfffd": {
"attribute_id": "0xfffd",
"attribute_name": "cluster_revision",
"value_type": [
"0x21",
"uint16_t",
"Analog"
],
"access": "READ|REPORT",
"access_acl": 5,
"attribute_value": 2
}
},
"commands_received": {},
"commands_generated": {}
},
"0x0006": {
"cluster_id": "0x0006",
"title": "On/Off",
"name": "on_off",
"attributes": {},
"commands_received": {},
"commands_generated": {}
},
"0x0702": {
"cluster_id": "0x0702",
"title": "TuyaValveWaterConsumed",
"name": "smartenergy_metering",
"attributes": {},
"commands_received": {},
"commands_generated": {}
},
"0xef00": {
"cluster_id": "0xef00",
"title": "Tuya Manufacturer Specific",
"name": "tuya_manufacturer",
"attributes": {
"0x0000": {
"attribute_id": "0x0000",
"attribute_name": "0",
"value_type": [
"0x20",
"uint8_t",
"Analog"
],
"access": "READ|REPORT",
"access_acl": 5
}
},
"commands_received": {},
"commands_generated": {}
}
},
"out_clusters": {
"0x000a": {
"cluster_id": "0x000a",
"title": "Time",
"name": "time",
"attributes": {
"0xfffd": {
"attribute_id": "0xfffd",
"attribute_name": "cluster_revision",
"value_type": [
"0x21",
"uint16_t",
"Analog"
],
"access": "READ",
"access_acl": 1,
"attribute_value": 1
}
},
"commands_received": {},
"commands_generated": {}
},
"0x0019": {
"cluster_id": "0x0019",
"title": "Ota",
"name": "ota",
"attributes": {
"0x0000": {
"attribute_id": "0x0000",
"attribute_name": "upgrade_server_id",
"value_type": [
"0xf0",
"EUI64",
"Discrete"
],
"access": "READ",
"access_acl": 1,
"attribute_value": [
255,
255,
255,
255,
255,
255,
255,
255
]
},
"0x0001": {
"attribute_id": "0x0001",
"attribute_name": "file_offset",
"value_type": [
"0x23",
"uint32_t",
"Analog"
],
"access": "READ",
"access_acl": 1,
"attribute_value": 4294967295
},
"0x0002": {
"attribute_id": "0x0002",
"attribute_name": "current_file_version",
"value_type": [
"0x23",
"uint32_t",
"Analog"
],
"access": "READ",
"access_acl": 1,
"attribute_value": 73
},
"0x0003": {
"attribute_id": "0x0003",
"attribute_name": "current_zigbee_stack_version",
"value_type": [
"0x21",
"uint16_t",
"Analog"
],
"access": "READ",
"access_acl": 1,
"attribute_value": 2
},
"0x0004": {
"attribute_id": "0x0004",
"attribute_name": "downloaded_file_version",
"value_type": [
"0x23",
"uint32_t",
"Analog"
],
"access": "READ",
"access_acl": 1,
"attribute_value": 4294967295
},
"0x0005": {
"attribute_id": "0x0005",
"attribute_name": "downloaded_zigbee_stack_version",
"value_type": [
"0x21",
"uint16_t",
"Analog"
],
"access": "READ",
"access_acl": 1,
"attribute_value": 65535
},
"0x0006": {
"attribute_id": "0x0006",
"attribute_name": "image_upgrade_status",
"value_type": [
"0x30",
"enum8",
"Discrete"
],
"access": "READ",
"access_acl": 1,
"attribute_value": 0
},
"0x0007": {
"attribute_id": "0x0007",
"attribute_name": "manufacturer_id",
"value_type": [
"0x21",
"uint16_t",
"Analog"
],
"access": "READ",
"access_acl": 1,
"attribute_value": 4417
},
"0x0008": {
"attribute_id": "0x0008",
"attribute_name": "image_type_id",
"value_type": [
"0x21",
"uint16_t",
"Analog"
],
"access": "READ",
"access_acl": 1,
"attribute_value": 65535
},
"0x0009": {
"attribute_id": "0x0009",
"attribute_name": "minimum_block_req_delay",
"value_type": [
"0x21",
"uint16_t",
"Analog"
],
"access": "READ",
"access_acl": 1,
"attribute_value": 0
},
"0xfffd": {
"attribute_id": "0xfffd",
"attribute_name": "cluster_revision",
"value_type": [
"0x21",
"uint16_t",
"Analog"
],
"access": "READ",
"access_acl": 1,
"attribute_value": 3
}
},
"commands_received": {},
"commands_generated": {}
}
}
}
]
}