What is a good way for sending messages between Node-Red and your smart phone also in case the smartphone is not connected to your LAN?

What is a good way for sending messages between Node-Red and your smart phone also in case the smartphone is not connected to your LAN ?

Extra requirements:

  1. Communication should be bi-directional. So it should also be possible to send messages from your smartphone to node-red.
  2. those messages should not be lost in case the phone is offline, but they should be delivered once your phone is online again.
  3. It should also be possible to consult and send those messages from a browser or desktop app.
  4. basic usage should be free.
  5. You should not actively poll for messages on your smartphone - so you will get a kind of notification as soon as a message arrives.

I am especially interested in the node-red nodes your are using for this and the app(s) on your smartphone.

Currently I am using https://github.com/janvda/node-red-slack (this is version 0.1.2 of node-red-contrib-slack which I slightly modified to reduce logging and assure that the tokens are stored in the credentials file).

The problem with that node is that it still has issues see (https://github.com/yayadrian/node-red-slack/issues) and is based on the deprecated slack-client. Before trying to see if I can not improve this node I think it is first time to consider other alternatives / alternative nodes for this.

Slack itself is fine for me (as we are using the tool also at work) but for the other members of my family it might be a bit too much to ask them to install the slack app on their smartphone and explain them the workings of slack.

So maybe telegram is a good alternative ? If so which nodes I can best use ?
Are the telegram nodes of http://red-bot.io/ a good idea ?

Thanks already for sharing any experience.
Jan.

Lots of examples to get you started too.

Garry

2 Likes

Yes, I agree. Telegram uses secured connections so avoids most of the Internet security issues you would otherwise have to deal with. It is also possibly the easiest of the secure messaging services to write bot's for. I also doesn't have the message limits that some services have. I regularly push hundreds of messages through it.

It lets you create several different types of interactions including slash commands, buttons and conversational interfaces. Audio, video and other media is also possible in both directions.

I think that there are 3 nodes that will talk to Telegram. The telegrambot one is the simplest I think. Chatbot is more complex but integrates Rivescript which is great for writing conversational interfaces. There is a separate Rivescript node that you can use with telegrambot if you like.

Red-bot = Chatbot - the author seems to use different names. The documentation has been somewhat lacking in the past as well - hopefully that has been resolved now.

The downside of it is that it adds gazillions of nodes to your palette.

1 Like

Thanks to @totallyinformation for putting me on to Telegram in previous posts. I use it regularly for communication between NR and my mobile phone, tablet, and laptop. Setup instructions seemed a bit cryptic at first, probably because I didn't yet have a mental model of the system, but I sorted it out.

I have one issue that may not have a solution. My IP camera sends alerts to all my devices through the IFTTT bot, but the bot I built for NR cannot receive them. I think this is because Telegram does not allow bot-to-bot communication. I can see reasons for this and don't want to undermine their policy, but I wonder if anyone knows of a workaround.

Yup, very true! But if you've tried to build bots for other services, you quickly realise that Telegram is SOOOO much easier.

So how does the camera send alerts? Is it a custom link to IFTTT? Is it a REST or web trigger?

So could you connect the camera to Node-RED rather than IFTTT (which has the added advantage of potentially keeping the camera off the Internet and so protected from vulnerabilities).

I'll remember not to make a hobby of bot-building.

It's the Wyze camera. As far as I can tell, it talks only to their servers and has no public API. They provide a custom link to IFTTT, and I haven't been able to get past that.

All I can think of is using the Maker IFTTT applet but that will need to reach out to a public accessible URL taking you back to your original issues of security.

I would be tempted to create a small, dedicated Node.js service protected by NGINX acting as a reverse proxy qnd TLS end point. Keeping the Internet away from your Node-RED service. However, this is still complex of course.

Another possibility, if you don't mind some latency, would be to connect IFTTT to Google Docs. The camera triggers IFTTT which creates a new doc (or adds to a spreadsheet) that you monitor from Node-RED.

It looks like this thread is diverting from its original topic. (@drmibell) :slight_smile:

@janvda Sorry! I hate it when some guy hijacks a thread and sends it down a rabbit hole... My bad.

@TotallyInformation Thanks for the suggestions. I'll scratch my head some more and see whether IFTTT can do a trick that helps.

@drmibell no problem.

So far it seems that Telegram and using the node-red-contrib-telegrambot node is the preferred way to go.

1 Like

Another solution would be to use JOIN.
https://joinjoaomgcd.appspot.com/
Fully integrates with Tasker on Android and works with OSX, Windows and Chrome
More info here
https://joaoapps.com/join/node-red/

Hmm:

Receiving Pushes From Any Network

Because pushes will be sent using your computer’s direct IP this may not work every time because of your network conditions.

For example, if you’re away from home and want to send a message to a PC at home you would have to perform port forwarding on your router which may not be desirable.

The best way to get around this is by sending messages to a Join Chrome Extension or Windows 10 app on the same PC and then enabling Node-RED redirection in the settings.

I think I would want to know a fair bit more about the security before doing this. It may be fine but I can't immediately see any info on security and that always makes me a bit paranoid.

One way to increase security would be to have a 2nd Pi with NR that is connected to the Internet, secured with TLS (perhaps with NGINX) and only has an exposed URL end-point and the MQTT node installed. Run your actual system on a different instance of NR along with your broker on another Pi.

You can further increase security by configuring your router to only allow a connection from Cloudflare then using their additional security features (all free).

What about Pushbullet?

It is the first time I hear about Pushbullet. I just discovered there is also a Node-RED node (https://flows.nodered.org/node/node-red-node-pushbullet) for this.

Is there something you like about Pushbullet then I am happy to hear it ?

I used to use Pushbullet before Telegram but the clients were poor. They slow to a crawl if you send too many messages and you have to go through and manually keep deleting them. Not nice. I'm also not as sure about end-to-end security with Pushbullet. I think PB may also have some limits on free use? Not sure now.

Telegram is under active development, works well on all platforms, handles very large numbers of read and unread messages, doesn't require old messages to be deleted, is encrypted end-to-end, has a large developer community for bots, supports multi-media and multiple interaction types.

2 Likes

@TotallyInformation Julian I seem to recall that you did a blog about Telegram, can you share the url pls.
...just had a look at their website and the terminology is weird - botfather....
what happened to api keys etc?

Your memory is better than mine!

Looks like the info in that post is still current.

Some info on making Node-RED available across the Internet (incl. Telegram):

And there are some further example flows here:

https://flows.nodered.org/?term=telegram&num_pages=1

1 Like

Thanks, I'll check those out.
I'm currently using pushover, but inclined to follow your lead.

Why is that a downside?

Well, install it and then see :slight_smile:

Perhaps if you always use use the "filter nodes" box anyway, maybe you won't notice. Otherwise, I hope you like scrolling.

Also, if you are using it, you then have to choose which nodes to use when and why.