[BETA] Tuya Cloud Driver (Limited device support)

Any advice on how to recover from this?
I think I'm seeing the same "No permissions. Your subscription to cloud development plan has expired"

Same here. Only signed up to Tuya a few weeks ago. Lost all control

You neet to do a renewal of the trail for another 6 months.
I spent like 30min searching around the ui for the option, its purposely difficult :wink:

I'll try an post late the path

Thanks, look forward to seeing the way to do it.... tried earlier and got lost!!
EDIT: just noticed the solution is in post 385 [BETA] Tuya Cloud Driver (Limited device support) - #385 by rgr

1 Like

Is there any method to send a custom payload to a device? I've used TinyTuya to figure out how to change the scenes on my off brand floor lamps RGBIC - they use DPS 51 and each "scene" has a custom payload that is base64 encoded... if I use python I can send the payload on the 51 endpoint and it works - but since the cloud driver only recognizes on/off/status for my lamps - how can I send the scene payload values? Any options there?

The cloud API doesn't really use the DPS system, that is for local communication. I tried using a local only driver but found it was not that reliable for status updates, possibly because I have Alexa directly connected to SmartLife for this one LED Strip I have. If you have all connections go through the hub a local only driver would probably work good.

Anyway, I ended up keeping this cloud setup but found the author has a few example child drivers that you can drop in, which enable local communication for any device you switch to it. I made some modifications to it as well which I posted in a Gist, linked here: Discussion of local control of Tuya Smart Wifi devices without flashing firmware. Feel free to reply back on that thread if you have any questions about the local control or how to get your device to work.

There is also these drivers from @holand.ivar which are standalone local drivers: hubitatappndevice/Device/tuyaDevices at master · ivarho/hubitatappndevice · GitHub . He has a few posts on the forums in various places.

Since a lot of the Tuya devices are slightly different you will probably end up having to change a lot of the code to get everything to work right, but all the communication stuff is in there which gets the hard part out of the way.

3 Likes

Wow!!! What a game changer. I was setting up virtual buttons in Hubitat so they could be seen in Google Home and Hubitat Dashboard. Then I would set up a Google Home automation trigger to control the Tuya device effectively mirroring the virtual button and the Tuya device. It worked but was a bit cumbersome. This makes things a lot easier. Thanks for all your hard work.

I have two groups that show up that aren't in the app and I can't delete, any advice on how to remove them? Test Group and Kitchen Group are the names. Removing from Hubitat simply has them re-add at some point automatically.

Next, I can't get local control on these at all...

I tried a tap scene, and that didn't work in Hubitat either.

Here's the info on one of the down lights:

category: dj
functions: {"switch_led":{"type":"Boolean"},"work_mode":{"range":["white","colour","scene","music"],"type":"Enum"},"bright_value_v2":{"min":10,"max":1000,"scale":0,"step":1,"type":"Integer"},"temp_value_v2":{"min":0,"max":1000,"scale":0,"step":1,"type":"Integer"},"colour_data_v2":{"h":{"min":0,"scale":0,"unit":"","max":360,"step":1},"s":{"min":0,"scale":0,"unit":"","max":1000,"step":1},"v":{"min":0,"scale":0,"unit":"","max":1000,"step":1},"type":"Json"},"scene_data_v2":{"scene_num":{"min":1,"scale":0,"max":8,"step":1},"scene_units":{"unit_change_mode":{"range":["static","jump","gradient"]},"unit_switch_duration":{"min":0,"scale":0,"max":100,"step":1},"unit_gradient_duration":{"min":0,"scale":0,"max":100,"step":1},"bright":{"min":0,"scale":0,"max":1000,"step":1},"temperature":{"min":0,"scale":0,"max":1000,"step":1},"h":{"min":0,"scale":0,"unit":"","max":360,"step":1},"s":{"min":0,"scale":0,"unit":"","max":1000,"step":1},"v":{"min":0,"scale":0,"unit":"","max":1000,"step":1}},"type":"Json"},"countdown_1":{"min":0,"max":86400,"scale":0,"step":1,"type":"Integer"},"music_data":{"change_mode":{"range":["direct","gradient"]},"bright":{"min":0,"scale":0,"unit":"","max":1000,"step":1},"temperature":{"min":0,"scale":0,"unit":"","max":1000,"step":1},"h":{"min":0,"scale":0,"unit":"","max":360,"step":1},"s":{"min":0,"scale":0,"unit":"","max":255,"step":1},"v":{"min":0,"scale":0,"unit":"","max":255,"step":1},"type":"Json"},"control_data":{"change_mode":{"range":["direct","gradient"]},"bright":{"min":0,"scale":0,"unit":"","max":1000,"step":1},"temperature":{"min":0,"scale":0,"unit":"","max":1000,"step":1},"h":{"min":0,"scale":0,"unit":"","max":360,"step":1},"s":{"min":0,"scale":0,"unit":"","max":255,"step":1},"v":{"min":0,"scale":0,"unit":"","max":255,"step":1},"type":"Json"},"rhythm_mode":{"maxlen":255,"type":"Raw"},"sleep_mode":{"maxlen":255,"type":"Raw"},"wakeup_mode":{"maxlen":255,"type":"Raw"},"power_memory":{"type":"Raw"},"do_not_disturb":{"type":"Boolean"},"cycle_timing":{"type":"Raw"},"random_timing":{"type":"Raw"}}
id: eb2ee45e49537a2a12lo3a
local_key: 4bf55f0c52f6a989
online: true
product_id: kswkji1mtwf52ear
statusSet: {"switch_led":{"type":"Boolean"},"work_mode":{"range":["white","colour","scene","music"],"type":"Enum"},"bright_value_v2":{"min":10,"max":1000,"scale":0,"step":1,"type":"Integer"},"temp_value_v2":{"min":0,"max":1000,"scale":0,"step":1,"type":"Integer"},"colour_data_v2":{"h":{"min":0,"scale":0,"unit":"","max":360,"step":1},"s":{"min":0,"scale":0,"unit":"","max":1000,"step":1},"v":{"min":0,"scale":0,"unit":"","max":1000,"step":1},"type":"Json"},"scene_data_v2":{"scene_num":{"min":1,"scale":0,"max":8,"step":1},"scene_units":{"unit_change_mode":{"range":["static","jump","gradient"]},"unit_switch_duration":{"min":0,"scale":0,"max":100,"step":1},"unit_gradient_duration":{"min":0,"scale":0,"max":100,"step":1},"bright":{"min":0,"scale":0,"max":1000,"step":1},"temperature":{"min":0,"scale":0,"max":1000,"step":1},"h":{"min":0,"scale":0,"unit":"","max":360,"step":1},"s":{"min":0,"scale":0,"unit":"","max":1000,"step":1},"v":{"min":0,"scale":0,"unit":"","max":1000,"step":1}},"type":"Json"},"countdown_1":{"min":0,"max":86400,"scale":0,"step":1,"type":"Integer"},"music_data":{"change_mode":{"range":["direct","gradient"]},"bright":{"min":0,"scale":0,"unit":"","max":1000,"step":1},"temperature":{"min":0,"scale":0,"unit":"","max":1000,"step":1},"h":{"min":0,"scale":0,"unit":"","max":360,"step":1},"s":{"min":0,"scale":0,"unit":"","max":255,"step":1},"v":{"min":0,"scale":0,"unit":"","max":255,"step":1},"type":"Json"},"control_data":{"change_mode":{"range":["direct","gradient"]},"bright":{"min":0,"scale":0,"unit":"","max":1000,"step":1},"temperature":{"min":0,"scale":0,"unit":"","max":1000,"step":1},"h":{"min":0,"scale":0,"unit":"","max":360,"step":1},"s":{"min":0,"scale":0,"unit":"","max":255,"step":1},"v":{"min":0,"scale":0,"unit":"","max":255,"step":1},"type":"Json"},"rhythm_mode":{"maxlen":"255","type":"Raw"},"sleep_mode":{"maxlen":"255","type":"Raw"},"wakeup_mode":{"maxlen":"255","type":"Raw"},"power_memory":{"type":"Raw"},"do_not_disturb":{"type":"Boolean"},"cycle_timing":{"type":"Raw"},"random_timing":{"type":"Raw"}}

Here's the log from default generic rgbw driver on then off, followed by an on/off with the Tuya Local RGBW Light driver. Says it get's the ack, but nothing happens.

Hi,

I am not able to activate the scene in tuya from hubitat.

I am able to see the scene getting detected in hubitat as switch but when i perform any activity it doesnt get recognised by tuya or it doesnt update any status in hubitat.

Regards,
Sundar

This is the error screenshot.

Well this is amazing. Thank you so much. It definitely opens up a lot more home automation possibilities. It would be great if HE made this native but I get its not that simple and the idea is to be self sufficient in the HE environment so it would be better if Tuya made everything Zigbee. But either way @jonathanb this is an awesome middle ground to help the process. The only hiccup I had and its probably written in here somewhere was to add my smartlife app authorization to the developer account.. I will be going this way when I use tuya devices. I have tazmotized many befor but this is way simpler

thanks again

I found a bug in the driver for scene triggering, I've just pushed an update to fix it (hopefully)

@jonathanb - Just noticed this in hub logs and wanted to report it:

dev:73 12023-01-22 08:28:10.588 PM error java.lang.NullPointerException: Cannot invoke method updateDataValue() on null object on line 966 (method parse)
dev:731 2023-01-22 08:28:10.581 PM debug Tuya online [time:1674437286]

FWIW it seems like my Tuya plugs are working fine from what I can tell

Will this support Lumary as well (which is owned by Tuya)? I downloaded all 3 apps (Tuya, Smart Life, and Lumary), and they all look the same. They all have the same ability to scan the QR code from the Tuya developer app (the process looks exactly the same from each one of those apps). As soon as I scan the QR code with the Lumary app, the code immediately says it's expired from the developer app (no error or OK from the Lumary app), but no devices show in the developer app. They were bought as Lumary devices, and all work great there. I have integration between SmartThings and Harmony that works fine, but I am trying to get rid of SmartThings now. If I have to set them up as Tuya devices I think I can, but they all have to be reset and removed from the Lumary app and then added to the Tuya app. If possible, I'd like to keep using the Lumary app.

Actually, the Lumary app does ask me to confirm the login, and I do, but then nothing happens on the mobile app, the developer app says the code has expired, and no devices end up showing in the developer app.

Tuya I believe supplies the hardware chips and premade app, and somewhere in the process gets branded for their brand, so yes the app is basically the same. You have to delete the brand specific app (Lumary in this case), and setup the devices using the Smart Life or Tuya apps for this integration to work.

1 Like

Hi, I try to install the thing and I m stucked... on step #4 I added the url as custom repository, but in the next step : creating virtual device with the above driver... I just cant figure out what to do... I cannot find how to create device from a driver, the driver is not listed in my drivers...not either inside the new virtual device dropdown list... I just want to be sure I m doing the right thing! I m new to hubitat so not aware of anything!
Thanks!

If you only added the custom repository in HPM, you will then need to search for it in HPM and install it before it will be listed as a driver in the drop down.

yes but I m looking for it and the only place its listed ites in the settings where I added it as custom repository... I cant find any place where to install it! Sorry about that, very new to He...Also when I hit match all drivers in the HPM it shows Refreshed Jonathan Bradshaw so not sure if its not showed in the drivers of not installed? should be installed since its listed there?

Ok, I finally found it... In the install section I made a search for tuya and I found the driver ... sorry! thanks for your help!

I have questions on it, because when I create the device, in the settings it tell error and 0 devices... So my vaccuum robot is not listed there and I m not sure why (error with credentials or something or error because the device is not compatible?) Also, in my tuya account api there s no device there too...
Another thing, the goal of doing this is to be able to get the robot to communicate with my hub. For now, my hub or alexa can trigger scene so I have created a lot of scene for each mode and can control it with virtual motion sensor... But I wish to be able to tell the hub lets say when the battery life is below or above a specified level. The smart life app can only send a notification with a scene when the battery hit the specified level... So I though that this driver could directly send the status to the hub, am I right?
Thanks, and sorry for all those questions!