It’s weird how it works though.
I can use it through their app(turn on/off).
I have no idea how it gets past my router to do this.
I don’t have UPNP on, I don’t have any ports forwarded to it, but if I’m out and about, it works from my cell phone.
Wondering if any engineers can look at that and at least explain to me how this thing bypasses firewalls.
Ideally, I’d like to be able to CURL to this like with the TPLink plugs.
Your firewall blocks incoming connections but not outgoing connections. The device creates an outgoing connection to the Tuya servers (e.g. like loading a web page) and your phone connects to these same servers and the servers relay the commands sent from your phone to the device.
Becuase the device initiates the connection the firewall does not block it.
This is how almost all IoT devices like this works.
Given this, I doubt there is a way to directly connect to your device. And a brief look at the API shows this is true. Your curl command would go to the Tuya’s servers and they will be relayed back to your plug.
As a consequence, these plugs are only controllable when you have Internet access.
Edit: I’ve fixed my openhab wrapper to work with ver 2 of tuyapi. https://github.com/unparagoned/njsTuya . Here it is for reference, it has the scripts, rules, and items for reference.
I am having openhab2 up and running and bought few tuya smart plugs, which are working well with smart life app. but I a not able to integrate it with openhab2.
I had referred above GIT repo also, but it will throw authentication error while installing Tuya/cli.
can you please share brief steps how to integrate it with Openhab?