Local Tuya - Control Tuya devices locally (Fork from localtuya)

This would be nice to have but very hard to answer i would say, looking forward to hear more

Well that was awkward… Turned out to be just needing a power reset on the tuya device…

I started using localtuya a few months ago. But I am confused about the “local” of it…
After a month my tuya IOT api trial expired and my devices stopped working in HA…
After renewing the trial it worked again. So how can I prevent this from happening in a few months again when the extended trail expires?
What is making this “local”?

I really don’t know about upstream localtuya whether it has issue that causing it to crash if cloud failed. as far as I know localtuya shouldn’t stop working only cloud features to stops, Tho I can’t be so sure your case api expires never happened to me. localtuya has no interactions with cloud at all other then get devices data.

I haven’t tested BLE Devices I only tested ZigBee, but this might due to your curtain has an issues updating to the gateway or the gateway updates is slow, If Smart Life APP updated and localtuya didn’t this is something else.

I have this mentioned in 1st the post.


This from my understanding and tests.
The major difference Is probably localtuya work as HUB mean all devices can be managed from one account or entry and Tuya Local works as Device
Integrations type

More details

localtuya Core is built-in pytuya but it also uses TinyTuya codes as references.
Tuya Local Core is TinyTuya which is an amazing and active project.


localtuya is fully customizable and easier to manage devices through UI.
Tuya Local Has a hundreds of yaml files that contains Tuya Devices data loads with Home Assistant don't know if this is heavy on HA,
But This is two-edged sword in some scenarios you might need to change a values on device config file but the affect will apply after HA restart and changes won’t survive integration updates, but this also the key feature of Tuya Local.


Because localtuya works as HUB it can be easier to relay on cloud and to get devices data to help add device steps and supports discovery, localtuya has built with HA in mind so it’s more friendly to Home Assistant at least after I started to understand how pytuya works.


Tuya Local is slow when it comes to send multi commands like script or automation I don’t know what’s the specific reason for this but I remember the dev mentioned something for stability commands has delay between each other.
^ For me I didn't like this because the speed difference between running the same script that turn off all switches and close my curtain was really obvious compare to localtuya speed.

This is an example as you can see, this happen when I send commands to the same device quickly. for example If I turn off my light then turn it on quickly ON command has delay.

Same test for localtuya

Again this is my using experience, whatever anyone use as long it works fine i think this is good enough.

2 Likes

Thanks for keeping localtuya going like this, that is why I love this community!

I do have one Tuya device I am struggiling to get on HA, I have an EG4 solar heat pump/ac that I found could connect with Tuya. It works good in the smart life app but have no idea how to get this over to HA in any fashion.

In fact my UniFi setup thinks it’s a lightbulb! Any help or a point in the right direction would be greatly appreciated.

I checked both the gateway and the tent: they are up to date. the awning does not respond to commands. How can we verify the functioning and thus improve the fork?

I might misunderstood your issue.
If it only the commands that are slow and states updates normally, Is this issue also happen if you control your curtain through smart life app or only on localtuya ?

If you mean states not update or updates slow

What I mean by update not the firmware.
If there an action happened to your curtain update Your curtain should reports to your gateway new states like position, open or close.
So my guess either your device is slow on reports or the gateway reports to localtuya is slow. however to make sure. Starts Smart Life on your phone then use the remote to control your curtain. at the same time check the states of your curtain on smart life.
If the states updated on smart life and not updated on localtuya this an integration issue, but if smart life also slow at update this probably gateway or curtain issue.


@tylas13

Maybe try testing the integrations and if there is an issues or error post it.
If already have Tuya account everything should works easy for you : )

sorry, my first message was wrong or imprecise. I have to test the functionality better and more calmly. Thank you

Sorry I missed that! This is a good explanation, thank you! I only have one Tuya device, a ceiling fan. (I couldn’t find a fan with the combination of features I wanted without Tuya, unfortunately.)

I avoid Tuya by rule. I used to have a bunch of Tuya-based Wifi plugs that we just unreliable because of internet and/or cloud issues. (I replaced them all with Z-Wave ones, and wish I had used Zigbee instead, but that’s a different subject.) This project probably would have been a good fit then, if I had known about it!

hi, I’m migrating all my devices to LocalTuya. I can’t see and configure 2 BW-LT11 LEDs.

Can you show me your entry diagnostics
check the chat if you want to send it there.

bw_lt11 devices can be inserted manually using data obtained from iot with firmware 3.1

You’re the man @umu_ugg!!
Lack of support for Protocol Version 3.5 is exactly the problem I had identified, googled it, found this thread, installed your fork – et voila!
All devices found and working.
Many thanks for this!!

Thx for this Fork, seems to work fine, thou i couldn’t find a “step by step” instructions howto “merge” with “upstream” , so what i did was

  1. installed the integration
  2. Restarted and verified in Devices/Integrations that it had “Changed Owner” :slight_smile:
  3. Deleted the “old” Integration in HACS, Kept Settings ! Restarted ( Scaring , as nothing worked then ! )
  4. Re-downloaded this Fork, and everything worked Great again !

Seems like i even got rid of alot Errors in my Log, the “old” was spewing constantly , so for about a year ago i changed Logging to “Critical” for LocalTuya , now i’ve changed it back to Default :+1:

1 Like

I don’t know how well the merging from upstream to the fork will still work, at least for everyone’s cases :eyes: Thanks for pointing that out
What I did to test the merging before is 1. Delete the integration from HACS ignore the message HACS popup 2. I installed the fork 3. Restart HA.

2 Likes

Yeah i was afraid i would loose all my Devices, ( been a year since ive been into tuya.iot, hope i have the password somewhere :slight_smile:
Anyways i tried what i thought was the “safe” way :slight_smile:

Would be nice to be able to control Tuya devices over Cloud

Does anyone know if this fixes the bug in localtuya that prevents devices with non-alphanumeric characters in their local key being registered? I’m snookered with a Tuya thermostat which doesn’t display correct values using the Tuya integration and won’t register with the localtuya integration because of the (newly introduced) non-alpha local keys.

1 Like