Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pushbullet Driver
#1
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.

https://www.pushbullet.com

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: https://docs.pushbullet.com/

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:

PushElementPairs~title,T,body,B
HistoryFormat~%(T)-%(B)

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 '127.0.0.1' 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
Token~<Get-This-From-Pushbullet-Account----AccessToken>


###############
# Optional - Defaults/info provided below:
#

# csv pairs of push element and token for history format
PushElementPairs~iden,I,title,T,body,B,modified,M

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

# number of entries in history list
HistorySize~10

# enables logging to file
DebugEnable~False

# interval for poll cycle, in milliseconds
PollInterval~1000



========================================================================

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


[pushbullet-websocket]
client = yes
accept = 127.0.0.1:5000
connect = stream.pushbullet.com:443
checkHost = stream.pushbullet.com
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!


Attached Files
.cqcdrvpack   Pushbullet-v1-0.CQCDrvPack (Size: 16.06 KB / Downloads: 1)
Reply
#2
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.
https://docs.pushbullet.com/#subscription

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


Possibly Related Threads...
Thread Author Replies Views Last Post
  LIFX Driver bobskie708 12 2,143 11-26-2018, 05:23 PM
Last Post: Dean Roddey
  Driver for Bigass Fan lleo 7 223 11-25-2018, 08:57 AM
Last Post: Dean Roddey
  Amazon Echo Hue Simulator Driver wuench 115 41,933 11-08-2018, 06:49 AM
Last Post: karenlee
  RunTimer2 driver rbroders 14 4,177 10-15-2018, 11:45 AM
Last Post: rbroders
  Generic Modbus Driver - Serial & IP znelbok 25 12,617 10-09-2018, 08:59 AM
Last Post: Ron Haley
  Issues debugging IP based driver jnolting 5 566 09-24-2018, 11:52 AM
Last Post: Dean Roddey
  Enhance Driver Test Harness Field Monitor rbroders 1 323 09-24-2018, 10:49 AM
Last Post: Dean Roddey
  Koyo Click PLC Driver rbroders 75 29,097 09-23-2018, 01:18 PM
Last Post: rbroders
  Carrier Infinity HVAC Driver beelzerob 34 13,962 09-07-2018, 01:15 PM
Last Post: lleo
  Sony TV IP driver dogman 10 1,360 08-01-2018, 03:53 PM
Last Post: znelbok

Forum Jump:


Users browsing this thread: 1 Guest(s)