Zigbee send Tuya 'magic spell' to unlock devices when pairing (#18144)

This commit is contained in:
s-hadinger 2023-03-09 22:34:32 +02:00 committed by GitHub
parent 513b0fece1
commit d7d23c7b9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
- Support for multiple MCP23008 as switch/button/relay
- Support for multiple PCF8574 as switch/button/relay
- Extended Tariff command for forced tariff (#18080)
- Zigbee send Tuya 'magic spell' to unlock devices when pairing
### Breaking Changed
- Shelly Pro 4PM using standard MCP23xxx driver and needs one time Auto-Configuration

View File

@ -1395,15 +1395,21 @@ void Z_SendSimpleDescReq(uint16_t shortaddr, uint16_t groupaddr, uint16_t cluste
// Iterate among
//
void Z_SendDeviceInfoRequest(uint16_t shortaddr) {
ZCLFrame zcl(4); // message is 4 bytes
ZCLFrame zcl(12); // message is 12 bytes
zcl.shortaddr = shortaddr;
zcl.cluster = 0;
zcl.cluster = 0x0000;
zcl.cmd = ZCL_READ_ATTRIBUTES;
zcl.clusterSpecific = false;
zcl.needResponse = true;
zcl.direct = false; // discover route
zcl.payload.add16(0x0005);
zcl.payload.add16(0x0004);
// Tuya needs a magic spell reading more attributes
// cf https://github.com/zigpy/zha-device-handlers/issues/2042
zcl.payload.add16(0x0000); // Manufacturer Name
zcl.payload.add16(0x0001); // Application Version
zcl.payload.add16(0x0007); // Power Source
zcl.payload.add16(0xfffe); // Unknown
zigbeeZCLSendCmd(zcl);
}