Tuya local for dummies

Hi folks,

Every time when I start googling for din-rail devices with wifi, I always come across nice looking devices from Tuya. A few examples:

But it is completely not clear if it is possible to control these devices locally, without using the Tuya cloud platform. It seems that recent Tuya firmware updates now make it impossible to flash Tasmoto on them. Moreover not all Tuya devices/features are supported by Tasmoto firmware. So that is not my cup of tea.

I see that HomeAssistant users have localtuya, but not sure if that is also some kind of hack or not.

Would be nice if somebody could enlighten me. Can I somehow control such devices locally from Node-RED without cloud solutions, without hacks that could be become useless in the future?

Thanks!!
Bart

1 Like

If you want to use locally (and likely via MQTT) then check the zigbee2mqtt supported-devices page

And if it has zigbee but is not listed, then you can also add support

If you want to be future proofing, look for Matter and/or Thread devices (few and far between at the moment tho I'm afraid)

1 Like

Thanks for that Steve, interesting!

1 Like

And node-red has

Hey Steve,
Thanks for the links!

Yes I see that they have Zigbee versions of those devices, but I like them because they also offer WIFI. Which means I don't have to setup and maintain two wireless networks. But not sure if their wifi devices can also be controlled locally.

That node-red-contrib-tuya-local node is based on the tuyapi library, which show this on their readme page:

No clue how this can be local stuff...
And also not sure which devices it supports.

From the readme of

node tuya-socket that communicates with tuya devices directly on the local area network not using the cloud service. Note some devices use encryption some don't, if you see "data format engine" change the version 3.3 in the nodes dialog to 3.1 which encrypts only on send.

1 Like

If I'm reading correctly, these packages need Home Assistant and I don't wish to set it up for only Tuya connectivity as I've shunned HA so far. Is it possible to use the newer Tuya devices without HA at all?

That's not the conclusion I came to. There is an example of using one of the nodes with HA but I think that's all it is (I could be wrong as I have no tuya devices)

1 Like

Got a message from my co-worker. He says that it is some kind of hack, so not Tuya supported. And that in the past Tuya already has changed their protocol to try to prohibit it.

That is a pitty because that is no good foundation to build your house on...

Its a shame that these are not more easily hackable as the products look quite good.

I got some tuya Wi-Fi blinds motors (as they were cheap). Tried following various instructions to setup with local control but the web site didn't match the instructions and I never managed to get the required keys etc.

So I then went all in, and replaced the Wi-Fi module with an esp12f flashed with Tasmota. However I couldn't get full control as the built in MCU needed "something" sending to it to complete the setup, which would only be possible using the original tuya app.

In the end I just hard wired GPIOs from the ESP to the buttons to allow control over MQTT.

:disappointed_relieved:

1 Like

@smcgann99,
Thanks for sharing your experience! That is indeed what I was afraid of...

1 Like

Guess you could make your own - Like here

End of story for me and Tuya is no longer a candidate for anything in my realm.

Thanks, @BartButenaers

No idea if this is still valid. I haven't read it in depth so I also have no idea if connection to the Tuya Cloud is required but this explains some of this stuff
Tuya SDK for beginners: Intro to Tuya Cloud API - NotEnoughTech

I saw this and thought of you :smiley:

Din mount - Power monitoring and switching with ethernet and has some support in Tasmota not sure about firmwares, apparently it can also be used via DIY mode (HTTP requests)

Worth looking at this for more info - Sonoff SPM: 2560Amps! - NotEnoughTech

Hey @BartButenaers

Not sure if you are aware - but basically TUYA have evolved from running on just ESP chips (8266, ESP32 etc etc) and now run on a variety of chips (which is why there has been the difficulty in flashing them with the alternative firmware)

There are now a couple of projects out there that have broken through this barrier and support the majority of the 2nd and early 3rd generation repalcement chips that Tuya was running on.

Most of the projects rely on this project as their basis

This essentially permanently disconnects the device from the Tuya cloud and allows you to address it locally using any number of engines

Other projects build on this to enable alternative firmware to be loaded onto the cloud free chips - the best of which is

Which then provides a very familiar (Tasmota) like environment

ESPHome has also been ported to work on these

So do not despair ! It is currently like the early days with Tasmota in terms of having to wade through the differnet build processes etc - but they are all rapidly evolving.

Craig

3 Likes

Bart, I haven't used Tuya, but I have used Shelly devices. They now have a selection of DIN mounted relays etc as well as brick type relays (mount behind a light switch or Power point).
Connectivity is through WiFi with a lot of newer devices having BT as well. Those with PM in name include Power Monitoring.
The brick devices are easy configured to work through a web interface, cloud or independent of cloud. I have them set up to work using my MQTT server, and no cloud. I expect the DIN rail devices have similar interface but are more expensive then the brick devices.
Hope that is a help

Bart,

I have used Tasmota extensively on Tuya devices when they were ESP8266/32s. Eventually had to do a hardware flash. I believe that @btsimonh is working on a solution. Maybe he will chime in or you can reach out to him.

1 Like

Hello Bart :).

if the price is good enough to scrap it, order one, and see what it contains.
If BK7231 based, then OpenBeken is a good choice. The community around it is very active at the moment, and the maintainer is very responsive.
I have about 6 OpenBK devices, and was contributing regularly until my robot project distracted me (some brilliant stuff to come from that for Node-Red I/O on RPi)....
On OpenBK, the IR, SSDP, MQTT fixes, and general other stuff was mine....

Cloudcutter is a faff, but I don't think there is any indication of Tuya having closed the hole. I've not kept up with developments, but they were progressing towards some kind of auto-cracker. Worst come to the worst, you'll need to solder and extract the firmware. Once you have done that, you may as well flash them over serial. (may be easier than setting up cloudcutter - my RPi is still suffering from that experience).

as always, very best regards, Simon

1 Like

@btsimonh - Cloud Cutter seems to have gotten a lot better lately - i installed it to a Ubuntu VM and had it up and running and flashing devices OTA within about 20 minutes the other day

Its nice if you do not want to have to open up the device (or can't) in some cases

There are also a number of 3D printed devices out there - such as this one

  • to remove the need for soldering in most cases and just go straight to OpenBeken

Craig