Pushbullet Action Add-on

Tags: #<Tag:0x00007f0142c428a0> #<Tag:0x00007f0142c42760>

(Hakan Tandogan) #42

Ah, in that case, let me start looking into what would be necessary to set up a push listener. Might end up being OH2 only, though.

(Rich Koshak) #43

Someone made a binding way back before OH2 that sent and received (they never posted their code anywhere). But my point is that a binding is very possible.

I think it used the Pushbullet API to subscribe for messages so no need to open your network up not a need to poll for new messages.

(Hakan Tandogan) #44

Yes, actually, this very thread was created by that guy. Unfortunately, I could not convince him (or her) to open up the sources and contribute to the OH2 code tree. Therefore, one day I sat down and written my own action. There is a PR for it (linked above) and a marketplace entry too.

Time permitting, I would look into writing a binding that allows subscribing to messages, too. I just never experimented with websockets until now, so it would be a learning experience for me too :smile:

(Matze) #45

Happy new year to everybody
after all this discussion in this thread, there is a Pushbullet action in OH 2.2, finally. :slight_smile:
Unfortunately the documentation is very light.
There is only the link to the pushbullet api, but no explanation which of the api calls are possible with the action. The stated “sendPushbulletNote” can not be found in the api link, at all.
Does somebody know who is the author of this binding and what commands listed in the api documentation are possible with the binding?
For example I would like to mark a pushed message as “dismissed” or delete it.
Is that possible with the binding?
What are the commands to do that?

I started to try to get the response after pushing a message to get the “iden”, but all I got is “true” as return on the sendPushbulletNote command.

var PushbulletResponse = sendPushbulletNote("","Test", "Test")

Thank you in advance!

(jvanzuijlen) #46

Like you (I think) I thought that the API token was enough to get a message pushed to your device. Turns out that it acts more like a gateway and you have to specify the email adress your account is connected to, in my case gmail. so:

sendPushbulletNote("myemailaddress@gmail.com","Title", "Message")

(jeshab) #47

I have submitted a pull request to include the changes I made to add the ability to push notes to all subscribers of a channel, based on the recipient format, and also have the ability to push notes without specifying a recipient, as @64matze tried to do, as the Pushbullet API will default to broadcast them to all the user account’s devices in that case.

// Broadcast to all user's devices
sendPushbulletNote("Title", "Message")
// Send to all subscribers of a channel
sendPushbulletNote("channel-tag", "Title", "Message")
// Send to an email user
sendPushbulletNote("email@example.com", "Title", "Message")

(Matze) #48

Thank you very much for that update.
Do you think it is possible to add the ability to delete or dismiss a pushed message, too?

Best regards,

(jeshab) #49

@64matze the changes I made only required adding/modifying a few code lines. The abilities you mentioned would require a whole new binding as @hakan mentioned previously and I unfortunately don’t have much time to work on this at the moment.

(Bart Snijder) #50

I’m trying to install the pushbullet functionality but the log says:
“Unconfigured pushbullet bot, please check configuration” I’ve tried multiple .cfg file names and file locations but it does not seem t work. Where should this info be submitted?
Thank you.

(jeshab) #51

@bartsnijder not sure if you got your issue resolved since then. Anyway, this error means that you didn’t setup the service configuration properly. Can you confirm that you setup your Pushbullet access token in conf/services/pushbullet.cfg?

(Smart Office) #52

Is there a possibilty to display the Image of the PiCam 3 to my mobile phone or tablet?
I integrated my PiCam in openHAB via motion. So i have a url, where i can see the image of the PiCam. And now i would like to transfer the URL to my mobile phone as soon as the doorbell rings.

(Dan) #53

The action doesn’t do this - I do it with the pushbullet-cli interface and bash scripts: https://github.com/GustavoKatel/pushbullet-cli

(Felicien Kakelly) #54

Hello Dan,
Can you please give us an example of your rule?


(Dan) #55

it’s very simple. The rule includes:

executeCommandLine("bash /etc/openhab2/utils/doorbell.sh")

then that bash file grabs the image from the ip camera and uses the pushbullet CLI interface to push it:

wget -O /tmp/entryphone.jpg
/etc/openhab2/utils/pushbullet.sh push all file /tmp/entryphone.jpg 'Doorbell!'


(Keith Wheaton) #56

I must be missing something here… As others have mentioned, the pushbullet documentation is very light. I believe I have everything configured correctly but it doesn’t seem to be sending messages. For the sake of being thorough, here is everything involved in my setup:

OH Version: 2.3.0
Pushbullet Action Version: 1.12.0

Item Config:

Switch MovieMode "Movie Mode"

Pushbullet Config:

# Pushbullet action configuration

# You can set up multiple accounts if you want to have separate channels or just go with the
# default bot if you leave the "bots=" key empty.
# Access Token can be created on the Account settings, https://www.pushbullet.com/#settings/account

# Minimal setup, just one bot with the default name and token

# Extended setup with multiple bots, each with its own access token
# bots=bot1,bot2

# bot1.devicename=openHAB-foobar
# bot1.accesstoken=1234abc

# bot2.devicename=openHAB-tralala
# bot2.accesstoken=4711qwert

Pushbullet Rule:

rule "Back door"
        Item MovieMode received update
        if (MovieMode==ON)
                sendPushbulletNote("DEFAULT", "myEmail@gmail.com", "IT WORKED", "Movie Mode is ON")
        if (MovieMode==OFF)
                sendPushbulletNote("DEFAULT", "myEmail@gmail.com", "IT WORKED AGAIN", "Movie Mode is OFF")

I have tried several variations of the sendPushbulletNote() function from just a title and message to what is shown above. When I toggle the switch in my sitemap I can see that another other rule connected to the item ‘MovieMode’ is firing but this one does not appear to be working. Can someone please verify that I have this configured correctly or correct my mistake?

(jeshab) #57

@scoobydrvr You should be checking for the switch state in your rule. One way to determine if the commands were at least getting triggered is to use logInfo statements in the same block. Regarding the Pushbullet command, no need to specify the botname. If you are fine with getting the notification broadcast to your Pushbullet devices, specifying the title and message should be sufficient. If this doesn’t work, you can raise the debug level of this binding to have more clarity of what is happening in the logs.

rule "Back door"
        Item MovieMode received update
        if (MovieMode.state==ON)
                logInfo("MovieMode", "Movie Mode is ON")
                sendPushbulletNote("IT WORKED", "Movie Mode is ON")
        if (MovieMode.state==OFF)
                logInfo("MovieMode", "Movie Mode is OFF")
                sendPushbulletNote("IT WORKED AGAIN", "Movie Mode is OFF")

(Keith Wheaton) #58

I can’t believe that’s what I’ve been fighting this whole time! Just a simple oversight in the code… Thank you very much for pointing it out!

(Kamil Resulov) #59

this rule working for me, only when i add mail

sendPushbulletNote("myemairiqestiredinPushBullet@mail.com","IT WORKED", "Movie Mode is ON")

(jeshab) #60

All depends on how you want to be notified and how your Pushbullet devices are setup. But if you are satisfied with how you are notified specifying an email, then you can use the rule the way you called the function.

(Angelos) #61

It was recently improved: https://www.openhab.org/addons/actions/pushbullet :slight_smile: