Tuya local

Use Debian 10 instead of Ubuntu. It’s fully supported by HA and you’ll get a healthy state with all the conveniences coming with it.

PS. Don’t use HA’s Tuya Inegration when using Local Tuya to avoid potential conflicts.

1 Like

Thanks. Debian all set up and npm installed etc. Went through the tuya wizard and retrieved the device ids etc.
Just working on installing hacs etc etc.

I’ll see how it goes with this localtuya.
On my other vm I have customtuya which isn’t all that bad tbh
Thanks!

Great got in.

What is the local key for each device?

Update: got it from the cli wizard, Thanks

image

Not 100% clear what I’m supposed to choose for ID (1 true or false(0)). Current state leave blank?

Woww but instant update on HA after switching on/off for the first device added!

1 Like

I was wondering the same thing. I’ve got some Eva Logik switches configured through Tuya/Smart Life and am looking at setting up the Local Tuya in case the web interface is removed from support as well as to ensure automation operability during internet outages.

I’ve acquired the id/key ok and set up a local tuya configuration. I can turn the switch off and on ok; however, the state is not held in HA – i.e. if I flip the switch on the Smart Life integration shows “on” in HA. When I try it using the local tuya config it “flashes” on, turns the light on, but then shows off in HA even though light is still on.

Did you remove the Tuya Integration which comes with HA before adding Tuya Local? You should not have both integrations installed on your HA.

1 Like

I do still have the Tuya Integration. I have it working now. I am seeing entity id options 1 and 7. I was only adding one of the two entity id options. I think one is the state and the other is the switch action. Once I added both of them, then I could toggle the switch and the state would be captured as expected under the “local” integration.

I’ll look at removing the standard Tuya as there’s no longer a need for me to have it with the local working. Out of curiosity, what problem(s) are caused by having both? I saw the notes about not having “tuya” included with the naming any of the local items and didn’t do that.

Adding floodlight as what type of device?

Got a new Tuya Floodlight with motion detector (product ID p34tkhljhjgfr5vl). I figured out the DP IDs you see below. Now I just don’t know how I should add this to localTuya. What type of entity should I add? I can use the light entity but then I don’t have the motion part. Or is this not doable through the wizard and do I need to add this to the configuration.yaml file?

And if I add this to the configuration.yaml, do I need to move all my lights that are currently in use through LocalTuya, also to the configuration.yaml?

DP ID App item Tuya code Tuya Type Tuya Value
20 on/off switch_led Boolean {true,false}
21 (not found) work_mode Enum {“range”:[“white”,“colour”]}
22 brightness bright_value Integer {“min”:10,“max”:1000,“scale”:0,“step”:1}
23 colorwarmth temp_value Integer {“min”:0,“max”:1000,“scale”:0,“step”:1}
control_data String {“maxlen”:255}
51 Manual / Sensor operated device_mode Enum {“range”:[“auto”,“manual”]}
53 Sensitivity Light sensor cds Enum {“range”:[“2000lux”,“300lux”,“50lux”,“10lux”,“5lux”,“now”]}
54 Motion detection range pir_sensitivity Enum {“range”:[“low”,“middle”,“high”]}
55 Duration light after detection pir_delay Integer {“unit”:“s”,“min”:5,“max”:3600,“scale”:0,“step”:1}
56 PIR sensor on / off switch_pir Boolean {true,false}
58 Duration light dimmed standby_time Integer {“unit”:“min”,“min”:1,“max”:480,“scale”:0,“step”:1}
59 Brightness dimmed standby_bright Integer {“min”:0,“max”:1000,“scale”:0,“step”:1}

Hi , May have been answered before , But i have HA running in a docker container.
Local Tuya working ok , the Local Tuya entity within HA is none responsive.
Questions, 1) do i have to open any ports to allow communication between Local Tuya and the Device. 2) any issues running Local Tuya and the normal (cloud based) tuya integration at the same time… Reason for this question , new device listed on both integrations but only working on Normal Tuya Integration. Could be related to question 1

Thanks in advance
LeeB

I would say you should add the light as usual, then unmark the text that says something like “Don’t add more entities”, and then go on and add binary sensor for PIR and motion.

When doing that, I can see some values but they can only be on/off. For example the range will then be on or off, instead of low / middle / high. When using other type of devices I can’t change this either. Is there a different way to do this?

Ref. Local Key.
I have read 3 different ways to get local keys. To the best of my understanding Tuya has updated their side of the software and now we cannot get anymore the local keys. Did I miss something? I wrote to Tuya asking for an official way to obtain these local keys or if this functionality is not supported anymore. If the functionality is not supported anymore I shall return products and not purchase any of Tuya products. Concept for Tuya. Remove functionality loose customers.

1 Like

Out of curiousity I did just give it a try:

Getting the device id’s and local keys following this guide is actually still working.

If you run ‘tuya-cli wizard’ if shows all of the local keys. Once all the setup is done, npm/nodejs etc from the guide posted.
Works great. I add a new device the other day. Showed up on my iot.tuya account and then ran tuya-cli wizard again to grab the local key.

1 Like

I set this up a while ago using tuya-cli wizard and about a month or 2 ago received an email from tuya basically saying my free developer account was closing unless I wanted to pay. I didn’t read it completely because I didn’t plan on getting any more tuya devices so I didn’t care.
Low and behold I bought 2 more tuya led’s for my kids. I ran the tuya-cli wizard anyways even though they closed my account, it worked no problems and now have my kids lights connected to HA.
Thanks to all for the work to create and set this up.

They don’t close the account, they switch you to a very basic account. Enough for most of our needs tho. Had the same email and now I’m good to go for another year for free.

appreciate all information received. with the inf. and encouragement I have been able to get the local keys.
with ‘tuya-cli wizard’ method I get: There was an issue fetching that device. Make sure your account is linked and the ID is correct.
while with the ‘Get device details’ web interface I get local key.

Thanks for the inf. I was able to get the local keys.

1 Like

It’s a struggle but you can get there in the end. I had to spin up a new debían vm, install npm nodejs and all the bits to get the tuya wizard to work. Well worth it though.

Hello all:
Im trying to configure a tuya compatible LED module using tuya local. for now i can control the on/off but cant control the rgb functions, im not sure if you have found a solution for this?