Charmed Quark Systems, Ltd. - Support Forums and Community
Pushbullet Driver - Printable Version

+- Charmed Quark Systems, Ltd. - Support Forums and Community (
+-- Forum: General Discussion (
+--- Forum: Driver Development (
+--- Thread: Pushbullet Driver (/showthread.php?tid=10581)

Pushbullet Driver - whozeawhat - 05-13-2018

Pushbullet is a cross-platform messaging service that has both paid and free account options. It allows users to send text notifications, links, and files to multiple devices, such as computers and phones. Pushbullet can connect to IFTTT, Android Tasker, and even has a few community tools for the platforms/connections that aren't directly developed by Pushbullet. Free accounts (without a Pro subscription) are limited to 500 pushes per month.

This driver can send and process Pushbullet messages of type: note and link. File operations are not supported by this driver. To send a push, simply write to the field 'SendPush' with a properly formatted string, such as:

{"body":"Space Elevator, Mars Hyperloop, Space Model S (Model Space?)","title":"Space Travel Ideas","type":"note"}

If the format (of the text written to 'SendPush') is unacceptable to Pushbullet or if the send fails, the field '$Naks' will increment. Further options for sending push events are available at:

Fields prefixed with 'LatestPush-' are user-defined in the config file, per the parameter 'PushElementPairs'. This is a comma-separated list of element pairs. The first half of each pair is the element name, such as 'type'. The second half of each pair is a unique token, that can be included in the parameter, 'HistoryFormat', which defines the template format for each historical entry.

For example, if the config file was defined as:


Then two fields, 'LatestPush-title' and 'LatestPush-body' would be created, and each listing in the field 'History' will be formatted as "<title>-<body>". 'LatestPush-Localtime' is always created to provide a native time for the latest processed push event.

Other push element options include: type, iden, url, body, title, modified

Account rate limit information is provided via 3 fields. The units are a sort of generic 'cost' number. A request costs 1 and a database operation costs 4. 'Ratelimit-Limit' is the total units for the account, 'Ratelimit-Remaining' is the remaining units, and 'Ratelimit-Reset' is the datetime for the next usage cycle.

Additional fields are available for troubleshooting: 'Command' and 'LastKeepAliveTime'. If the websocket is active, the 'LastKeepAliveTime' will increment every 30 seconds. 'Command' allows a user to perform low-level operations, that shouldn't ever be needed (hopefully).
The driver initiates a websocket connection, so new data notices are pushed (instead of polled), and then performs a secure HTTPS request for new data. If requires a secure tunnel, such as stunnel, to create a safe connection to pushbullet servers.


Setup Directions

1) Obtain access token from Pushbullet account

2) Configure stunnel (or similar) for new connection
---When configuring stunnel, select an unused port for the 'accept' line, then enter the same port number when configuring the CQC driver

3) Create driver config file, updating line starting 'Token~' with access token. Move config file to MacroFileRoot (or subfolder).

4) Configure CQC driver.

----If stunnel is installed on the same machine as CQC, enter '' for the address. Otherwise, a IPv4 address is recommended. 'localhost' does not work, at least for me.


Sample Pushbullet config file:

###############        CONFIG FILE - for Pushbullet Device Driver        ###############
#### ---- One config item per line, Use '~' for seperator. Lines with '#' will be ignored. ---- ####
# Required - below:

# Access Token is alpha-numerical string

# Optional - Defaults/info provided below:

# csv pairs of push element and token for history format

# template string for history entries
HistoryFormat~%(T) - %(B)

# number of entries in history list

# enables logging to file

# interval for poll cycle, in milliseconds


Sample stunnel config section, but be sure to update port on 'accept' line:

client = yes
accept =
connect =
checkHost =
verifyChain = yes
CAfile = ca-certs.pem


Hope you enjoy!
Feel free to reply in the thread, even if you just are trying the driver out. I'm curious about interest. Thanks!

RE: Pushbullet Driver - whozeawhat - 05-13-2018

Future Development Possibilities:

-) Custom Field
>> Similar to POP & IMAP drivers, allows custom field creation and updates based on properly formatted messages

-) Subscriptions/Following
>> I’m not yet certain how these should implemented, so I’m still exploring options.

-) File Processing
>> Is there a desire for this?