Page 1 of 1
Pushbullet-notification to multiple receivers
Posted: Tuesday 29 September 2015 12:03
by thorbj
Hi, does anyone know if and how it is possible to send pushbullet-notifications to multiple receivers? I.e. if the washing-machine is done I want Domoticz to notify both me and my wife.
Thanks!
Re: Pushbullet-notification to multiple receivers
Posted: Tuesday 29 September 2015 15:37
by Justintime
Yes I would like to know too... But when the washing machine is ready you should only notify your wife.

Re: Pushbullet-notification to multiple receivers
Posted: Tuesday 29 September 2015 16:19
by Mooseknuckle
I use the bash script described here for that:
http://www.domoticz.com/forum/viewtopic.php?f=31&t=3188
Code: Select all
#!/bin/bash
api=<Put_Your_API_KEY_HERE>
title=$1
body=$2
curl -u $api: https://api.pushbullet.com/v2/pushes -d type=note -d title=$title -d body=$body
You can make 2 scripts, one for you and one for your wife. You can even send it to a specific device if you have more devices with pushbullet configured.
If you add "-d device_iden='pushbullet id of your device'" to the last line you can target a specific device.
Re: Pushbullet-notification to multiple receivers
Posted: Wednesday 30 September 2015 13:07
by thorbj
Mooseknuckle wrote:I use the bash script described here for that:
http://www.domoticz.com/forum/viewtopic.php?f=31&t=3188
Code: Select all
#!/bin/bash
api=<Put_Your_API_KEY_HERE>
title=$1
body=$2
curl -u $api: https://api.pushbullet.com/v2/pushes -d type=note -d title=$title -d body=$body
You can make 2 scripts, one for you and one for your wife. You can even send it to a specific device if you have more devices with pushbullet configured.
If you add "-d device_iden='pushbullet id of your device'" to the last line you can target a specific device.
And then I call the batch-script from a switch? Or a Lua script?
Edit: I get
Code: Select all
Error: Error executing script command (/home/pi/domoticz/scripts/bash/pb_washingmachine.sh). returned: 1536
when executing it from the switch.
This is my code:
Code: Select all
#!/bin/bash
api=myApIkeY
title='Washing machine finished'
body='Hi, the washing machine is finished :)'
curl -u $api: https://api.pushbullet.com/v2/pushes -d type=note -d title=$title -d body=$body
Re: Pushbullet-notification to multiple receivers
Posted: Wednesday 30 September 2015 14:52
by Mooseknuckle
Hi,
You don't change anything in the script (except your key).
From a lua script:
Code: Select all
os.execute('/home/pi/domoticz/scripts/pushbullet.sh "Alert" "The dishwasher is ready"')
From a switch (On or Off action):
Code: Select all
script://home/pi/domoticz/scripts/pushbullet.sh "Alert" "The dishwasher is ready"
This way the script never changes for different alerts, only the arguments.
Re: Pushbullet-notification to multiple receivers
Posted: Wednesday 30 September 2015 15:08
by thorbj
Ah, now I see, thank you!
But I only get the first word in the message; The
And i see this in the log:
Code: Select all
Error: Error executing script command (/home/pi/domoticz/scripts/bash/pb_washingmachine.sh). returned: 1536
What does that mean?
Re: Pushbullet-notification to multiple receivers
Posted: Wednesday 30 September 2015 16:27
by Mooseknuckle
I don't really know. I use the script from a lua script and it works. Also if I run it from the commandline with:
Code: Select all
./pushbullet.sh "test" "this is a test"
This also works. Can you try that?
PS. Try adjusting the script to:
Code: Select all
#!/bin/bash
api=<Put_Your_API_KEY_HERE>
title="$1"
body="$2"
curl -u $api: https://api.pushbullet.com/v2/pushes -d type=note -d title="$title" -d body="$body"
Re: Pushbullet-notification to multiple receivers
Posted: Thursday 01 October 2015 11:27
by thorbj
That worked great! Thank you

Re: Pushbullet-notification to multiple receivers
Posted: Tuesday 03 November 2015 12:04
by commodore white
OK! I give in..... Who sits by the washing machine waiting for it to finish then invoke these scripts? Oh! Perhaps you do it by electrickery. Exactly do you do that?
Peter
Re: Pushbullet-notification to multiple receivers
Posted: Sunday 08 November 2015 15:41
by Whatsek
If we could push notifications to a pushbullet channel, (you create one on the website, and the both of you subscribe to that channel) then you will receive both the notification.
Re: Pushbullet-notification to multiple receivers
Posted: Wednesday 18 November 2015 12:36
by thorbj
commodore white wrote:OK! I give in..... Who sits by the washing machine waiting for it to finish then invoke these scripts? Oh! Perhaps you do it by electrickery. Exactly do you do that?
Peter
I'm not sure if I understood your question. I have a fibaro wall-plug that measures power-consumption, and when it drops below a given value, Domoticz invokes a script to notify me.
Although I haven't got it to work right yet. As of now I'm beeing flooded with notifications every time the machine has a pause in the program...
Re: Pushbullet-notification to multiple receivers
Posted: Wednesday 24 May 2017 18:26
by zoltar
Actually you don't need a script for this. If you have created a channel in Pushbullet via
https://www.pushbullet.com/my-channel you can push messages to it via custom HTTP notification (Custom HTTP/Action) type in settings and there can be any number of channel subscribers.
URL/Action:
https://api.pushbullet.com/v2/pushes
POST Data:
type=note&title=#SUBJECT&body=#MESSAGE&channel_tag=your_channel
POST Content-Type:
application/x-www-form-urlencoded
POST Headers:
Authorization: Basic <API Key hash>
You can get <API Key hash> calling
https://api.pushbullet.com/v2/pushes via curl like this:
Code: Select all
curl -u"<API key>:" "https://api.pushbullet.com/v2/pushes" -d type=note -d title="Alert test" -d body="Body msg" -d channel_tag=your_channel -vvv
You will see Authorization header in verbose messages. Note the ":" after API key - there is no password.
Get your access token using
https://www.pushbullet.com/#settings/account and pressing on "Create access token".