Pushbullet Action Add-on

@rlkoshak
@joshpond80

Can you guys please re-upload the install files as OP is apparently gone?

@bro

here are the ones that I have. If anyone has a better and free place to share them that would be good so I can remove it from my dropbox.
Josh

1 Like

Personally I decided to move away from this since OP had vanished, and I donā€™t think the source code is available. I started using Telegram as that is well supportedā€¦

Thank you Josh!
I wish the addon was still supported or at least opensourced, so other developers had a chance to contribute to this. Pushbullet has a large community as well.

Since the original author did not post a license I donā€™t feel comfortable posting the code.

Probably an even better solution is to search the forum for ā€œPushbulletā€ and you should find a recent post on how to send directly using Exec binding or HTTP binding.

1 Like

To avoid duplication of effort:

Since I could not reach the original author and there seems to be a real demand for a pushbullet action, I started a clean-room re-implementation of such an addon. It will be available as source for integration into the main source tree on github.

As usual, no timeframe, it will be done when it is done :wink:

2 Likes

Would be lovely if you could add an action for pushing an image - pushbullet does this better than anything else Iā€™ve found, and itā€™s invaluable for sending me images when a security camera detects movement.

At the moment I do this with a rather unsatisfactory series of shell scripts. That said, the shell scripts work, and an action is neater but not necessarily better. So, if you do look at this, please donā€™t spend too much time on it!

Dan

Let me check what I can do after doing the basics first. Feel free to prod me again after the first version is written and merged into the core :slight_smile:

@hakan have you made any progress with Pushbullet action lastly?

Actually, I restarted working on this just two days ago :smile:

It was a pretty hard effort to rebase everything back to the current development HEAD, but after that, Iā€™m back on track.

1 Like

Awesome! Let us know if you need any help with testing.

In the meantime I found a way (workaround actually) to notify my pushbullet using simple Node.js script.
Hereā€™s the pushbullet package in npm Iā€™m using.

And my script:

var PushBullet = require('pushbullet');
var pusher = new PushBullet('APIKEY');
var noteTitle = process.argv[3] || "OpenHAB";
var noteBody = process.argv[2];

if(noteBody) {
	pusher.note({}, noteTitle, noteBody, function(error, response) {
	    if(error) {
	    	console.log(error);
	    }
	    console.log(response);
	});
}

In openHAB rules Iā€™m just calling this Node.js script like so:

executeCommandLine("node@@/etc/openhab2/html/pushbullet/push@@Hello there")

As you see, itā€™s poor mans pushbullet integration, but Iā€™m really looking forward to see @hakan work in action :slight_smile:

Thanks @kubawolanin!!!
The solution is great for me!

News, news :slight_smile:

I have a working pushbullet action now, which I have successfully used to push messages for a few days now.

Pull Request:

Downloadable jar:

https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/action/org.openhab.action.pushbullet/1.11.0-SNAPSHOT/org.openhab.action.pushbullet-1.11.0-SNAPSHOT.jar

I have created an entry at the marketplace as well, and it has been moderated just now:

Letā€™s hope I can get the action through the review process in a shorter time than it took me to finally get off my butt and write the code :stuck_out_tongue:

5 Likes

Nice, Jenkins successfully built my PR, so you donā€™t have to download the archive from dropbox anymore :slight_smile:

This is fantastic.

As promised, I am now greedily prodding you to see if you can add the ability to push imagesā€¦

As soon as the initial version is merged into master :smile:

1 Like

@hakan is there a simple way to receive pushes through your action?
Presumably itā€™ll require a separate binding, right?

Right now I have a simple node.js script sitting on my RaspberryPI.
Its only job is to pass the text to openHABā€™s /voice/interpreters/.

var PushBullet = require('pushbullet');
var request = require('request');
var pusher = new PushBullet('TOKEN');

var openHABdevice = "SOME_DEVICE_ID";

var sender_email = [
    'my@email.com',
    'second@email.com'
];

var stream = pusher.stream();
stream.connect();

stream.on('message', function(push) {
    if( push.type === "tickle" && push.subtype === "push" ) {
        var options = {
            limit: 1
        };

        pusher.history(options, function(error, response) {
            var lastPush = response.pushes[0];
            var iden = lastPush.iden;
            if( lastPush.target_device_iden === openHABdevice && 
                lastPush.type === "note" && 
                sender_email.indexOf(lastPush.sender_email) > -1 ) {
                request.post(
                    'http://openhabianpi:8080/rest/voice/interpreters',
                    { body: lastPush.body },
                    function (error, response, body) {
                        if (!error && response.statusCode == 200) {
                            pusher.deletePush(iden);
                        }
                    }
                );
            }
        });
    }
});

I run this script using forever.

How feasible it is to react on new pushes from openHAB?

Cheers,
Kuba

I wanted to look into receiving as well, as this would be a nice way to create a pushbullet / openHAB bot :smile:

I think as well that this would require a separate binding. I am not sure how well this would work with OH1 and actions, maybe I woul end up creating something completely new for OH2. In any case, I fear this would take some time for me to get around to.

1 Like

Just out of interest, do you have your Pi reachable from the internet? Opening up the box to HTTP requests from the outside (possibly unauthenticated, as I cannot control the pushbullet servers) would give me a slightly bad feeling :blush:

Nope :slight_smile:

1 Like