Hi @ygerlovin , thank you for your efforts in making an Edge driver!
These two commands are reading a set of attributes in single commands, matching exactly the way that Tuya Zigbee gateway does it. Mimicking the Tuya initialization sequence is the key point to successfully initialize the TS004F device in Scene control mode.
The same lines of code for Hubitat look this way :
cmd += zigbee.readAttribute(0x0000, [0x0004, 0x000, 0x0001, 0x0005, 0x0007, 0xfffe], [:], delay=200) // Cluster: Basic, attributes: Man.name, ZLC ver, App ver, Model Id, Power Source, Unknown 0xfffe
cmd += zigbee.readAttribute(0x0006, 0x8004, [:], delay=50) // success / 0x00
cmd += zigbee.readAttribute(0xE001, 0xD011, [:], delay=50) // Unsupported attribute (0x86)
cmd += zigbee.readAttribute(0x0001, [0x0020, 0x0021], [:], delay=50) // Battery voltage + Battery Percentage Remaining
cmd += zigbee.writeAttribute(0x0006, 0x8004, 0x30, 0x01, [:], delay=50) // switch into Scene Mode !
cmd += zigbee.readAttribute(0x0006, 0x8004, [:], delay=50)
It is important to send the readAttribute commands for the Basic and Power clusters at once. Sending individual readAttribute commands for each attribute didn’t work.
This attribute is actually not used in the driver logic any further, but reading it is required for the successful initialization of the device.
It is also important to send the initialization sequence quickly, hence the very aggressive low-value delays between the readAttributes commands.
Good luck, I am eager to test the Edge driver!