Pushbullet-notification to multiple receivers

Client tools or tools that can connect with Domoticz. Tools for Windows, iOS, Android, Linux etc.

Moderator: leecollings

Post Reply
thorbj
Posts: 113
Joined: Thursday 20 November 2014 22:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Norway
Contact:

Pushbullet-notification to multiple receivers

Post 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!
2xRaspberry Pi Model 2 w/RaZberry z-wave chip (master/slave)|Fibaro Wall Plug|Fibaro Universal Dimmer 500W|Aeon Labs Multisensor|RFXtrx433E|Nexa WMR-1000|Nexa Pe-3|Nexa Remote|Nexa LGDR3500|Lightify Gateway|Lightify RGBW bulb
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Pushbullet-notification to multiple receivers

Post by Justintime »

Yes I would like to know too... But when the washing machine is ready you should only notify your wife. :)
User avatar
Mooseknuckle
Posts: 43
Joined: Sunday 08 March 2015 9:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Pushbullet-notification to multiple receivers

Post 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.
RPI 3, Philips Hue,Toon Thermostat, Harmony Smart Control, Yeelights
Mysensors wifi gateway + sensors, RFXtrx433E, Kaku stuff, Xiaomi gateway + sensors
Domoticz controlled DIY ambilight, Selectplus chime, Mi-light led controller
thorbj
Posts: 113
Joined: Thursday 20 November 2014 22:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Norway
Contact:

Re: Pushbullet-notification to multiple receivers

Post 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
2xRaspberry Pi Model 2 w/RaZberry z-wave chip (master/slave)|Fibaro Wall Plug|Fibaro Universal Dimmer 500W|Aeon Labs Multisensor|RFXtrx433E|Nexa WMR-1000|Nexa Pe-3|Nexa Remote|Nexa LGDR3500|Lightify Gateway|Lightify RGBW bulb
User avatar
Mooseknuckle
Posts: 43
Joined: Sunday 08 March 2015 9:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Pushbullet-notification to multiple receivers

Post 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.
Last edited by Mooseknuckle on Wednesday 30 September 2015 16:27, edited 1 time in total.
RPI 3, Philips Hue,Toon Thermostat, Harmony Smart Control, Yeelights
Mysensors wifi gateway + sensors, RFXtrx433E, Kaku stuff, Xiaomi gateway + sensors
Domoticz controlled DIY ambilight, Selectplus chime, Mi-light led controller
thorbj
Posts: 113
Joined: Thursday 20 November 2014 22:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Norway
Contact:

Re: Pushbullet-notification to multiple receivers

Post 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?
2xRaspberry Pi Model 2 w/RaZberry z-wave chip (master/slave)|Fibaro Wall Plug|Fibaro Universal Dimmer 500W|Aeon Labs Multisensor|RFXtrx433E|Nexa WMR-1000|Nexa Pe-3|Nexa Remote|Nexa LGDR3500|Lightify Gateway|Lightify RGBW bulb
User avatar
Mooseknuckle
Posts: 43
Joined: Sunday 08 March 2015 9:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Pushbullet-notification to multiple receivers

Post 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"
RPI 3, Philips Hue,Toon Thermostat, Harmony Smart Control, Yeelights
Mysensors wifi gateway + sensors, RFXtrx433E, Kaku stuff, Xiaomi gateway + sensors
Domoticz controlled DIY ambilight, Selectplus chime, Mi-light led controller
thorbj
Posts: 113
Joined: Thursday 20 November 2014 22:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Norway
Contact:

Re: Pushbullet-notification to multiple receivers

Post by thorbj »

That worked great! Thank you :)
2xRaspberry Pi Model 2 w/RaZberry z-wave chip (master/slave)|Fibaro Wall Plug|Fibaro Universal Dimmer 500W|Aeon Labs Multisensor|RFXtrx433E|Nexa WMR-1000|Nexa Pe-3|Nexa Remote|Nexa LGDR3500|Lightify Gateway|Lightify RGBW bulb
commodore white
Posts: 63
Joined: Sunday 14 July 2013 11:19
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Ipswich, UK
Contact:

Re: Pushbullet-notification to multiple receivers

Post 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
Whatsek
Posts: 16
Joined: Saturday 31 May 2014 23:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Latest B
Location: Hilversum, The Netherlands
Contact:

Re: Pushbullet-notification to multiple receivers

Post 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.
thorbj
Posts: 113
Joined: Thursday 20 November 2014 22:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Norway
Contact:

Re: Pushbullet-notification to multiple receivers

Post 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...
2xRaspberry Pi Model 2 w/RaZberry z-wave chip (master/slave)|Fibaro Wall Plug|Fibaro Universal Dimmer 500W|Aeon Labs Multisensor|RFXtrx433E|Nexa WMR-1000|Nexa Pe-3|Nexa Remote|Nexa LGDR3500|Lightify Gateway|Lightify RGBW bulb
zoltar
Posts: 1
Joined: Wednesday 24 May 2017 18:13
Target OS: Linux
Domoticz version:
Contact:

Re: Pushbullet-notification to multiple receivers

Post 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".
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest