pushbullet node file example

707 views
Skip to first unread message

Andreas W.

unread,
Aug 14, 2015, 4:06:24 AM8/14/15
to Node-RED
Hey,

someone has an example for sending a file as pushbullet message from node red?
From the pushbullet API it looks like it has to be a two step way, upload file after that get the
file_url back and use it in a push message?!

Main goal is to get an Image from a ip camera and send it as pushbullet message.
Getting the image an save it to a file works fine so far...

Thanks in advance

Dave C-J

unread,
Aug 14, 2015, 10:29:23 AM8/14/15
to node...@googlegroups.com
Hi,
The existing node won't support this two step behaviour that is required so it's going to be hard.
As the existing http request node also currently does not support multipart (as pointed out in another thread) - then even doing step 2 as a separate step is not off the shelf either... though some of the community have pointed out way to do this.

Andreas W.

unread,
Aug 18, 2015, 6:08:13 AM8/18/15
to Node-RED
Hi Dave,

thanks for the reply - so in this case, the node option of type file has no further function behind?
Or is it possible to send a file in one step only to pushbullet?

Another idea would be to upload the Image to somehwere else and publish just the link or maybe embed it into a pushbullet message?!

Best regards

Andreas W.

unread,
Aug 19, 2015, 6:00:37 AM8/19/15
to Node-RED
Sorry... made a big mistake - everything works fine!!

[{"id":"d4f8fc23.2b07","type":"pushbullet-config","name":"Not valid!!"},{"id":"a3daadbc.5c255","type":"pushbullet","config":"d4f8fc23.2b07","pushtype":"file","title":"IP Cam Image","chan":"","name":"Push local IP Cam Image","x":1083,"y":133,"z":"bf2a0c8d.40d5f","wires":[]},{"id":"abde26b1.5421d8","type":"inject","name":"Start IP Cam Image push","topic":"","payload":"","payloadType":"none","repeat":"","crontab":"","once":false,"x":219,"y":133,"z":"bf2a0c8d.40d5f","wires":[["9cde73c8.63219"]]},{"id":"9cde73c8.63219","type":"http request","name":"Get IP Cam Image","method":"GET","ret":"bin","url":"http://youripcam:1234/snapshot.cgi","x":447,"y":133,"z":"bf2a0c8d.40d5f","wires":[["c21366a4.3dec98","1c2f35e3.e3d0ca"]]},{"id":"49102d23.b6efd4","type":"function","name":"Add attributes","func":"msg.payload = \"/tmp/test.jpg\"\nreturn msg;","outputs":1,"noerr":0,"x":850,"y":133,"z":"bf2a0c8d.40d5f","wires":[["a3daadbc.5c255"]]},{"id":"c21366a4.3dec98","type":"file","name":"Store file to tmp","filename":"/tmp/test.jpg","appendNewline":false,"overwriteFile":"true","x":686,"y":63,"z":"bf2a0c8d.40d5f","wires":[]},{"id":"1c2f35e3.e3d0ca","type":"delay","name":"Wait for stored file","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":661,"y":133,"z":"bf2a0c8d.40d5f","wires":[["49102d23.b6efd4"]]}]


The image is stored currently into /tmp/ and pushed by the pushbullet node - maybe the delay is not needed - have to do some tests.
Be carefully - the Images are stored at pushbullet Servers, dont know if there is a way to remove them?!
Would be better to provide the option to just send an URL als image path instead of the complete file as explained here:


Best regards,

-andreas
Reply all
Reply to author
Forward
0 new messages