Remote access from Cloud NodeRED to Tuya Bridge

Hey there,
I have the following scenario:
I would like to implement smart home for my grandmother.

  1. From my home I connect the NodeRED in the cloud with the local Bridge. (how ?! :smiley: )
  2. I send the bridge to my granny and she connects the bridge using the Smart Life App, so she can share her local WiFi to the bridge.
  3. As soon as the bridge is in her WiFi, i immediately can connect from my Cloud NodeRED to the bridge and control her devices.

Basically what i'm thinking of is to use the 'remote function' that the mobile smartphone application (Hue/Tuya/SmartLife etc..) is using by user credentials. That would be the 'normal' way. In my case the smartphone is the cloud NodeRED.

How can this be done ? Please think of that scenario without using a RaspPi, if possible.

Best regards,
Marc

Welcome to the forums @its-Zeke

Sorry - But maybe simply what you want to do?

  • What do you mean by "local Bridge"
  • if you are sending A "Bridge" - what is that exactly?
  • What is a "remote function"?

And for the record - I have removed this out of Developing Nodes. - As I don't believe it's related (at this stage)

Hey Marcus,
thanks for your answer!
By local bridge i mean a common ZigBee Hub like Philips Hue or whatever Hub/Bridge is existing on the market. They usually implement a feature, that you can control your connected devices remotely. Meaning you can connect with your smartphone - not being in the same WiFi as the bridge is - to your home devices and light up a lamp or whatever!
This function i would like to have in NodeRED.
Yet i have only found bridge nodes, which i may use only when the NodeRED is in the same WiFi network as the bridge.

Hope that clears things out!

Best regards.

1 Like

Ok...

So if I understand correctly.

Environment

  • You [Remote Location]
  • Grandmother [Where Bridge Is]

Need

  • For your Node RED (or at least - one not at your Grandmothers home) to control said Bridge.

Processing......

Ok this is a complex setup, and one that needs to ensure security

I think you are going to need a proxy (Node RED at Grandmothers)
One thought that comes to mind is : zerotier (or the countless others)

Let me diagram.

NOTE: You could also use MQTT (but that may require opening up ports)
I think @TotallyInformation is quite good at these things and requirements

The idea here, is to create a private tunnel between the Node RED instances

Hope the above is a kick starter :grin:

Personally, I (and probably a lot of others on the forum) would encourage you to use MQTT brokers and Node-RED instances on both ends. Use MQTT messages to do both any control and any feedback. This is likely to be rather more robust than trying to do it over just websockets - though that would most likely work as well. A bit more to do the initial setup but once done, it is pretty much fire and forget.

One thing to remember about MQTT is that you can bridge two brokers together so each Node-RED need only talk to its local broker and you simply tell the brokers which topic hierarchies you want to replicate.

To make the network connection, you absolutely must use one of the tools such as Zerotier. I think that is likely the correct tool for this job as it creates a private network for you. You will find a recent thread where a setup using Zerotier was documented. You could, if you are familiar with setting them up securely, use a more traditional VPN but then you'd need to mess with firewall rules most likely. With Zerotier you shouldn't need to do that.

1 Like

2nd on MQTT.
I think I was going for the less troublesome some setup.

But with aedes (I know that is frowned up on sometimes) - is just as good for this need as something like mosquitto.

But yeah - MQTT :+1:

Ha, not just sometimes! :slight_smile:

Only because it is a HIMARS to break open a molehill. It is really resource hungry and really not needed when Mosquitto is simple to install and configure and is even more robust to run than Node-RED itself but it is really efficient in its resource use.

1 Like

I don't think aedes will do topic bridging for you.

1 Like

If you would have Node-RED instances on both ends, would it no be safe enough if you use a MQTT service of some kind with the security options they do provide? Like HiveMQ or similar? Or would it be recommended to use use Zerotier as well?

Or isn't this a case for FlowFuse Cloud? Besides the monthly cost...

1 Like

Thank you all for your feedback and discussions!
@krambriw Ye, i am currently using FlowFuse as well, but yet i was communicating between both, the Cloud and the local NodeRED 'somewhere else' over http requests. But as soon as i implement new functions, i need to adapt the local NodeRED, thus i need to access the wifi of the local NodeRED again, which is sometimes not possible, because my granny lives somewhere else.
The edge developing of FlowFuse would be the thing, but quiet expensive imo. Especially when you have multiple devices. At the end of the day i guess the edge developing thingy is nothing else than MQTT ?

For normal "run time" I personally would consider a MQTT cloud service as I mentioned. All your grannys (if you have several) could have their own Node-RED instance that communicates sensor data to your "admin" instance. Commands could be sent "down" from your your "admin" instance by just addressing the proper topic. I once tested to stream video via public MQTT cloud service and it worked surprisingly well, I would say "good enough to make a live visit" to check things are ok. Or could also just send snapshots initiated by commands. Just be sure, if you have a payed plan, not to stream high resolution live video too much, check the eventual costs first

From security point of view, you do not have to open any ports in yours or your grannys firewalls to use a public MQTT cloud service

Now the next use case; you need to maintain the local Node-RED flows as well. Well, this will require you to have a possibility to "reach out" to each and every grannys local computer. VNC, Teamviewer, etc or if you like and have the patience to install & set it up, a local VPN server at each grannys location. Or FlowFuse, budget dependent...and depending on how many grannys to support