Instead of multiple back and forth posts on the Tuya thread, could try to get it working for you here. I am familiar with the driver code, I have made my own modifications to it in the past.
Looks like from your errors on the other thread it is having issues getting the correct code to send for the first state (I think on/off). Should be a pretty easy patch on the driver.
Can you provide the JSON string from the "functions" in the data at the bottom of the virtual device which is throwing those errors? Raw text copy/paste would be good, I can toss it into a JSON formatter so its more readable.
Other info for reference: