Also had this problem, was driving me insane so started using LocalTuya and it worked a treat with instant switch states.
Like you, not familar with this whole terminal thing and really struggled to get my localKey. So I found a way to do it with Windows (see no reason it should not work for Mac?), Android and the Smart Life app. Suspect there may be versions of the Tuya app that work as well but I never tested this.
Here are the steps I took to get my localKey:
Download an Andorid emulator, I used LDPlayer
Within the emulator, use play store to download a file explorer which allows root access, I used Solid Explorer
Login to your newly downloaded Smart Life v3.6.1 app as normal so you can see your Tuya devices and activate a couple.
Go back to home screen and load the Solid Explorer app or your choosen file explorer app for Android (you will have enable root access before the next step)
From Root, goto ‘data > data > com.tuya.smartlife > shared_pref’. Within this folder will be a file called preferences_glbal_keyeu123456789123ABCFGD.xml (the later part of the file name after keyeu is random).
In this file you will find your localKey, you can copy this out into a text editor in windows and do a search for localKey.
I made my garage door working with this one “rospogrigio/localtuya”. Took a little while to understand what are the values to put during setup. Incase anyone is looking for:
I have selected switch from the dropdown list for my garage door opener(assuming you have your devide id and key, and came to the part where it asks for different values). I have just selected 1 in the ID field and leave rest blank. I can see the switch state changes almost immediately and not using cloud anymore. Cheers.
But still struggling with a light.
Hi,
I am also struggling with getting lights to work. issue is to get the ‘API secret from tuya’ - Virtual id is simple as its in the app. I still am not sure how to get the ’ API secret from tuya’.
I tried the solution given by @Swoosh but no luck as Tuya app given in his link doesn’t display the information anymore.
Edit - I was able to get the API Keys but I get the below error in LocalTuya (Initially yesterday Night the devices were visible in the dropdown - not sure what happened overnight as I never made any changes)
I am a complete newbie to home automation. I bought an Alexa and several tuya(Smartlife) switches from Amazon. Most of the switches are working fine… but one of them is not keeping it’s state when toggled. I select it using the Smart Life app… the switch turns on. A second or two later the state in the software returns to off… but the switch itself stays on. I hit the button again, and the switch state in the software shows on for a second or two and the switches itself goes to off. So the switch itself is toggling… but the state isn’t being held correctly.
How does a newbie Alexa users fix this?
Thanks in advance for your patience with a newbie.
Mark