TUYA component - local_key

If the homeassistant API at Tuya could be extended to include local_key when performing device discovery, code available at https://github.com/sean6541/tuya-homeassistant could be enhanced and utilized to allow Tuya devices to be controlled locally (instead of only through the cloud). This would allow MUCH faster response times and, due to the vast number of Tuya devices available world wide, would drastically increase the accessibility of Tuya devices and reduce the cost of entry for Home Automaters everywhere.

+1 for me. Would also mean (some of) my data remains mine and doesn’t go to some server likely to be hacked…

I’m fairly certain the individual switches and plugs report back whenever the are toggled locally as well. The Tuya Smart app is able to activate the relay locally so if Tuya intends to collect usage data and their own app uses local control, then it must.

While preventing undesired data sharing is a potential (though highly unlikely) side effect of allowing for local control, the real purpose and benefit is not to circumvent the desires of the manufacturer but to make the products MORE useful (with much faster response times and the ability to work when offline) to Home Assistant users.

nope, I just tested and disabled internet access for my switch. I then went to HA to turn it off, and instead of turning off it reported unavailable state on HA (nothing happened on the switch itself)

Right. That’s exactly the problem that having local_key would solve.

+1 here also.

Yes. It would be great if we can control the switch locally, without internet. It is faster and safer.

The HA component was authored by @huangyupeng. Based on the way the code works, they either work for Tuya, or they have a closer relationship with Tuya than most people do.

While this component was a HUGE step in the right direction, it’s not enough to make us able to fill our homes with Tuya devices that integrate flawlessly with the rest of our setup. It’s unfortunate, because the hardware is actually quite good in most cases. But, the software just isn’t there.

There are some people reverse engineering the protocol and working on this. Most likely, any additional gains will come from them.

agreed, unfortunately @huangyupeng hasn’t been on the forum since august :sleepy:

hmm. I am having huge delay with official tuya component. With local_key component, it is fast but I have problem with automation: it reboots the switch automatically or something once couldn’t update the status. The first switch led is green instead of blue/red as usually…

I wanted to download the custom component. But unfortunately it’s gone. Can anybode share it?

2 Likes

Any success with this? I just picked up some switches that run on the Tuya cloud and would love a local option without having to flash them.

Didn’t had much time yet. Worked on it one night, but didn’t got it to work.

Bummer but thank you for the response. Would be very interested in making use of this if it pans out.

is there still any active development on this?
This would change everything for me with tuya products! +1 here!

better off flashing other firmware on the Tuya devices as soon as you open the box.
Plus, with the new OTA flashing, no need to disassemble the device.

1 Like

I guess I need to test flashing my bulbs

Interesting, You have some how to?

I just came here to post exactly about that! Just finished flashing all my bulbs ota and dam I’m happy!! Almost lost one soldering!
Amazing work from this community!!

Can you post a link to a how to for the ota flash?