Making Tuya local

I have a number of Tuya-based devices that I want to make local. I’ve installed the LocalTuya integration, ran through the necessary steps to get the device keys and ids, and added a couple of smart plugs. Everything seems to be working fine. Once I get all my devices configured through the LocalTuya, do I just remove all of my devices from the SmartHome app? Is that it? Anything else I need/should do? Thanks.

Negative, you should leave all of them in Smartlife app - if you remove them, you will also loose your localkeys and they won’t be recognised in localtuya anymore.
Localtuya only makes it possible not using official Tuya integration and cloud connection anymore.

Oh interesting. I assumed LocalTuya just communicated directly with the device’s local API and the key/id were specific to each device. So if it still requires the device to phone home, how exactly is this “local”?

Well, localtuya is communicating directly (no need to open Smartlife app anymore), but if you remove devices from Smartlife you also “cancel” their localkey, so they won’t work with localtuya anymore… at least that’s what happened to me, when I removed devices from the app :).

I’d like to jump into this discussion because I can see it is only 11 hours old.

I’d like to ask @fender4645 if you did anything with regards to blocking internet access or blocking DNS requests?

I had this integration working fine, but one day (after Nov 2020) it went offline, so I tried everything to bring it back. I resorted to starting again, deleting the integration, restarting HA, and adding back the integration (and going through all the steps to get the local key and device id via iot.tuya.com), but the entity is still showing unavailable.

I was hoping that with your recent experience of getting it working, you might know something that I’m not aware of.

I don’t want to hijack your post, but if you got any info it’ll be appreciated. My post is here for reference: LocalTuya entity is showing as unavailable - Third party integrations - Home Assistant Community (home-assistant.io)

Which version of localtuya are you using? If possible, revert back to 3.1.0 and check, if that works… for me it worked OK until 3.1.0, but with 3.2.0 update things got messy and some plugs unavailable…

1 Like

I’m using protocol v. 3.3 (is that what you’re referring to?). I’ve only configured one smart plug w/ energy monitoring and it seems to be working fine. I created a template sensor for the wattage and it’s showing up fine.

I actually didn’t think about blocking outbound calls. Are you saying I should try that?

No, sorry, I was replying to wizz, as he said, his integration stopped working mid November.
For Tuya internet blocking, this might help.

Indeed, this sorted the issue. Thank you. I tried to read up a little and it seems the localtuya integration fails to perform a connection/reconnect of some kind. People have said that at the end of their start up they’ve managed to call the localtuya.reload service using an automation. I’m happy with using 3.1.0 for now until they fix the problem in 3.2.0

PS @fender4645 - sorry for hijacking your thread.

Did you find out why localtuya.reload does not work, I have just installed the latest release and still the same?

Hi, an update for you all -

I just had a look at my integrations, and I am still running LocalTuya v3.1.0 I believe, so everything still works fine with this version, however I have noticed that there have been 2 releases since the 3.2.0 version that broke it, and the latest v3.2.2 mentions that it has introduced periodic connection retries, so that sounds positive, although I haven’t tried it yet.

For the time being I’m happy to be behind the curve on 3.1.0 until something ground breaking is updated or a concerning vulnerability is discovered, and then I’d consider upgrading.

EDIT: I’ve read the commit notes for v3.2.2 and the periodic connection retries that the latest version speaks of are explicitly there to fix and address the problems previously reported (that we were experiencing with the dropped devices, and calling the localtuya.reload service being the workaround), so it looks like this is a good version to move to. I’ll probably upgrade LocalTuya and test it out this week.