If anyone wants to play with some experimental code for LOCAL control of RGBW Tuya lights then here is your chance.
- You must already be running the cloud driver from this thread, this driver does not work standalone.
- Download the LIBRARY code here: https://raw.githubusercontent.com/bradsjm/hubitat-drivers/master/Tuya/Local/TuyaProtocolLibrary.groovy
- Download the DRIVER code here: https://raw.githubusercontent.com/bradsjm/hubitat-drivers/master/Tuya/Local/TuyaLocalRgbLight.groovy
- Find the RGBW Tuya child device you wish to make local and change the driver from the Hubitat "Generic Component RGBW" to this driver "Tuya Local RGBW Light" and click save.
- In the driver configuration you MUST enter the IP address of the light device, the driver is unable to scan for it (due to the well known limitations of Hubitat broadcast UDP protocol support)
That's it, once you enter and save the IP address the driver will start sending and receiving updates locally using the cloud as a backup method if sending directly fails. For me, round trip command and response are under 400ms which isn't exactly speedy but the protocol has a lot of overhead (encryption of packets, use of JSON etc.) and it means it will work even if you lose internet connection or Tuya cloud does a wobbly.
You can return to full cloud again by changing the driver back to "Generic Component RGBW"
REMEMBER - This is experimental code, also, it is using Hubitat raw sockets which itself is described in the documentation as "is in alpha status" so caveat emptor. I've implemented retries in the driver because the reliability of the connection to the device is questionable and I do not know if thats due to the Tuya device or the Hubitat raw socket implementation. Probably need to get a packet sniffer to find out what is really going on.