[RELEASE] Local tuya RGBW Bulb Driver

Hi,

I mean ie as in example, I was doing this in Edge, and tried on Chrome as well. Will try firefox later today.

I was cut/pasting the key from the command line output, but I'll clear the cache file and give it another pull.

I'll update once I get a chance to do this, thank you!

Tried in various browsers on various computers, all give me the same, modifying this string

FO4:l6$gE{+JHA even here isn't showing it right... F < 0 4 : l 6 > $ g E { + J H A

to

F$gE{+JHA

HA! I was able to escape it:

F<O4:l6>$gE{+JHA "F & l t ; O 4 : l 6 > $ g E { + J H A"

Now it works!

Aha, now I understand, then it makes more sense. This is a protection to prevent HTML injection, & l t ; is indeed the HTML way of dealing with less than (<). I wonder if I can do something with the driver to overcome this issue. Thanks for pointing this out, and good that you found a workaround.

1 Like

I think I have a fix for this issue in the latest updated driver, see: hubitatappndevice/Device/tuyaDevices/tuyaGenericBulbRGBW.groovy at master · ivarho/hubitatappndevice · GitHub

The fix seems to be to feed the escaped key back into the device settings.

// Update the setting in case < got replaced in the original input
device.updateSetting("localKey", [value: localKey.replaceAll('&lt;', '<'), type: "text"])

@holand.ivar FYI, there is something wrong with the lights/driver when the Configure Bulb Mode device setting is set to HSV (native Hubitat). It must be set to HSL for the light to work properly.

Background: (from memory) My lights stopped working in Jan. Well, one or two lights worked but not consistently, the others did not. I troubleshot everything: the phone app worked, the device ID/IP/keys were correct, changes to through the app showed in the device page, but there was no way to control the light (on/off or any control button on the device page, nor any existing rules). I know there was a lot more done to troubleshoot, but nothing worked, and I gave up. Fast forward many months later, I decided for kicks to change the Bulb Mode setting from HSV to HSL on a "broken" light, and it suddenly started working again!

Changed the setting on all lights, and the driver is working perfectly again! Something broke it in the Dec 2023/Jan 2024 driver updates. I suspect it had to do with the scene settings being added. I had been testing the scenes on the light that was set to HSL and the color controls on the ones set to HSV.

I had this issue when first setting up this driver. But my solution was to remove and readd the light into my account as many as time needed until I got a key that worked in the driver! :smiley:

I've found a problem in the Send Custom Data to Device command. It breaks if the data is somewhere between 106 and 132 characters.

Try setting the endpoint 25 to:

25464601011303e803e800000000464602000003e803e800000000464602003d03e803e8000000004646010154032003e8000000004646010140032003e800000000

It won't work at 132 characters. Then try, after having removed one more 26 character color:

25464601011303e803e800000000464602000003e803e800000000464602003d03e803e8000000004646010154032003e800000000

It works and the responses are not garbled.

The same with Set Effect. Trying to set it to 37 does not work. But it seems to be more restrictive. 29 and 39 also do not work. However, 28 works.

Is there any way to increase the string length that the driver can handle?