Get an alert on my iphone

337 views
Skip to first unread message

Toshi Bass

unread,
Feb 16, 2016, 10:09:53 AM2/16/16
to Node-RED
Hi, I currently use the email node to send a email to my iphone to notify if something is triggered on node-red but its a bit slow, I was wondering what other options are available, just need something to go bing and popup a message on the iphone, any suggestions welcome, thanks.

Nicholas O'Leary

unread,
Feb 16, 2016, 10:16:21 AM2/16/16
to Node-RED

Have a look at pushbullet - http://flows.nodered.org/node/node-red-node-pushbullet

Nick


On Tue, 16 Feb 2016, 15:09 Toshi Bass <toshib...@gmail.com> wrote:
Hi, I currently use the email node to send a email to my iphone to notify if something is triggered on node-red but its a bit slow, I was wondering what other options are available, just need something to go bing and popup a message on the iphone, any suggestions welcome, thanks.

--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Setrem

unread,
Feb 16, 2016, 10:17:21 AM2/16/16
to Node-RED
Take a look at Prowl http://www.prowlapp.com.

Toshi Bass

unread,
Feb 16, 2016, 12:52:16 PM2/16/16
to Node-RED
OK thanks, trying pushbullet as its free hahaha


Toshi Bass

unread,
Feb 17, 2016, 11:37:54 AM2/17/16
to Node-RED
Ok Pushbullet is working fine however is there any way to set the title on the widget from a function node/..

Reason when pushbullet bings on the ios lock screen all you see is the title but I would like the title to have a time stamp, sure I can do that in the payload but you have to open the iphone and go in the app to read the payload !

So the Title I currently see on the lock screen is Garage Light On what I want is what I have in the payload    16:18:57 Sonoff s1 Garage Light On



I read that  Optionally uses msg.topic to set the title, if not already set in the properties. but I cannot even see how to do that. 

Dave C-J

unread,
Feb 17, 2016, 12:02:22 PM2/17/16
to node...@googlegroups.com

I think you just about described the answer yourself :-)
In your function node set msg.topic to be what you want it to be... In this case, msg.payload.
(And don't set it on the edit dialogue)

Toshi Bass

unread,
Feb 17, 2016, 1:03:00 PM2/17/16
to Node-RED
Describing it and doing it appears to be 2 different things I am having big trouble with the msg.topic bit ...

Here's my working function node which when connected to a a couple of pushbullet nodes works as described in the previous post 

msg1={};
msg2={};

var d=new Date();
  var h = d.getHours();
  var m = d.getMinutes();
  var s = d.getSeconds();
  if (h<10){h="0"+h}
  if (m<10){m="0"+m}
  if (s<10){s="0"+s}
  time = (h+":"+m+":"+s);

if (msg.payload == 1){
    msg1 = time+" Sonoff s1 Garage Light On";
    msg2 = null;
}
if (msg.payload === 0){
    msg1 = null;
    msg2 = time+" Sonoff s1 Garage Light Off";    
}
return [msg1,msg2];

thought the easy way would be to stick another function node to in line to convert the output from the above to msg.topic and combine them later but it doesn't work ?

msg.topic={};
msg.topic = msg.payload;
return [msg.topic];

any ideas ?

Mark Setrem

unread,
Feb 17, 2016, 1:25:10 PM2/17/16
to Node-RED
I'm not sure why you have set up 2 pushbullet nodes, if the both messages end up sending a pushbullet message.

However assuming you need to do it that way, you need to pass on (return) to the entire message so "return msg;"  This is good practice anyway as certain nodes use the msg."properties" to tie an input and and output node together ( e.g. the http nodes )


Its easy to do what you are trying to do  within your existing function such as:

msg1={};
msg2={};

var d=new Date();
  var h = d.getHours();
  var m = d.getMinutes();
  var s = d.getSeconds();
  if (h<10){h="0"+h}
  if (m<10){m="0"+m}
  if (s<10){s="0"+s}
  time = (h+":"+m+":"+s);

if (msg.payload == 1){
    msg1.payload = time+" Sonoff s1 Garage Light On";
    msg2.payload = null;
msg1.topic =  msg1.payload;
 
 
 
}
if (msg.payload === 0){
    msg1.payload = null;
    msg2.payload = time+" Sonoff s1 Garage Light Off"; 
msg2.topic =  msg2.payload; 
   
}
return [msg1,msg2];


However if you are sending them both to the same configuration of pushbullet you can simplify it to be:

var d=new Date();
  var h = d.getHours();
  var m = d.getMinutes();
  var s = d.getSeconds();
  if (h<10){h="0"+h}
  if (m<10){m="0"+m}
  if (s<10){s="0"+s}
  time = (h+":"+m+":"+s);

if (msg.payload == 1){
    msg.payload = time+" Sonoff s1 Garage Light On";
   msg.topic =  msg.payload;
 
}
if (msg.payload === 0){
    msg.payload = time+" Sonoff s1 Garage Light Off"; 
msg.topic =  msg.payload; 
   
}
return msg;







On Wednesday, 17 February 2016 18:03:00 UTC, Toshi Bass wrote:
Describing it and doing it appears to be 2 different things I am having big trouble with the msg.topic bit ...

Here's my working function node which when connected to a a couple of pushbullet nodes works as described in the previous post 

msg1={};
msg2={};

var d=new Date();
  var h = d.getHours();
  var m = d.getMinutes();
  var s = d.getSeconds();
  if (h<10){h="0"+h}
  if (m<10){m="0"+m}
  if (s<10){s="0"+s}
  time = (h+":"+m+":"+s);

if (msg.payload == 1){
    msg1.payload = time+" Sonoff s1 Garage Light On";
    msg2.payload = null;
msg1.topic =  msg1.payload;
 
 
 
}
if (msg.payload === 0){
    msg1.payload = null;
    msg2.payload = time+" Sonoff s1 Garage Light Off";
msg2.topic =  msg2.payload; 

Dave C-J

unread,
Feb 17, 2016, 1:32:49 PM2/17/16
to node...@googlegroups.com

Yeah, I was about to say that.... !
(No I wasn't ;-)
Thanks Mark

Toshi Bass

unread,
Feb 17, 2016, 2:06:50 PM2/17/16
to Node-RED
Ok thanks that works great I used the second example with one pushbullet node (the reason I split the function to use 2 pushbullet nodes originally was my first attempt to get at the Title so on the lock screen it would say Garage Light On or Garage Light Off)  ((nothing to do with what the payload said)) if you get my drift.

Anyways thanks again. 

Julian Knight

unread,
Feb 19, 2016, 11:28:01 AM2/19/16
to Node-RED
Bear in mind that, while PB is free, it is also not very clever!

Don't try to send too much to it unless you make the effort to also expire/delete your messages otherwise it totally clogs up - like when I didn't quite get the logic right on my freezer door warning and then went on holiday for a few days - the sensor dropped off the door and so triggered an open warning every minute! You would think I would have learned my lesson but I accidentally did something similar with a warning about my MongoDB database recently!

Trying to get rid of loads of messages out of PB is a pain with the only real method being to delete ALL messages via the web interface.

I've also had performance issues with the iOS app though they've updated it recently so hopefully fixed some of that.
Reply all
Reply to author
Forward
0 new messages