-
Notifications
You must be signed in to change notification settings - Fork 60
Description
Device Information
- Manufacturer: SONOFF | Model: TRVZB | Firmware: 0x00001401
- Integration: ZHA
Problem
OnOff cluster commands (switch.turn_on/turn_off) timeout with error:
Failed to send request: device did not respond
Yet the device works:
- ✅ Command executes (state changes correctly)
- ✅ Device sends attribute reports confirming state
- ✅ Subsequent commands work normally
- ❌ API returns 500 error
Impact: Only affects switch entity. Climate entity (climate.set_hvac_mode) works perfectly.
Root Cause
Device violates ZCL spec on OnOff cluster (0x0006):
- Receives command with
disable_default_response=0(expects response) - Executes command successfully
- Sends attribute report with wrong TSN instead of command response
- ZHA times out waiting for correct response
Evidence
Command sent (TSN=31):
[zigpy.zcl] [0x7A92:1:0x0006] Sending request header: ZCLHeader(
disable_default_response=0, tsn=31, command_id=0
)
Device response (~1.3s later):
[zigpy.zcl] [0x7A92:1:0x0006] Received command 0x0A (TSN 14): Report_Attributes(...)
[zigpy.zcl] [0x7A92:1:0x0006] Attribute report received: on_off=<Bool.false: 0>
Issue: Response TSN=14 ≠ Command TSN=31. Attribute report, not command response.
How Zigbee2MQTT Avoids This
Z2M doesn't expose switch entity—only climate entity using system_mode:
{"system_mode": "off"} // Instead of switch.turn_off
{"system_mode": "heat"} // Instead of switch.turn_onWorks because Thermostat cluster uses attribute writes (not commands). No timeout issues reported.
Reference: Z2M TRVZB Docs
Proposed Solutions
Option 1: Fix with Quirk
Add quirk using disable_default_response=True:
Pros: Maintains multi-entity approach, backward compatible
Cons: More complex, relies on non-standard behavior
Option 2: Hide Switch Entity (Like Z2M)
Don't expose OnOff cluster in ZHA device configuration.
Pros: Simple, proven, no quirk needed
Cons: Breaking change, less flexible
Workaround
Use climate entity instead of switch.
Device Signature
Endpoint 1 (Profile 0x0104, DevType 0x0301):
Input: 0x0000 (Basic), 0x0001 (Power), 0x0006 (OnOff ←), 0x0201 (Thermostat)