Tuya/SmartLife Plugin

User avatar
racarter
Posts: 499
Joined: Sat Jun 18, 2016 4:23 am
Location: North Yorkshire, UK
Contact:

Tuya/SmartLife Plugin

Post by racarter »

I just uploaded a plugin for monitoring and control of Tuya/SmartLife wifi devices. It currently supports wifi temperature/humidity sensors and wifi smart plugs.

You'll need the Tuya app on your phone (with your devices added) and a Tuya developer account to use this. The Tuya developer environment is huge and a bit scary, but I found a video which should help. Follow the instructions in the video to link your Tuya phone app to your developer account so that the plugin can see your devices in the cloud.

https://www.youtube.com/watch?v=qVZJyHJsF9A

Devices must be manually created in Indigo; you'll need the virtual ID for each device (available on the app or in your developer account).
User avatar
matt (support)
Site Admin
Posts: 21458
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: Tuya/SmartLife Plugin

Post by matt (support) »

Great, thanks for another plugin contribution!
Image
MarcoGT
Posts: 1115
Joined: Thu Sep 11, 2014 1:06 pm
Location: Germany

Re: Tuya/SmartLife Plugin

Post by MarcoGT »

Which is the temp Sensor?
This one? GUUTOP 3 Stück Tuya Smart Wireless Temperatur, Hygrometer Indoor WiFi Room Temperatur-Luftfeuchtigkeitssensor mit App-Aufzeichnung, funktioniert Alexa, Google Home https://amzn.eu/d/c5SPC63

Thanks
User avatar
racarter
Posts: 499
Joined: Sat Jun 18, 2016 4:23 am
Location: North Yorkshire, UK
Contact:

Re: Tuya/SmartLife Plugin

Post by racarter »

Any wifi temp/humidity sensor compatible with Tuya/SmartLife should work.
User avatar
racarter
Posts: 499
Joined: Sat Jun 18, 2016 4:23 am
Location: North Yorkshire, UK
Contact:

Re: Tuya/SmartLife Plugin

Post by racarter »

New version now in plugin store. Supports Tuya/SmartLife bulb on/off and brightness adjustments. Colour settings coming soon.
User avatar
racarter
Posts: 499
Joined: Sat Jun 18, 2016 4:23 am
Location: North Yorkshire, UK
Contact:

Re: Tuya/SmartLife Plugin

Post by racarter »

New release supports mm wave presence detectors, smart IR transmitters and bulb colour settings.
freshwuzhere
Posts: 105
Joined: Thu Apr 05, 2012 2:52 pm

Re: Tuya/SmartLife Plugin

Post by freshwuzhere »

Hi,

I had started writing a tuya plugin when I saw yours! Thanks! It appears to work OK for what I need ( turning on and off on a schedule).

I am running version 2022.8.1 with indigo 2022.2.2 on a Mac mini. NOTE just upgraded to your plugin 2022.9.0 and still getting same error although info message string has more data like lat and long. {'code': 'colour_data', 'value': '{"h":328.0,"s":178.0,"v":255.0}'}.

Device I am running are rgby string lights I bought from Costco (don't have the name). They work fine on the tuya app - except the wifi reception seems a bit weak - but it generally is effective when driven from tuya,

I keep getting these error messages on both string lights - which seem to fetch up the color settings.
___________________________________________________
Tuya Device states for Bulb String Lights 10.0.0.22
Tuya {'result': [{'code': 'switch_led', 'value': True}, {'code': 'work_mode', 'value': 'scene2'}, {'code': 'bright_value', 'value': 255}, {'code': 'temp_value', 'value': 32}, {'code': 'colour_data', 'value': '{"h":328.0,"s":178.0,"v":255.0}'}], 'success': True, 't': 123456789123456, 'tid': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'}
Error updateStateOnServer() caught exception: LowLevelBadParameterError -- device value type for state key brightnessLevel must be integer
___________________________________________________
I obfuscated the ID etc.

Seems the HSV values as floats isn't as expected? Anyway - no problem at my end because on and off work fine and that is all I need - if I need colors - I'll use the tuya app.

Thanks for saving me the trouble of writing!

Ian
User avatar
racarter
Posts: 499
Joined: Sat Jun 18, 2016 4:23 am
Location: North Yorkshire, UK
Contact:

Re: Tuya/SmartLife Plugin

Post by racarter »

The string lights seemingly don’t return quite the same data as the colour bulbs which the plugin supports. Ideally the string lights should be given their own device type.

If you could use the Tuya developer website to query the device properties and the instruction set and PM me the details I could add a new device type. (Unfortunately there’s no way I can access that information without either buying the same lights or accessing your account. )
freshwuzhere
Posts: 105
Joined: Thu Apr 05, 2012 2:52 pm

Re: Tuya/SmartLife Plugin

Post by freshwuzhere »

Did you get this information? I have the same error clogging up my logs - I can get the data for you or I have the Tinytuya package running on my Mac and run anything you like there too.
freshwuzhere
Posts: 105
Joined: Thu Apr 05, 2012 2:52 pm

Re: Tuya/SmartLife Plugin

Post by freshwuzhere »

Ohh and error says

updateStateOnServer() caught exception: LowLevelBadParameterError -- device value type for state key brightnessLevel must be integer

Version 2022.10.0

Indigo 2023.2

Thanks
MarcoGT
Posts: 1115
Joined: Thu Sep 11, 2014 1:06 pm
Location: Germany

Re: Tuya/SmartLife Plugin

Post by MarcoGT »

Same Problem here
User avatar
racarter
Posts: 499
Joined: Sat Jun 18, 2016 4:23 am
Location: North Yorkshire, UK
Contact:

Re: Tuya/SmartLife Plugin

Post by racarter »

I just got your DM. Are you doing anything to the device when you get the error message? If not, try the update in the Plugin Store.
freshwuzhere
Posts: 105
Joined: Thu Apr 05, 2012 2:52 pm

Re: Tuya/SmartLife Plugin

Post by freshwuzhere »

I get one of those error messages every 20 seconds for each string light device……

It’s in the log so it can be ignored fairly easily……..
freshwuzhere
Posts: 105
Joined: Thu Apr 05, 2012 2:52 pm

Re: Tuya/SmartLife Plugin

Post by freshwuzhere »

MarcoGT wrote:Same Problem here

HI Marco,

My errors have disappeared - have yours? I went to the developer website and looked at a couple of devices - I don't know if that had anything to do with it?
Post Reply

Return to “racarter's plugins”