Pushbullet-notification to multiple receivers

Client tools or tools that can connect with Domoticz. Tools for Windows, iOS, Android, Linux etc.
Post Reply
User avatar
thorbj
Posts: 198
Joined: Thursday 20 November 2014 23:11
Target OS: Raspberry Pi
Domoticz version: beta
Location: Norway
Contact:

Pushbullet-notification to multiple receivers

Post by thorbj » Tuesday 29 September 2015 12:03

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: 312
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi
Domoticz version: Beta
Contact:

Re: Pushbullet-notification to multiple receivers

Post by Justintime » Tuesday 29 September 2015 15:37

Yes I would like to know too... But when the washing machine is ready you should only notify your wife. :)

User avatar
Mooseknuckle
Posts: 68
Joined: Sunday 08 March 2015 10:24
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Pushbullet-notification to multiple receivers

Post by Mooseknuckle » Tuesday 29 September 2015 16:19

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

User avatar
thorbj
Posts: 198
Joined: Thursday 20 November 2014 23:11
Target OS: Raspberry Pi
Domoticz version: beta
Location: Norway
Contact:

Re: Pushbullet-notification to multiple receivers

Post by thorbj » Wednesday 30 September 2015 13:07

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: 68
Joined: Sunday 08 March 2015 10:24
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Pushbullet-notification to multiple receivers

Post by Mooseknuckle » Wednesday 30 September 2015 14:52

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

User avatar
thorbj
Posts: 198
Joined: Thursday 20 November 2014 23:11
Target OS: Raspberry Pi
Domoticz version: beta
Location: Norway
Contact:

Re: Pushbullet-notification to multiple receivers

Post by thorbj » Wednesday 30 September 2015 15:08

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: 68
Joined: Sunday 08 March 2015 10:24
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Pushbullet-notification to multiple receivers

Post by Mooseknuckle » Wednesday 30 September 2015 16:27

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

User avatar
thorbj
Posts: 198
Joined: Thursday 20 November 2014 23:11
Target OS: Raspberry Pi
Domoticz version: beta
Location: Norway
Contact:

Re: Pushbullet-notification to multiple receivers

Post by thorbj » Thursday 01 October 2015 11:27

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: 242
Joined: Sunday 14 July 2013 11:19
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Ipswich, UK
Contact:

Re: Pushbullet-notification to multiple receivers

Post by commodore white » Tuesday 03 November 2015 13:04

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

User avatar
Whatsek
Posts: 77
Joined: Saturday 31 May 2014 23:48
Target OS: Raspberry Pi
Domoticz version: Latest B
Location: Hilversum, The Netherlands
Contact:

Re: Pushbullet-notification to multiple receivers

Post by Whatsek » Sunday 08 November 2015 16:41

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.

User avatar
thorbj
Posts: 198
Joined: Thursday 20 November 2014 23:11
Target OS: Raspberry Pi
Domoticz version: beta
Location: Norway
Contact:

Re: Pushbullet-notification to multiple receivers

Post by thorbj » Wednesday 18 November 2015 13:36

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 » Wednesday 24 May 2017 18:26

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 2 guests