Pushover WAY too slow?

Does anyone (DCJAY, Knolleary?) know why PUSHOVER is so SLOW?

I have my Raspberry Pi 4 setup, and Amazon Polly - Node-Red talks to Polly (exec node) and when one of 2 doors (my office or the front door) opens, she responds immediately, so nothing wrong there. In the same flow I have the Node-Red-contrib-pushover (0.2.0) node sending a pushover alert to my phone (Android 11 Xiaomi Note 10) on WiFi in my house... Unlike Polly it seems to take anything between a reasonable couple of seconds to sound the alarm on the phone - to an utterly useless 15 minutes, and I'm using priority 1 which I assumed meant urgent....

Used to detect a burglar, they could have gone home and started breakfast by the time I get worse case alarns...

Am I missing something?

msg.payload=msg.payload+global.get("handyDate")
msg.priority=1;
msg.sound="tugboat";
return msg;

H Pete. Sorry but I don’t use it. You may be able to find something in their terms of service, but it wouldn’t surprise me that there are no guarantees for a cheap/free service apart from a best can do.

1 Like

Anything you'd recommend that works? when my pals message me on Facebook messenger I get alerts pretty much straight away.. so something from NR sending a PM to Facebook would do I guess ?? I only included your name as I say something about maintainers for the node... :slight_smile:

'Priority 1' doesn't make the push message travel faster, it just describes how your phone responds to the message.
For example, Priority -1 will not generate any sound or vibration, but will still generate a popup/scrolling notification, whilst Priority 2 will give a loud audible alert, and continue until you've acknowledged it.

I've found it super fast, no delay whatsoever...

Telegram is almost instantaneous and you can send sounds, pictures, markdown, questions etc.

1 Like

Thanks Steve... Telegram (as a non-Telegram user) looks a lot more involved to set up but ye I'll give that a go, thanks.

node-red-contrib-telegrambot has over 30 examples ready for import...

and the readme is extensive.

then there is always us guys when you get stuck.

I wont lie, it is a bit more difficult but thats due to capabilities and flexibility - but once you have it going, it is not to difficult and it "just works"

You are in for a ride once you discover the bot capabilities, they are vast and extremely useful as it allows for 2-way interaction.

Well I made a start - created a bot - and user... my account is there and when I made the bot I got the key. So I filled both into the NR SENDER node and sent HELLO to that from an inject - nothing - clearly I don;t quite understand this yet.

Hi Steve, I'd welcome help in getting started. I created a bot - and a user as it requested - and it gave me an API key. I assumed in tthe simplest case I had to fire some text into a SENDER node (from for example an INJECt node). I did that, nothing happened - no errors - just nothing. Should that have worked?

Did you set the chat id?

Give me 5 mins & I'll post a working demo for you.

I've setup a generic flow that saves your chat id in flow context (though you don't need to store it there once you have your chat id - you can hard code it in the function node)

The way this demo works: Send /setup to your chat and the bot will intercept the message, store the chat ID then you can press the injects to send a message any time...

Flow...

[{"id":"b3f037c4ec8c4553","type":"telegram command","z":"6c2cb5231a8080e7","name":"/setup","command":"/setup","description":"","registercommand":false,"language":"","bot":"fa7a9376.321ce","strict":false,"hasresponse":false,"useregex":false,"removeregexcommand":false,"outputs":1,"x":270,"y":180,"wires":[["15efa9a65441eee0"]]},{"id":"15efa9a65441eee0","type":"change","z":"6c2cb5231a8080e7","name":"save chatId","rules":[{"t":"set","p":"chatId","pt":"flow","to":"payload.chatId","tot":"msg"},{"t":"set","p":"chatId","pt":"msg","to":"payload.chatId","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":180,"wires":[["4eb6f521ca3b440a"]]},{"id":"265dead2b376b173","type":"inject","z":"6c2cb5231a8080e7","name":"","props":[{"p":"chatId","v":"chatId","vt":"flow"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Your heating is off","payloadType":"str","x":330,"y":300,"wires":[["ee79361b7ca25a1a"]]},{"id":"ca7e59b37107dcf8","type":"telegram sender","z":"6c2cb5231a8080e7","name":"","bot":"fa7a9376.321ce","haserroroutput":false,"outputs":1,"x":970,"y":300,"wires":[[]]},{"id":"ee79361b7ca25a1a","type":"function","z":"6c2cb5231a8080e7","name":"send markdown","func":"// prepare message content\nvar content =\n  `\n*System message...*\n\n_${msg.payload}_\n\n*server time...*\n\\`${new Date().toString()}\\`\n\n`;\n\n// prepare telegram\nmsg.payload = { \n  chatId: msg.chatId, \n  type: 'message', \n  content: content \n};\n\n// activate markdown\nmsg.payload.options = {\n  disable_web_page_preview: true,\n  parse_mode: \"Markdown\"\n};\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":520,"y":300,"wires":[["ca7e59b37107dcf8"]],"info":"## New message\n\nHello *markdown* formatted messages!'\n\nwith `inline` code\n\n> and quote\n>> nested\n\n\\`\\`\\`\nvar code = \"cool\";\n\\`\\`\\`\n\n| table | data |\n|---|---|\n| 1 | fred |\n| 2 | bob |\n\n_Italic_ **bold** "},{"id":"517e109eb7d6a9df","type":"function","z":"6c2cb5231a8080e7","name":"prep msg with image","func":"\nvar imgBase64 = msg.payload;\nvar pos = imgBase64.indexOf(\"base64,\");\nimgBase64 = imgBase64.substr(pos + 7);\nvar imgData = Buffer.from(imgBase64, \"base64\");\n\nmsg.payload = {\n  content: imgData,\n  caption: `An Image for you`,\n  type: 'photo',\n  chatId: msg.chatId \n}\nmsg.payload.options = { parse_mode: \"Markdown\" };\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":360,"wires":[["ca7e59b37107dcf8"]],"info":"## New message\n\nHello *markdown* formatted messages!'\n\nwith `inline` code\n\n> and quote\n>> nested\n\n\\`\\`\\`\nvar code = \"cool\";\n\\`\\`\\`\n\n| table | data |\n|---|---|\n| 1 | fred |\n| 2 | bob |\n\n_Italic_ **bold** "},{"id":"d4d893e0ba4251e0","type":"inject","z":"6c2cb5231a8080e7","name":"send an image","props":[{"p":"payload"},{"p":"chatId","v":"chatId","vt":"flow"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wc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g+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==","payloadType":"str","x":320,"y":360,"wires":[["517e109eb7d6a9df"]]},{"id":"b4ab1552a8920265","type":"inject","z":"6c2cb5231a8080e7","name":"","props":[{"p":"chatId","v":"chatId","vt":"flow"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Person detected in garden","payloadType":"str","x":290,"y":240,"wires":[["4bfd3e7453d7b94b"]]},{"id":"4bfd3e7453d7b94b","type":"function","z":"6c2cb5231a8080e7","name":"send message","func":"var content = msg.payload;\n\nmsg.payload = { \n  chatId: msg.chatId, \n  type: 'message', \n  content: msg.payload \n};\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":520,"y":240,"wires":[["ca7e59b37107dcf8"]],"info":"## New message\n\nHello *markdown* formatted messages!'\n\nwith `inline` code\n\n> and quote\n>> nested\n\n\\`\\`\\`\nvar code = \"cool\";\n\\`\\`\\`\n\n| table | data |\n|---|---|\n| 1 | fred |\n| 2 | bob |\n\n_Italic_ **bold** "},{"id":"8bfd14800c0d3708","type":"http request","z":"6c2cb5231a8080e7","name":"","method":"GET","ret":"bin","paytoqs":"ignore","url":"https://picsum.photos/200/300","tls":"","persist":false,"proxy":"","authType":"","x":610,"y":420,"wires":[["f4170678b5812dab"]]},{"id":"f4170678b5812dab","type":"function","z":"6c2cb5231a8080e7","name":"send picture","func":"msg.payload = {\n  content: msg.payload,\n  caption: `A random image`,\n  type : 'photo',\n  chatId: msg.chatId,\n}\nmsg.payload.options = { parse_mode : \"Markdown\" };\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":420,"wires":[["ca7e59b37107dcf8"]]},{"id":"49fdf0a64632d40d","type":"inject","z":"6c2cb5231a8080e7","name":"send random image from internet","props":[{"p":"payload"},{"p":"chatId","v":"chatId","vt":"flow"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":370,"y":420,"wires":[["8bfd14800c0d3708"]]},{"id":"4eb6f521ca3b440a","type":"function","z":"6c2cb5231a8080e7","name":"send message","func":"var content = \"Your chatId has been set - messages should now be sent to this chat\"\n\nmsg.payload = { \n  chatId: msg.chatId, \n  type: 'message', \n  content: content\n};\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":700,"y":180,"wires":[["ca7e59b37107dcf8","290de46f5c5e8734"]],"info":"## New message\n\nHello *markdown* formatted messages!'\n\nwith `inline` code\n\n> and quote\n>> nested\n\n\\`\\`\\`\nvar code = \"cool\";\n\\`\\`\\`\n\n| table | data |\n|---|---|\n| 1 | fred |\n| 2 | bob |\n\n_Italic_ **bold** "},{"id":"290de46f5c5e8734","type":"debug","z":"6c2cb5231a8080e7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1000,"y":180,"wires":[]},{"id":"fa7a9376.321ce","type":"telegram bot","botname":"my bot","usernames":"","chatids":"","baseapiurl":"","updatemode":"polling","pollinterval":"","usesocks":false,"sockshost":"","socksport":"","socksusername":"","sockspassword":"","bothost":"","botpath":"","localbotport":"","publicbotport":"","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false}]

PS: Don't forget your select your BOT in the telegram nodes after importing


Result...

1 Like

Hi Pete,

I'd agree with Steve that Telegram has one of the best and easiest (and reliable) bot frameworks. Facebook and WhatsApp are fairly horrid to work with.

Worst delays I get on Telegram are no more than a few seconds and that might even be down to my Node-RED flows since everything passes through MQTT and I use Telegram in polling mode. You can use it in a push mode as well which I imagine is faster but that requires an inbound connection from the Telegram servers which the polling mode doesn't. Most messages get through pretty much instantaneously.

Nice setup example @Steve-Mcl.
Even I managed to get it working :+1:

Reading the docs, it say's;

  • disable_notification ( bool , optional) – Sends the message silently. Users will receive a notification with no sound.

But I still get notification sounds when I set the msg config as;

msg.payload = { 
  chatId: my chat ID,
  type: 'message', 
  content: msg.payload,
  disable_notification: true
};
return msg;

Try putting it in the options Paul.

Look in the markdown function for how to set the options.

(Untested)

1 Like

Yes, that's it.
Thanks

Well I'm still not getting this - am I missing out a stage? I mistakenly used "psbot" as I thought I'd created that - with username @petesbot. Turns out it's called @petesbot. So I copied your flow into my node-red where I'd installed node-red-conrtib-telegrambot - put @petesbot into into the bot-name section, went to the botfather (if that sounds like I know what I'm doing, I don't), requested a token, got it (long token - starts with 50 ends with ha) and put that into the token field....

Both SETUP and TELEGRAM SENDER said "connected and hit that first INJECT - nothing new happened.. I then updted TELEGRAM and rebooted my RPI - Now I'm getting "connected" , "polling" and bried "polling error" and over in the debug area... see image below..

I must be utterly missing the point of Telegram... help. My APP isn't seeing anything from @petesbot

Did you type /setup in the telegram chat as I described and showed?...

Prob would make no diff, but I went to install Pushover on a new install and I noticed
image

so I'm going to install the 0.1.1 node-red-node-pushover one maintained by Nick and Dave

I used the 0.1.1 version - thats the one that;s sending messages sometimes instantly - sometimes far to late to be of any use.